Difference between revisions of "Help:SyntaxHighlight GeSHi"
From Apache OpenOffice Wiki
(→Usage) |
|||
Line 32: | Line 32: | ||
=== Parameters === | === Parameters === | ||
− | * '''lang="??"''': Defines what programming language the source code is using. This affects how the extension highlights the source code. See the section | + | * '''lang="??"''': Defines what programming language the source code is using. This affects how the extension highlights the source code. See the section [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi#Supported_languages Supported languages] for details of supported languages. |
* '''line="GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS"''': Type of line numbering to use (default is no line numbering). Corresponds to [http://qbnz.com/highlighter/geshi-doc.html#enabling-line-numbers enable_line_numbers] the flag in GeSHi. | * '''line="GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS"''': Type of line numbering to use (default is no line numbering). Corresponds to [http://qbnz.com/highlighter/geshi-doc.html#enabling-line-numbers enable_line_numbers] the flag in GeSHi. | ||
* '''line start="??"''': Use together with the parameter "'''line'''". Define the start number of the line. If you type line start="55", it will start counting at 55, then 56,57,58... and so on. Corresponds to [http://qbnz.com/highlighter/geshi-doc.html#starting-line-numbers start_line_numbers_at] method on GeSHi | * '''line start="??"''': Use together with the parameter "'''line'''". Define the start number of the line. If you type line start="55", it will start counting at 55, then 56,57,58... and so on. Corresponds to [http://qbnz.com/highlighter/geshi-doc.html#starting-line-numbers start_line_numbers_at] method on GeSHi |
Latest revision as of 11:45, 17 November 2009
See: Extension:SyntaxHighlight GeSHi
This extension adds the <source> tag to present formatted source code.
Usage
You can wrap source code with <source lang=LANG>...</source> where LANG is a supported language. This will syntax highlight the source code when viewed in the Wiki page.
Example
<source lang="php"> <?php $v = "string"; // sample initialization ?> html text <? echo $v; // end of php code ?> </source>
shows:
<?php $v = "string"; // sample initialization ?> html text <? echo $v; // end of php code ?>
Parameters
- lang="??": Defines what programming language the source code is using. This affects how the extension highlights the source code. See the section Supported languages for details of supported languages.
- line="GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS": Type of line numbering to use (default is no line numbering). Corresponds to enable_line_numbers the flag in GeSHi.
- line start="??": Use together with the parameter "line". Define the start number of the line. If you type line start="55", it will start counting at 55, then 56,57,58... and so on. Corresponds to start_line_numbers_at method on GeSHi
- highlight="??": Specifies which line is highlighted. Note that the parameter line start="??" doesn't affect how it counts the lines.
- enclose="??": Specifies what container is used to enclose the source code. Takes values "pre" (default value), "div", "none". Corresponds to set_header_type method on GeSHi.
- strict: Type the name of the parameter to enable the strict mode. Corresponds to enable_strict_mode method on GeSHi.