Hi,

Here's some design details on the new xwiki rendering component I'm  
writing, for which I'd like to have feedback from the dev community.

Sources:
http://svn.xwiki.org/svnroot/sandbox/components/xwiki-rendering/xwiki-rendering-api/src/main/java/org/xwiki/rendering/

In the new design, macros are parsed and generate "MacroBlock"s events  
in the Listener.

Here are some refinements I'm proposing:

* MacroBlock has a traverse(Listener) method.
* In order to make Macros independent on the Listener (this is very  
important IMO in order to allow for any kind of transformations) we  
need to make the MacroBlocks emit Listener events.
* Since the wiki syntax is not enough to generate all possible  
rendering options (for example no wiki syntax for XHTML forms) we have  
2 options:
1) add as many Listener events as there are XHTML features or
2) add an onHTMLElement(...) event in the Listener
* Option 2) (onHTMLElement) looks much better IMO (simpler, can evolve  
with the HTML spec, faster, etc)

This allows for example to have a iText renderer to generate PDFs from  
page content which would be way more difficult if the HTML was passed  
as standard text (this would need to reparse again the content of  
Listener's onText() calls. Same applies for any Listener/Renderer  
since they'll need to have some special handling for HTML.

Of course since WikiModel and Doxia don't have HTML events in their  
Listener/Sink we'll need to perform some mapping when we want to use  
bridge to them. It probably means we'll need to output the HTML  
elements as simple text events for them.

WDYT?

Mikhail, I'm curious to know how you're handling this use case in  
wikimodel.

Thanks
-Vincent
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to