Where do I find the accepted values for outputsyntax?

Among the parameters explained in https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Architecture/URL%20Architecture/Standard%20URL%20Format/ , there’s outputSyntax.

But no values are provided there; there’s a link to https://extensions.xwiki.org/xwiki/bin/view/Extension/Rendering%20Module/ but again I can’t find values there.

The latter page links to XWiki Rendering Framework where there’s a list of output syntaxes, but I’m not sure if those are what I can enter in the URL parameter, because:

  • outputSyntax=plain is accepted, but plain/1.0 is not
  • outputSyntax=docbook seems not

Is there a way to obtain this parameter supported values?

As explained on https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Architecture/URL%20Architecture/Standard%20URL%20Format/?outputSyntax=plain%2F1.0#HParameter:outputSyntaxandoutputSyntaxVersion the version of the syntax is supposed to be given using the outputSyntaxVersion parameter. But it’s very rare to need to provide it since by the default the last version of that syntax is selected.

It’s not easy to give a exhaustive list of all the support values in that documentation since it entirely depends on the syntax renderer you installed. I added those which are expected to be available in XWiki Standard.

There is no docbook renderer by default in XWiki Standard. You would need to install it.

Seems this page would need a refresh as it’s not very clear what is an extension, and where it is.

Ok, I guess I should always start by saying that I have no XWiki development experience nor architecture knowledge, so I usually try to put together a few lines and I quickly skim through a bunch of pages hoping to find some code to copy-paste :grimacing:

So of course dev docs are clearer for anybody with at least a little knowledge of XWiki.

Reading more carefully that page is clearer now.

Makes sense. Is there a REST API or any script API that one can call to get the list of available renderers? That would suffice IMHO.

Ha. So the (X) in the table does not mean “does this renderer need an extension?”, I guess :grin:

If I may add: I found a bit confusing the xpage=xml too: it outputs XML, so shouldn’t that be a renderer?

Some times ago I did some investigations about available syntaxes.
I have found this code again:

{{groovy}}

sourceWiki ='''
A simple sentence.
* First enty and some **bold**
* lets continue
=A Table=
|= AA |=BB
| 1 | //2//
'''

xdomObjekt = services.rendering.parse(sourceWiki,"xwiki/2.1")

def doSyntax = { syntax ->
  println "\n=== "+syntax+ "==="
  println "(% style='margin-left:20pt'%)((({{code language='text'}}"
  println services.rendering.render(xdomObjekt,syntax)
  println "{{/code}})))"
}
services.rendering.getAvailableRendererSyntaxes().each { doSyntax(it.toString().toLowerCase().replaceAll(/ /,"").replaceAll(/(\d\.)/,"/\$1")) }
{{/groovy}}

The reported values may be used with “outputSyntax=value” without versioning qualifier.

May be this helps

1 Like

I added a slightly simpler version on https://extensions.xwiki.org/xwiki/bin/view/Extension/Rendering%20Module/#HListavailablerenderersyntaxes.

1 Like