XWiki Syntaxes

XWiki allows to convert the page content to another syntax by editing it in "Wiki" or "Wysiwyg" mode and selecting the desired value from the "Page syntax" drop-down in the "Page Information" panel. 

HideDocument.png

For the moment, only the xwiki/2.1 syntax is configured by default, but provided you are a wiki administrator you will see a "Configure more syntaxes" link allowing you to add extra options to the list via the "Editing" -> "Syntaxes" section of the wiki preferences page.

XWiki21Syntax.png

The reason why the configuration defines disabled syntaxes is because when you install an extension contributing a new syntax in your wiki, we want this syntax to be enabled by default. Otherwise, an administrator user would have to install the extension and then activate the syntax.

Link Syntax for Nested Pages

After adopting the nested pages paradigm, a discrepancy appeared between the UI and the wiki syntax, namely the user still had to specify both the space and page name when creating a link to it. The same principle applied for links to images ([[image:SomeImage.png]]) or attachments ([[attach:SomeFile.pdf]]) and the technical reason was that at the wiki syntax level, untyped links were being resolved to doc: type links.

The solution to this problem was to add a new space: type link which allows to write [[space:Nested.Page1.Page2]] and to make it the new default type that untyped links resolve to. Therefore, to create a link to the nested page Nested.Page1.Page2, it is enough to write [[Nested.Page1.Page2]].

In order to keep the backwards compatibility with the existing untyped links, XWiki has implemented the same mechanism for URLs, meaning that:

  • first try to link to an existing terminal page 
  • in case no such terminal page exists, link to the nested page both when the non-terminal page exists or when it doesn't.

The link label generator now supports Nested Pages by default and several new configuration formats have been introduced:

  • %s now uses the full space name i.e. space1.space2; in older XWiki versions, this format was only displaying the last space name
  • new formats:
    • %ls displays the last space name
    • %np displays the nested page name i.e. the space name for Nested Pages
    • %NP displays the nested page name with spaces between camel-case words, i.e. "My Page" if the page name is "MyPage"

More details about the new links behavior as well as examples are available in the "XWiki.XWikiSyntax" wiki page, by clicking on "XWiki Syntax Guide" in the "Navigation" panel displayed in the column on the left.

SyntaxesNavigationPanel.png

Relative Links to Sibling Nested Pages

For the case when the current page is non-terminal and it contains an untyped relative link (like [[Page]]), we still keep the backwards compatibility with the pre-Nested-Pages behavior. If the relative link hasn't been resolved using the aforementioned algorithm, we perform 2 more checks:

  • try to link to an existing terminal page that is a sibling of the current page; in this case [[Page]] is resolved to the equivalent of [[doc:CurrentPageParent.Page]];
  • if no such terminal page exists, link to the nested page that is a sibling of the current one; in this case [[Page]] is resolved to the equivalent of [[doc:CurrentPageParent.Page.WebHome]], both when the non-terminal page exists or when it doesn't.

Syntax Highlighting

Syntax highlighting is automatically activated for the "Wiki" editor that now also has some new features including:

  • line numbers
  • active line highlighting
  • tab line indentation
  • 2 spaces on tab
  • matching and auto-closing brackets, parentheses and quotes
  • matching selection highlighting
  • scroll to undo/redo position
  • trailing white-space highlighting
  • multi-line comment auto indentation on newline
  • search / replace with regex support

WikiEditor.png

  

Related Pages

Search this space

 

Most popular tags

Failed to execute the [groovy] macro
  1. access rights
  2. activity stream
  3. annotation
  4. attachment
  5. comment
  6. Document Tree Macro
  7. export
  8. Extension Manager
  9. Flamingo skin
  10. global user
  11. Groovy event listener
  12. group
  13. nested page
  14. search
  15. skin
  16. syntax
  17. user
  18. user profile
  19. velocity macros
  20. wiki
  21. wysiwyg
  22. XWiki Applications
  23. xwikiattachment_archive table
  24. xwikiattachment table
  25. xwikiattrecyclebin table
  26. xwikiproperties table

[Display all tags from this space]