On Wed, Jun 3, 2009 at 12:29 PM, Vincent Massol <[email protected]> wrote:
Hi,
I think we need to add a plain text parser & a "plain/1.0" syntax id.
Here's a use case: you want to add a groovy class in a wiki page (and you don't want it to be rendered as wiki syntax of course).
Seems like this is an uneccessary complication, and a design compromise made from expendiency...it also serves to further complicate the document model. I think scripting needs to be removed entirely from the document so that it remains purely declative and not procedural. Procedural content should be packaged and treated differently. I therefore suggest a different approach, based on existing precedent: What about following the precedent of the $xwiki.jsx.use("$doc.fullName") construct. Have other language-specific "extensions" objects attached to the document as objects, and give options in the "XWiki.GroovyExtension" instance (analogous to XWiki.JavaScriptExtension class) for: (1) velocity parsing (2) caching Stylistically, I don't like the practice of dropping all manner of random procedural <script> in the middle of a declarative Wiki or HTML document (though in some cases it's necessary to add some javascript post-processing at the end of a document for JS that needs access to the DOM). IMHO, the model of using JSX and SSX to inject JavaScript and CSS into a document seems cleaner, and should be extended to using other scripting languages in Xwiki. Niels http://nielsmayer.com