page_white_codeProvides Syntax Highlighting
Recommended
TypeXAR
Developed by

Vincent Massol, Eduard Moraru

Active Installs704
Rating
Rate!
2 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Standard

Installable with the Extension Manager

Description

CodeMirror based syntax highlighting for:

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

Syntax highlighting is automatically activated for:

  • document content editor
  • object editor
    • XWiki.StyleSheetExtension objects
    • XWiki.JavaScriptExtension objects
    • XWiki.XWikiSkins objects (properties with the name ending in '.css' and '.js')
    • Since 3.0 XWiki.WikiMacroClass objects (the 'code' property)

Features

  • Syntax highlighting

     wikiEditor-default-theme.png

  • 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 whitespace highlighting
  • Multiline comment auto indentation on newline
  • Search/Replace with regex support

     searchSupport.png

    • Press Ctrl+F / Ctrl+Shift+F (while the editor is focused) to search inside the editor 
    • Press Ctrl+Shift+R (while the editor is focused) for search and replace
    • Press F3 after searching for something (with the editor focused) in order to scroll to the next result
      • Note: CTRL+G is already taken by the Go To popup.
    • More keyboard shortcuts at https://codemirror.net/demo/search.html
    • Since 3.0 Matches are also displayed on the scrollbar

       matchesOnScrollbar.png

  • Fullscreen editing support
    • Press F11 (while the editor is focused) to enter full screen
    • Press Esc to exit full screen
  • Autocompletion (by installing the AutoCompletion Application)
  • Since 3.0 Theme support (33 themes provided by codeMirror)

     wikiEditor-ambrient-theme.png

  • Since 3.0 Administration section

     syntaxHighlightingAdministration.png

Other Screenshots

syntax-highlighting-screenshot.png

TODO

  • Improvement Open WIKIEDITOR-34 Ability to enable/disable the CodeMirror editor
  • Bug Open WIKIEDITOR-30 wiki syntax autocompletion does not work in subwikis
  • New Feature Open WIKIEDITOR-28 Integrate Realtime Collaborative Editing in syntax highlighting editor.
  • Improvement Open WIKIEDITOR-26 Enable highglighting for the new skin edit UI
  • Improvement Open WIKIEDITOR-23 If there is no custom autocomplete page for the current mode, use showHint's fallbacks
  • Improvement Open WIKIEDITOR-11 Handle newly added objects in the object editor
  • Improvement Open WIKIEDITOR-10 AutoComplete and Highlighting for inner/nested modes (mixed by the "xwiki" mode)
  • Improvement Open WIKIEDITOR-15 Handle nested XWiki (script) macros in the "xwiki" syntax highlighting mode
  • Bug Open WIKIEDITOR-46 URL's to load codemirror contains double slashes which fail the load
  • Bug Open WIKIEDITOR-47 Velocity bindings defined in the skin are not available in autocomplete
  • Bug Open WIKIEDITOR-45 Only a few (one?) signature of a function is displayed
  • Task Open WIKIEDITOR-44 Upgrade to CodeMirror 5.13.2
  • Bug Open WIKIEDITOR-41 AutoCompletion in chained Velocity methods is wrongly triggered in parameters
  • Improvement Open WIKIEDITOR-53 Be able to "Find" multiple occurrences of the word in one go
  • Bug Open WIKIEDITOR-50 Syntax Highlighting broken in Space Delimited code
  • Bug Open WIKIEDITOR-24 NPE when requesting xwiki autocompletion on content outside a velocity macro
  • Improvement Open WIKIEDITOR-9 Ability to resize the Syntax Highlighting editor (by dragging bottom-right corner)
  • Improvement Open WIKIEDITOR-51 Load SyntaxHighlighting also for pages in "Plain" syntax
  • Improvement Open WIKIEDITOR-52 User level election of syntax scheme

New bugs and suggestions go to the dedicated JIRA project (you need to create an account there). Don't use comments on this page for that. Thank you.

Tested on

This extension has been tested with the following configurations.

Extension VersionXWiki FlavorNotes
2.0XWiki Enterprise 3.0+

Possibly compatible with lower versions too

2.2XWiki Enterprise 6.0.1
3.1.1XWiki Enterprise 7.1.2
4.0XWiki Enterprise 8.4+

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Release Notes

v4.1

v4.0

  • Task Closed WIKIEDITOR-49 Upgrade the minimum XWiki version to 8.4
  • Bug Closed WIKIEDITOR-48 Disabling Syntax Highlighting from Administration requires a clear of the browser cache
  • Bug Closed WIKIEDITOR-43 When autocompletion fails for XWiki syntax no error is displayed.

v3.4

  • Bug Closed WIKIEDITOR-40 Editor not saving the correct content but only after the second save
  • Bug Closed WIKIEDITOR-42 Unable to debug the non-minified javascript code

v3.3

  • Bug Closed WIKIEDITOR-29 Syntax highlighting does not work with some apache frontends
  • Bug Closed WIKIEDITOR-31 Autocompletion on $doc is targetting XWikiDocument instead of Document
  • Bug Closed WIKIEDITOR-39 Webjars are not loaded in XWiki before 6.3
  • Improvement Closed WIKIEDITOR-38 Split the autocompletion into two extensions following the Syntax Highlighting model

v3.2

  • Bug Closed WIKIEDITOR-27 Search is not working on textareas enhanced by the Syntax Highlighting Application
  • Task Closed WIKIEDITOR-37 Split the Syntax Highlighting extension in two extensions
  • Improvement Closed WIKIEDITOR-36 Update CodeMirror dependency to version 5.8

v3.1.1

  • Improvement Closed WIKIEDITOR-33 Being able to run Wiki editor (syntax highlighting and automcomplete) on XWiki 6.0

v3.1

  • Improvement Closed WIKIEDITOR-21 Improve the slow loading of the required modules by using the new webjar URL
  • Bug Closed WIKIEDITOR-25 Hide technical documents

v3.0

This version improved the overall stability of the application but unfortunatey also introduced a serious performance issue that can lead to the syntax highlighting being activated 10+ seconds after the page is loaded. An improvement of this problem will come with the new version that will be released once XWiki 7.1M1 is released and an even better solution will hopefully come after that. To stay up to date with the problem, please watch the assigned WIKIEDITOR-21 Jira issue
  • Task Closed WIKIEDITOR-22 Upgrade to CodeMirror 5.1
  • Improvement Closed WIKIEDITOR-20 Display search results overview on the scrollbar
  • Improvement Closed WIKIEDITOR-19 Trigger autocomplete while typing, without having to press Ctrl+Space
  • Bug Closed WIKIEDITOR-18 NPE when the velocity context variable on which we want methods autocompletions does not exist
  • Improvement Closed WIKIEDITOR-17 Add support for Syntax Highlighting also when editing a document Inline
  • Improvement Closed WIKIEDITOR-14 Use webjars instead of adding the code mirror zip to a XWiki page
  • Improvement Closed WIKIEDITOR-13 Create an Administration UI for the SyntaxHighlighting Application
  • Bug Closed WIKIEDITOR-8 Autocomplete does not remove first character typed
  • Improvement Closed WIKIEDITOR-12 Enable highlighting also for XWiki.WikiMacroClass's "Macro Code" textarea in editor=object
  • Bug Closed WIKIEDITOR-7 Avoid Syntax Highlighting fullscreen augmentation on regular textareas
  • Improvement Closed WIKIEDITOR-16 Use JSRX and SSRX instead of the deprecated ZipExplorer plugin to get packed/zipped resources

v2.2

  • Bug Closed WIKIEDITOR-1 Macro closing adds indentation
  • Bug Closed WIKIEDITOR-2 Wiki syntax editor's toolbar buttons don't work with Syntax Highlighting

v2.1

  • Bug Closed WIKIEDITOR-3 Add highlighting and completions for velocity for the XWikiSkin object editor.
  • Improvement Closed WIKIEDITOR-4 Add support for autocompleting chained method calls

v2.0

  • New Feature Closed WIKIEDITOR-5 Publish a Wiki Editor tools version installable with the Extension Manager

Dependencies

Dependencies for this extension (org.xwiki.contrib.editortool:editor-tool-highlighting-ui 4.1):

Tags:
Created by Eduard Moraru on 2011/10/17 17:04
    

Get Connected