Released: 04 Jan 2015 06:00
Version: 2.00.150104

This tool allows for the easy conversion of source code into Wikidot code for the sake of syntax highlighting. Though Wikidot supports its own syntax highlighting, code.highlight() is more accurate for the languages it supports, and it can easily be extended to more languages via JSON files.

code.highlight()

The code.highlight() tool supports AS3, Haxe, C++, CSS, and Java. It highlights key words, type names, and strings, and it allows the user to specify his own type names as well. It will also allow for the insertion of line numbers in the code. Finally, the tool will even add links to certain type names for the sake of documentation, though this feature is not fully developed.

To use this tool with Wikidot, the use of the Better Code Blocks CSSnippet is required. This is simply CSS code that is imported that allows the generated Wikidot code to actually be highlighted.

I use code.highlight() when posting code snippets on this site and others.

You can access the source code on GitHub.


In the previous version of this program, 1.01.140204, it was not possible to use this tool with generic HTML. It now is, and in fact, the parser library is generalized to work with any linear transformation parse.