New "javascript" nodetype


javascript is a new nodetype. It can be used inside an html node.

It's useful if you're writing JS code inside a web page, and want to use the features of the outliner to automatically generate curly braces and semicolons (CBASs) in your code, the same way Frontier does it for UserTalk code.

How it works. Anywhere within an html node you can have a node whose type is javascript. Typically this would be the <script> element.

All text nested underneath it would have curly braces and semicolons automatically inserted in the right places.

The CBASs are generated as the object is served, so no compilation is needed.

It will generate the curly braces and semicolons even if they're already there, so you can't really use it on existing code without converting it.

And I'd be careful about using it anyway, because this is just a small test case. Who knows if Javascript can really handle this.

I think it's pretty exciting!

Links

Parts

html.directory.getRawHtml


Posted on Tuesday, January 29, 2013 at 1:15 PM by Dave Winer.