The post FTL of Leon Bambrick from Secretgeek kept intriguing for some while. I (lamely) posted a comment about evaluator, a “excel-formula” library a friend of me wrote, unwilling to spend too much time at it. The idea is cool, and worth exploring, but who does have time these days…
Well, after a while I decided the idea was worth a shot. My primary interest was to work with formula’s, like in a spreadsheet. As you can see in my implementation, the formula-thing is readonly. You can’t change the formula’s after it has been rendered to HTML.
Textboxes are created by the [textbox ]-syntax. The width is determined by the length of the text included (previous example get’s a size=”8” attribute on the input-element). Textboxes can contain formula’s like [@1+2 ]. Formula’s are just functions and/or javascript numerical expressions. You can use ranges: @Sum(t1..t4). Function-names are case insensitive. The width in combination with formula’s is determined by the trailing spaces. A checkbox is [ ] or [X] for unchecked and checked version. Textboxes can be refered to by t1 and checkboxes by c1.
While at it, I added numbering for paragraphs (p1), headings (a heading is a paragraph, but all the containing paragraphs can be refered to as “h1”). You can also have inline formula’s, which get converted to span’s (s1). When a formula resolves in undefined, nothing is displayed. In this way, the heading is displayed/hidden with the checkbox. Otherwise, I had to make distinction between @ShowHide()@ and =@t1+t2 (or @=t1+t2) notation.
Also, to make stuff more interesting, I made up my own wiki-markup. I thought it took less time than integrating something different, like a MarkDown javascript library. I always propagate standards, but after all, this project is about exploring an idea. This way, I thought of some way to improve horizontal rendering in wiki’s. I got inspired by elastic tabstops. Basically, to colons (::) are interpreted as a tabstop, and the horizontal positions within the same paragraph are synchronized. In implementation, it’s just a html table. But with CSS2, you could use table formatting (this is one important aspect of the Acid2-test).
What’s next? What is this leading too. I don’t know. I worked on the things that interested me. For now I’m done with it. It would be nice if someone else extended this implementation with his own ideas, like a chain letter. Or if you want, I can create a Google project for you. Links: