fr:syntax_highlighting
Ceci est une ancienne révision du document !
Page en cours de traduction
Mise en évidence de la syntaxe
DokuWiki includes support for code syntax highlighting as described at the syntax page.
Starting with DokuWiki release “Greebo” some additional GeShi options for syntax highlighting are supported:
- Enable line numbers
- Start line numbers at line n
- Highlight certain lines extra
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:
<code JavaScript [enable_line_numbers="true"]> var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); </code>
This is the result:
var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }();
The next example additionally highlights one line:
<code JavaScript [enable_line_numbers="true",highlight_lines_extra="2"]> var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); </code>
This is the result:
var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }();
You can also highlight multiple lines:
<code JavaScript [enable_line_numbers="true",highlight_lines_extra="2,3"]> var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }(); </code>
This is the result:
var de = function() { return (typeof(window.de) == 'object') ? window.de : {}; }();
Line numbers can start at any given value:
<code C [enable_line_numbers="true", start_line_numbers_at="42"]> void main () { printf ("Hello World!"); exit 0; } </code>
This is the result:
void main () { }
fr/syntax_highlighting.1525417692.txt.gz · Dernière modification : 2018-05-04 09:08 de Digitalin