Code Highlighting

  • strict warning: Non-static method view::load() should not be called statically in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/ on line 744.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/ on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/ on line 607.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/ on line 159.
Leeland's picture


Code highlighting for a software providing/support/sales/discussion sight is mandatory. I have already started growing accustom to the BBCODE editing style for the posts and I also like the sparse nature of the Markdown formating for the Wiki. So what I need to do is very carefully integrate a plug in ability to have code highlighting on the fly as well as being able to designate and control which code highlighting syntax is used.

BBCODE already gives me the tie in by allowing the code tag to have a language specification. That should make it a lot easier. However, Markdown syntax does not have anything like that, unless I add something like a header marker for a code block. The indenting requirement of a code block in Markdown seems a little annoying. Maybe I'll come to like it.

In the mean time I have found the code highlighting engine I will graft into place:

Code Highlighter Requirements

The following features are required:

* a wide range of common languages and markup formats is supported, specifically:
* Linux/UNIX shell scripts (bash, csh, bsh, ksh, etc.)
* C/C++
* Dot-NET
* Java (of course)
* Python/Jython
* special attention to details that increase highlighting quality and performance
* support for new languages and formats are added easily; most languages use a simple regex-based lexing mechanism
* a number of output formats is available, among them HTML, RTF, LaTeX and ANSI sequences

Implementation Notes

Of course the first thing is to do is find one, get it, and then read all the docs. After that I can start putting into place a design for how to make it optionally available but automatically used if present.

Thread Slivers eBook at Amazon