XWiki Standard 9.8.1 Documentation » XWiki Applications Overview » Syntax Highlighting Application

Syntax Highlighting Application

The XWiki Syntax Highlighting application provides CodeMirror based syntax highlighting for:

  • Velocity
  • Groovy
  • JavaScript
  • CSS
  • Python
  • HTML
  • XWiki Macros (Experimental)

In XWiki Standard, syntax highlighting is automatically activated for:

  • page content editor ("Wiki" editing mode)
  • object editor for the following objects:
    • XWiki.StyleSheetExtension objects
    • XWiki.JavaScriptExtension objects
    • XWiki.XWikiSkins objects for all properties with the name ending in .css or .js
    • XWiki.WikiMacroClass objects for the Code property

SyntaxHighlightContent.png

Features

  • syntax highlighting
  • line numbers
  • active line highlighting
  • tab line indentation and 2 spaces on tab
  • matching and auto-closing brackets, parentheses and quotes
  • matching selection highlighting
  • scroll to undo/redo position
  • trailing whitespace highlighting
  • multiline comment auto indentation on newline
  • find and replace tool with regex support:
    • Press Ctrl+F / Ctrl+Shift+F (while the editor is focused) to search inside the editor

      SyntaxHighlightFind.png

    • Press Ctrl+Shift+R (while the editor is focused) for search and replace

      SyntaxHighlightReplace.png

    • Press F3 after searching for something (with the editor focused) in order to scroll to the next result

Matching results are both highlighted in the editor and displayed in the scrollbar so that you can easily get to the next match.

Scrollbar.png

  • fullscreen editing support: press F11 while the editor is focused to enter full screen, then press Esc to exit full screen
The Auto Completion Application provides auto-completion for Velocity and JavaScript, thus enhancing the Syntax Highlighting application's features. 

Administration

To disable the syntax highlighting feature, log in as administrator, click the DrawerMenuIcon.png button to open the drawer menu and choose "Administer Wiki".

AdministerWikiMenu.png

Next, click on "Other" -> "Syntax Highlighting" in the accordion menu, uncheck the "Enabled" option, then hit "Save". 

SyntaxHighlightingMenu.png

Additionally, you may choose one of the 33 themes provided by CodeMirror or change the color to use when highlighting the currently selected word or piece of text.

SyntaxHighlightingAdministration.png

Bonus: see a related blog post on how pages are rendered with XWiki syntax to format text, create tables, create links, display images, etc.

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]