3

Does anyone have an example of a custom made Renderer for xwiki rendering framework? I want to do a conversion from JSPWiki to XHTML but the default result xwiki generates is not sufficient. I need to apply some logic that inspects siblings/children in the intermediate tree. Debugged the xwiki code what gave me the idea there is a strong seperation between parsing (generates a tree) and rendering. Think solution has to come in the rendering phase

Thx Tom

2 Answers2

0

If you want to modify the tree, what you want is probably more a custom translation than a renderer actually. Renderes receive events in a streemed way so it's not always easy to do somthing depending on following events even if doable.

For transformations you can look at http://rendering.xwiki.org/xwiki/bin/view/Main/Extending#HAddinganewTransformation. You can also simply use the parser modify the generated XDOM and then render it, creating a translation is generally needed when you don't write yourself the code that parser and renderer.

If you still want to do it as a custom renderer the simplest it probably to extend the XHTML renderer and add you stuff, you have an example of extended XHTML renderer in https://github.com/xwiki/xwiki-rendering/tree/master/xwiki-rendering-syntaxes/xwiki-rendering-syntax-annotatedxhtml (add annotation in the generated XHTML content using XML comments).

Thomas Mortagne
  • 397
  • 1
  • 7
0

Java world has few dead wiki renderers high positioned in google. I use info.bliki.wiki many years, I'm fascinated with high quality of object design

Jacek Cz
  • 1,872
  • 1
  • 15
  • 22