====== Syntax Highlighting ====== DokuWiki includes support for code syntax highlighting as described at the [[wiki:syntax#syntax_highlighting|syntax page]]. Starting with DokuWiki release "Greebo" some additional GeShi options for syntax highlighting are supported: * Enable line numbers: ''%%enable_line_numbers="true"%%'' * Start line numbers at line **n**: ''%%start_line_numbers_at="42"%%'' * Highlight certain lines extra: ''%%highlight_lines_extra="2,5"%%'' * Disable keyword linking to appropriate documentation: ''%%enable_keyword_links="false"%%'' All options are set by adding some key-value pairs to the standard ''code''-tag syntax. The following examples explain their usage. ===== Examples ===== The following code enables line numbers: var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); This is the result: var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); The next example additionally highlights one line: var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); This is the result: var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); You can also highlight multiple lines: var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); This is the result: var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); Line numbers can start at any given value: void main () { printf ("Hello World!"); exit 0; } This is the result: void main () { printf ("Hello World!"); exit 0; } Some languages has keywords that link to appropriate documentation. This can be disabled: void main () { printf ("Hello World!"); exit 0; } This is the result: void main () { printf ("Hello World!"); exit 0; }