DokuWiki

It's better when it's simple

User Tools

Site Tools


syntax_highlighting

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
syntax_highlighting [2018-04-30 12:37] andisyntax_highlighting [2024-01-04 16:31] (current) – corrige une erreur de syntaxe en C dans les exemples. schplurtz
Line 5: Line 5:
 Starting with DokuWiki release "Greebo" some additional GeShi options for syntax highlighting are supported: Starting with DokuWiki release "Greebo" some additional GeShi options for syntax highlighting are supported:
  
-  * Enable line numbers +  * Enable line numbers: ''%%enable_line_numbers="true"%%'' 
-  * Start line numbers at line **n** +  * Start line numbers at line **n**: ''%%start_line_numbers_at="42"%%'' 
-  * Highlight certain lines extra+  * 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.+All options are set by adding some key-value pairs to the standard ''code''-tag syntax.  
 + 
 +  <code languagecode [key="value", ...]> 
 + 
 +The following examples explain their usage.
  
 ===== Examples ===== ===== Examples =====
Line 60: Line 65:
   void main () {   void main () {
       printf ("Hello World!");       printf ("Hello World!");
-      exit 0;+      exit(0);
   }   }
   </code>   </code>
Line 69: Line 74:
 void main () { void main () {
     printf ("Hello World!");     printf ("Hello World!");
-    exit 0;+    exit(0);
 } }
 </code> </code>
  
 +
 +In some languages certain keywords link to appropriate online documentation. This can be disabled:
 +  <code C [enable_keyword_links="false"]>
 +  void main () {
 +      printf ("Hello World!");
 +      exit(0);
 +  }
 +  </code>
 +
 +This is the result:
 +
 +<code C [enable_keyword_links="false"]>
 +void main () {
 +    printf ("Hello World!");
 +    exit(0);
 +}
 +</code>
syntax_highlighting.1525084653.txt.gz · Last modified: 2018-04-30 12:37 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki