gist here


Heres just an update on what I’m working on right now.

I’m quite interested in markdown as an alternative for quick prototyping for many applications which we would normally associate with Office suites.

For example, in my previous post, I’ve talked about deck.js and how it could be easily combined with a simple script to produce presentations quickly.

Now, I’m considering to what I believe can replace spreadsheets (though unlikely). Tangle has been around for a while and at Ten Brighter Ideas Bret Victor talks about the future of perhaps textbooks and digital documents. Interactive Documents which can very well be the standard in the next few years.

So from Hacker News, one person posted his take, called Fangle, using coffeescript. Now a lot of these people are far better than me at programming, but although Fangle ‘worked’, I found it cumbersome to read, it did not have any of the easy to read formatting of the original markdown. So this is my attempt at a more ‘readable’ markdown-esque version of Tangle.

Compared with Fangle, what do I hope to achieve? What do I not attempt to accomplish?
Human-readability is placed at the forefront. There will be no format strings, or logic statements in the document, I don’t want to see formulas after all when I’m reading this in plain text (which in itself is the goal in markdown;

The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

#Formatting

What is the format of my code?

---
formulas, name, attributes all go here
---
Markdown text goes here, we only state the formulas and the initial values here

An example. The cookie example would be rendered like thus:

---
name : Cookie
cookies : {'data_min':1, 'data_max':100, 'data_step':2, 'class' : 'TKAdjustableNumber'}
calPerCookie : {'value_init':50}
dailyCal : {'value_init':2100}
dailyPer : {'format':'%.0f'}
---

When you eat [cookies{'value_init':3} cookies],
you consume [cal{'update':'cookies*calPerCookie'} calories].
That's [dailyPer{'update':'100*cal/dailyCal'}%]

Notice that compared with Fangle, I can call additional variables (calPercookie, dailyCal) which do not reside in the markup. This will allow for easier management of more complex formulas in the future.

The ability to toggle has also been included, an example is as follows:

---
name : Toggle
toggleT: {'toggleTrue':'true', 'toggleFalse':'false', 'class':'TKToggle TKSwitch'}
---
toggle this: [toggleT{'value_init':'true'}]so this is [indic{'update':'toggleT ? "toggle true" : "toggle false"'}]

This is all a work in progress and I hope you like it!