XWiki Rendering Framework
Last modified by Vincent Massol on 2024/02/19 11:40
Contents
General Architecture
- XDOM: A Java object representing the input as a tree made of Java Block objects (a.k. as an AST).
- Parser: Parses some textual input in a given syntax and generate a XDOM object.
- Renderer: Takes a XDOM as input and generates some output.
- Transformation: Takes some XDOM and modifies it to generate a modified XDOM.
See Advanced Architecture for more details.
Features
- Parsers for multiple syntaxes. XWiki 13.3+ Parsers register the Syntax they support into a Syntax Registry.
- Offers both a streaming API (useful for rendering large content) and an XDOM-based API (generates an intermediary AST on which transformations - such as macros - can be applied)
- Round trip between XWiki Syntax 2.0 and XHTML. This features allows for example to have a strong WYSIWYG editor that doesn't loose information when editing wiki pages. Another use case is the ability to import Office documents in HTML and transform them into XWiki Syntax 2.0 without loosing information.
- Ability to get the result of the parsing as an AST tree (called XDOM) which can then be used to get access to all structured elements from the flat text input.
- Ability to transform the XDOM through a Transformation (list of of available Transformations).
- Macro support (list of available Macros). Note that Macro support is implemented as a Transformation (see Architecture).
- Supports wiki syntax in link labels even for input syntaxes that don't support it.
- Automatic conversion from any of the supported input syntaxes to XWiki Syntax 2.0 or to XHTML.
- Strong Parsers:
- Based on Grammars (JavaCC)
- Fix user mistakes (not closed or overlapping markup elements...).
- Each block element (paragraph, table cells, list items, headers...) can spread over multiply lines.
- Support for groups, i.e. ability to include content inside other content (equivalent of DIV in HTML).
- All elements can have parameters associated to them.
- Been used in XWiki for several years and is stable and performant.
- Can be used standalone since it's independent of other XWiki projects such as XWiki Platform, etc.
The XWiki Rendering modules are all released under the LGPL license.
Supported Syntaxes
- Input Syntax
- It means there's a Parser that can be used to parse this syntax into a XDOM object
- Output Syntax
- It means there's a Renderer that can be used to render an XDOM into this syntax
Name | Id | Input Syntax? | Output Syntax? | Extension? | Description |
---|---|---|---|---|---|
XWiki 2.0 | xwiki/2.0 | ||||
XWiki 2.1 | xwiki/2.1 | ||||
XHTML 1.0 | xhtml/1.0 | ||||
XHTML 5 | xhtml/5 | Available in XWiki Rendering 14.1RC1+ only. This is the same as HTML 5.0 except that input must be valid XML. | |||
HTML 5.0 | html/5.0 | Available in XWiki Rendering 6.4+ only. Input syntax is available in XWiki Rendering 14.1RC1+ only. | |||
HTML 4.01 | html/4.01 | ||||
Plain Text | plain/1.0 | Print all than can be rendered in a simple notepad-like editor such as words, special symbols and spaces. It also generates link labels for links that have no labels and print the generated labels. Last it provides very basic formatting (e.g. separates paragraphs with new lines and separates list items with new lines). | |||
DocBook 4.4 | docbook/4.4 | Available in XWiki Rendering 3.2+ only. | |||
XDOM XML Current | xdom+xml/curent | Available in XWiki Rendering 3.3+ only. | |||
XDOM XML 1.0 | xdom+xml/1.0 | Available in XWiki Rendering 3.3+ only. | |||
XWiki 1.0 | xwiki/1.0 | ||||
Confluence 1.0 | confluence/1.0 | Removed in 9.0. Should use 1.1 instead. See Confluence. | |||
Confluence 1.1 | confluence/1.1 | Moved to contrib in 9.0. See Confluence. | |||
Confluence XHTML | confluence+xhtml/1.0 | Moved to contrib in 9.0. See Confluence. | |||
JSPWiki | jspwiki/1.0 | ||||
TWiki | twiki/1.0 | ||||
LaTeX | tex/1.0 | Removed in 10.2 and replaced by latex/1.0 (see below) | |||
MediaWiki 1.0 | mediawiki/1.0 | Deprecated and moved to the attic in 8.2RC1. | |||
MediaWiki 1.6 | mediawiki/1.6 | Comes with the new MediaWiki contrib project. | |||
Creole 1.0 | creole/1.0 | ||||
Markdown 1.0 | markdown/1.0 | Extracted out of XWiki starting 8.2M1. Output syntax supported starting with version 8.2 of the Markdown extension. Deprecated and remove in version 8.6 of the Markdown extension. | |||
Markdown 1.1 | markdown/1.1 | Extracted out of XWiki starting 8.2M1. Adds syntax for macros, superscript and subscript support over Markdown 1.0 syntax. Output syntax supported starting with version 8.2 of the Markdown module. Deprecated and remove in version 8.6 of the Markdown extension. | |||
Markdown 1.2 | markdown/1.2 | Added in version 8.4 of the Markdown extension. | |||
GitHub-Flavored Markdown 1.0 | markdown+github/1.0 | Added in version 8.7 of the Markdown extension. | |||
APT | apt/1.0 | Available in XWiki Rendering 4.3+ only. | |||
DokuWiki 1.0 | dokuwiki/1.0 | Comes with the new DokuWiki contrib project | |||
LaTeX 1.0 | latex/1.0 | Added as a Contrib Extension. | |||
Annotated XHTML | annotatedxhtml/1.0 | Used internally for the WYSIWYG editor (to keep track of Macros) | |||
Annotated HTML5 | annotatedhtml5/1.0 | Used internally for the WYSIWYG editor (to keep track of Macros) | |||
AsciiDoc 1.0 | asciidoc/1.0 | AsciiDoctor Syntax. |
Demo
This simple demo converts your input written in one syntax to another syntax.
Documentation
- Getting started tutorial
- Javadocs
- Advanced Architecture
- Extending XWiki Rendering
- Available Macros
- Available Transformations
- XWiki 13.3+ Available Syntaxes
- XWiki 14.0+ Error Reporting
Download
Check the getting started tutorial which contains all information to access the XWiki Rendering binaries.
Source files are available here.
Projects using XWiki Rendering
- XWiki: of course...
- eXo Platform: Uses both the XWiki Rendering and the XWiki WYSIWYG Editor to provide a simple wiki inside their tools
- Wikbook: Uses XWiki Rendering to generate DocBook from content written using a wiki syntax
- Jahia: Uses XWiki Rendering in its "Jahia Wiki module"
- Grails XWiki Rendering Plugin: Grails plugin that allows to convert text using the XWiki Rendering Framework.
Alternatives
Here are some libraries similar to XWiki Rendering in purpose:
- WikiModel: XWiki Rendering actually uses WikiModel and extends it. Note that since WikiModel wasn't active anymore, the XWiki project has forked it and incorporated it in its own sources.
- Eclipse Mylyn WikiText
- Maven Doxia: Note that XWiki Rendering has a basic bridge to Doxia
- Sweble provides a MediaWiki syntax parser and renderer (see Sweble 2.0 architecture.
- MediaWiki Parsers.