February 03, 2013

A New Skribler

As promised, here is an update on Skribler. I have just uploaded a new experimental version of Skribler on Sourceforge.  A new website is up, as well as an online demo. And it looks a little something like this:
So, yeah, this new version of Skribler is browser-based. I'm mostly relying on three pieces to make it work:
  • HTML5's contentEditable, which forms the basis of everything. It makes all content editable, but for the purpose of a structured editor it is too liberal in what it allows.
  • Rangy, which allows me to capture selections and caret info and manipulate these through Javascript. With a little help of JQuery this allows me to restrict the default behaviour of contentEditable.
  • Knockout.js, which is an amazing Javascript library. This takes care of processing changes to the abstract syntax trees and updating the concrete syntax.
Using this I set up three examples of DSLs:
  • Martin Fowler's Reader Configurations, based on an example from his Language Workbenches article.
  • HTML Template Configuration Language, a DSL created by Thomas Cleenewerck with the purpose of more easily setting up websites through composition of templates.
  • Knockout.js Template Language, which can be used to generate the Knockout templates for transforming abstract syntax trees into conrete syntax. In fact, this example was used to generate its own examples.
This version of Skribler is very much alpha software. It is incomplete (no easy adding of new elements by mere typing yet), and only tested in Firefox on Mac OS X Mountain Lion. By all means play around with it, but don't expect it to work perfectly just yet. :-)

No comments: