cvs: peardoc /en/package/text/text-highlighter oc.xml
| From: | Alexander Merz | Date: | Tue, 15 Jan 2008 22:52:00 +0000 |
| Subject: | cvs: peardoc /en/package/text/text-highlighter oc.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-10406@lists.php.net to get a copy of this message | ||
alexmerz Tue Jan 15 22:52:00 2008 UTC
Modified files:
/peardoc/en/package/text/text-highlighter oc.xml
Log:
add revision tag
http://cvs.php.net/viewvc.cgi/peardoc/en/package/text/text-highlighter/oc.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/text/text-highlighter/oc.xml diff -u peardoc/en/package/text/text-highlighter/oc.xml:1.1 peardoc/en/package/text/text-highlighter/oc.xml:1.2 --- peardoc/en/package/text/text-highlighter/oc.xml:1.1 Fri Jan 11 23:05:57 2008 +++ peardoc/en/package/text/text-highlighter/oc.xml Tue Jan 15 22:52:00 2008 @@ -1,133 +1,134 @@ -<?xml version="1.0" encoding="UTF-8"?> - <sect2 id="package.text.text-highlighter.oc"> - <title>Output Customization</title> - - <para> - The default behaviour of <classname>Text_Highlighter</classname> - is to generate a syntax highlighted HTML version of the input. - </para> - - <para> - It is possible to instead generate output that is suitable for - being displayed on color-capable terminals such as - <command>xterm</command> or through <command>less(1)</command> - by telling <classname>Text_Highlighter</classname> to use - another renderer: - </para> - - <example> - <title>Using the console renderer</title> - - <programlisting role="php"> - <![CDATA[ -require_once "Text/Highlighter.php"; -require_once "Text/Highlighter/Renderer/Console.php"; - -$hlSQL =& Text_Highlighter::factory("SQL"); -$hlSQL->setRenderer(new Text_Highlighter_Renderer_Console); -echo $hlSQL->highlight("SELECT * FROM some_table WHERE id = 12"); - ]]> - </programlisting> - </example> - - <para> - Also it is possible to further customize the output of both the HTML- - and the console-renderer by passing an associative array of options - to the constructor: - </para> - - <example> - <title>Options for the HTML renderer</title> - - <programlisting role="php"> - <![CDATA[ -require_once "Text/Highlighter.php"; -require_once "Text/Highlighter/Renderer/Html.php"; - -$renderer = new Text_Highlighter_Renderer_Html(array("numbers" => HL_NUMBERS_LI, "tabsize" => 4)); - -$hlJava =& Text_Highlighter::factory("JAVA"); -$hlJava->setRenderer($renderer); - -echo $hlJava->highlight('class JavaProgram { - public static void main(String args[]) { - System.out.println("Hello World!"); - } -}'); - ]]> - </programlisting> - - <para> - The above example configures a HTML renderer with two options: - The first one tells it to number the lines in the output - using the <literal><ol /></literal> HTML tag and the - second one instructs the renderer to use a tab width of 4 - spaces for indentation. - </para> - </example> - - <para> - The following options are applicable: - </para> - - <table> - <title>Possible options for the renderer classes</title> - - <tgroup cols="5"> - <colspec colname="option" /> - <colspec colname="description" /> - <colspec colname="inHTML" /> - <colspec colname="inConsole" /> - <colspec colname="hints"/> - - <thead> - <row> - <entry>Name</entry> - <entry>Description</entry> - <entry>Available in HTML renderer</entry> - <entry>Available in console renderer</entry> - <entry>Hints</entry> - </row> - </thead> - <tbody> - <row> - <entry align="center"><literal>numbers</literal></entry> - <entry>Line numbering style</entry> - <entry align="center">yes</entry> - <entry align="center">yes</entry> - <entry> - In the console renderer, this option takes just - &true; or &false; in order to denote if line numbers - should be displayed or not. The HTML rendered accepts - three different values: <constant>HL_NUMBERS_LI</constant> - instructs the class to number the lines using the - <literal><ol /></literal> HTML tag, while - <constant>HL_NUMBERS_TABLE</constant> uses a two-column - table with the line numbers in the first and the source code - in the second column. Setting the value to &false; turns - line numbering off in the HTML renderer. - </entry> - </row> - <row> - <entry align="center"><literal>tabsize</literal></entry> - <entry>Tab width</entry> - <entry align="center">yes</entry> - <entry align="center">yes</entry> - <entry /> - </row> - <row> - <entry align="center"><literal>colors</literal></entry> - <entry>Additional colors</entry> - <entry align="center">no</entry> - <entry align="center">yes</entry> - <entry> - An associate array of additional colors for color-enabled - consoles. The key of each array entry must be the name of - the color and the corresponding value must be the escape - sequence for it. (Example: <literal>\033[1;31mRed</literal>.) - </entry> - </row> - </tbody> - </tgroup> - </table> +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision$ --> + <sect2 id="package.text.text-highlighter.oc"> + <title>Output Customization</title> + + <para> + The default behaviour of <classname>Text_Highlighter</classname> + is to generate a syntax highlighted HTML version of the input. + </para> + + <para> + It is possible to instead generate output that is suitable for + being displayed on color-capable terminals such as + <command>xterm</command> or through <command>less(1)</command> + by telling <classname>Text_Highlighter</classname> to use + another renderer: + </para> + + <example> + <title>Using the console renderer</title> + + <programlisting role="php"> + <![CDATA[ +require_once "Text/Highlighter.php"; +require_once "Text/Highlighter/Renderer/Console.php"; + +$hlSQL =& Text_Highlighter::factory("SQL"); +$hlSQL->setRenderer(new Text_Highlighter_Renderer_Console); +echo $hlSQL->highlight("SELECT * FROM some_table WHERE id = 12"); + ]]> + </programlisting> + </example> + + <para> + Also it is possible to further customize the output of both the HTML- + and the console-renderer by passing an associative array of options + to the constructor: + </para> + + <example> + <title>Options for the HTML renderer</title> + + <programlisting role="php"> + <![CDATA[ +require_once "Text/Highlighter.php"; +require_once "Text/Highlighter/Renderer/Html.php"; + +$renderer = new Text_Highlighter_Renderer_Html(array("numbers" => HL_NUMBERS_LI, "tabsize" => 4)); + +$hlJava =& Text_Highlighter::factory("JAVA"); +$hlJava->setRenderer($renderer); + +echo $hlJava->highlight('class JavaProgram { + public static void main(String args[]) { + System.out.println("Hello World!"); + } +}'); + ]]> + </programlisting> + + <para> + The above example configures a HTML renderer with two options: + The first one tells it to number the lines in the output + using the <literal><ol /></literal> HTML tag and the + second one instructs the renderer to use a tab width of 4 + spaces for indentation. + </para> + </example> + + <para> + The following options are applicable: + </para> + + <table> + <title>Possible options for the renderer classes</title> + + <tgroup cols="5"> + <colspec colname="option" /> + <colspec colname="description" /> + <colspec colname="inHTML" /> + <colspec colname="inConsole" /> + <colspec colname="hints"/> + + <thead> + <row> + <entry>Name</entry> + <entry>Description</entry> + <entry>Available in HTML renderer</entry> + <entry>Available in console renderer</entry> + <entry>Hints</entry> + </row> + </thead> + <tbody> + <row> + <entry align="center"><literal>numbers</literal></entry> + <entry>Line numbering style</entry> + <entry align="center">yes</entry> + <entry align="center">yes</entry> + <entry> + In the console renderer, this option takes just + &true; or &false; in order to denote if line numbers + should be displayed or not. The HTML rendered accepts + three different values: <constant>HL_NUMBERS_LI</constant> + instructs the class to number the lines using the + <literal><ol /></literal> HTML tag, while + <constant>HL_NUMBERS_TABLE</constant> uses a two-column + table with the line numbers in the first and the source code + in the second column. Setting the value to &false; turns + line numbering off in the HTML renderer. + </entry> + </row> + <row> + <entry align="center"><literal>tabsize</literal></entry> + <entry>Tab width</entry> + <entry align="center">yes</entry> + <entry align="center">yes</entry> + <entry /> + </row> + <row> + <entry align="center"><literal>colors</literal></entry> + <entry>Additional colors</entry> + <entry align="center">no</entry> + <entry align="center">yes</entry> + <entry> + An associate array of additional colors for color-enabled + consoles. The key of each array entry must be the name of + the color and the corresponding value must be the escape + sequence for it. (Example: <literal>\033[1;31mRed</literal>.) + </entry> + </row> + </tbody> + </tgroup> + </table> </sect2> \ No newline at end of file
http://cvs.php.net/viewvc.cgi/peardoc/en/package/text/text-highlighter/oc.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/text/text-highlighter/oc.xml diff -u peardoc/en/package/text/text-highlighter/oc.xml:1.1 peardoc/en/package/text/text-highlighter/oc.xml:1.2 --- peardoc/en/package/text/text-highlighter/oc.xml:1.1 Fri Jan 11 23:05:57 2008 +++ peardoc/en/package/text/text-highlighter/oc.xml Tue Jan 15 22:52:00 2008 @@ -1,133 +1,134 @@ -<?xml version="1.0" encoding="UTF-8"?> - <sect2 id="package.text.text-highlighter.oc"> - <title>Output Customization</title> - - <para> - The default behaviour of <classname>Text_Highlighter</classname> - is to generate a syntax highlighted HTML version of the input. - </para> - - <para> - It is possible to instead generate output that is suitable for - being displayed on color-capable terminals such as - <command>xterm</command> or through <command>less(1)</command> - by telling <classname>Text_Highlighter</classname> to use - another renderer: - </para> - - <example> - <title>Using the console renderer</title> - - <programlisting role="php"> - <![CDATA[ -require_once "Text/Highlighter.php"; -require_once "Text/Highlighter/Renderer/Console.php"; - -$hlSQL =& Text_Highlighter::factory("SQL"); -$hlSQL->setRenderer(new Text_Highlighter_Renderer_Console); -echo $hlSQL->highlight("SELECT * FROM some_table WHERE id = 12"); - ]]> - </programlisting> - </example> - - <para> - Also it is possible to further customize the output of both the HTML- - and the console-renderer by passing an associative array of options - to the constructor: - </para> - - <example> - <title>Options for the HTML renderer</title> - - <programlisting role="php"> - <![CDATA[ -require_once "Text/Highlighter.php"; -require_once "Text/Highlighter/Renderer/Html.php"; - -$renderer = new Text_Highlighter_Renderer_Html(array("numbers" => HL_NUMBERS_LI, "tabsize" => 4)); - -$hlJava =& Text_Highlighter::factory("JAVA"); -$hlJava->setRenderer($renderer); - -echo $hlJava->highlight('class JavaProgram { - public static void main(String args[]) { - System.out.println("Hello World!"); - } -}'); - ]]> - </programlisting> - - <para> - The above example configures a HTML renderer with two options: - The first one tells it to number the lines in the output - using the <literal><ol /></literal> HTML tag and the - second one instructs the renderer to use a tab width of 4 - spaces for indentation. - </para> - </example> - - <para> - The following options are applicable: - </para> - - <table> - <title>Possible options for the renderer classes</title> - - <tgroup cols="5"> - <colspec colname="option" /> - <colspec colname="description" /> - <colspec colname="inHTML" /> - <colspec colname="inConsole" /> - <colspec colname="hints"/> - - <thead> - <row> - <entry>Name</entry> - <entry>Description</entry> - <entry>Available in HTML renderer</entry> - <entry>Available in console renderer</entry> - <entry>Hints</entry> - </row> - </thead> - <tbody> - <row> - <entry align="center"><literal>numbers</literal></entry> - <entry>Line numbering style</entry> - <entry align="center">yes</entry> - <entry align="center">yes</entry> - <entry> - In the console renderer, this option takes just - &true; or &false; in order to denote if line numbers - should be displayed or not. The HTML rendered accepts - three different values: <constant>HL_NUMBERS_LI</constant> - instructs the class to number the lines using the - <literal><ol /></literal> HTML tag, while - <constant>HL_NUMBERS_TABLE</constant> uses a two-column - table with the line numbers in the first and the source code - in the second column. Setting the value to &false; turns - line numbering off in the HTML renderer. - </entry> - </row> - <row> - <entry align="center"><literal>tabsize</literal></entry> - <entry>Tab width</entry> - <entry align="center">yes</entry> - <entry align="center">yes</entry> - <entry /> - </row> - <row> - <entry align="center"><literal>colors</literal></entry> - <entry>Additional colors</entry> - <entry align="center">no</entry> - <entry align="center">yes</entry> - <entry> - An associate array of additional colors for color-enabled - consoles. The key of each array entry must be the name of - the color and the corresponding value must be the escape - sequence for it. (Example: <literal>\033[1;31mRed</literal>.) - </entry> - </row> - </tbody> - </tgroup> - </table> +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision$ --> + <sect2 id="package.text.text-highlighter.oc"> + <title>Output Customization</title> + + <para> + The default behaviour of <classname>Text_Highlighter</classname> + is to generate a syntax highlighted HTML version of the input. + </para> + + <para> + It is possible to instead generate output that is suitable for + being displayed on color-capable terminals such as + <command>xterm</command> or through <command>less(1)</command> + by telling <classname>Text_Highlighter</classname> to use + another renderer: + </para> + + <example> + <title>Using the console renderer</title> + + <programlisting role="php"> + <![CDATA[ +require_once "Text/Highlighter.php"; +require_once "Text/Highlighter/Renderer/Console.php"; + +$hlSQL =& Text_Highlighter::factory("SQL"); +$hlSQL->setRenderer(new Text_Highlighter_Renderer_Console); +echo $hlSQL->highlight("SELECT * FROM some_table WHERE id = 12"); + ]]> + </programlisting> + </example> + + <para> + Also it is possible to further customize the output of both the HTML- + and the console-renderer by passing an associative array of options + to the constructor: + </para> + + <example> + <title>Options for the HTML renderer</title> + + <programlisting role="php"> + <![CDATA[ +require_once "Text/Highlighter.php"; +require_once "Text/Highlighter/Renderer/Html.php"; + +$renderer = new Text_Highlighter_Renderer_Html(array("numbers" => HL_NUMBERS_LI, "tabsize" => 4)); + +$hlJava =& Text_Highlighter::factory("JAVA"); +$hlJava->setRenderer($renderer); + +echo $hlJava->highlight('class JavaProgram { + public static void main(String args[]) { + System.out.println("Hello World!"); + } +}'); + ]]> + </programlisting> + + <para> + The above example configures a HTML renderer with two options: + The first one tells it to number the lines in the output + using the <literal><ol /></literal> HTML tag and the + second one instructs the renderer to use a tab width of 4 + spaces for indentation. + </para> + </example> + + <para> + The following options are applicable: + </para> + + <table> + <title>Possible options for the renderer classes</title> + + <tgroup cols="5"> + <colspec colname="option" /> + <colspec colname="description" /> + <colspec colname="inHTML" /> + <colspec colname="inConsole" /> + <colspec colname="hints"/> + + <thead> + <row> + <entry>Name</entry> + <entry>Description</entry> + <entry>Available in HTML renderer</entry> + <entry>Available in console renderer</entry> + <entry>Hints</entry> + </row> + </thead> + <tbody> + <row> + <entry align="center"><literal>numbers</literal></entry> + <entry>Line numbering style</entry> + <entry align="center">yes</entry> + <entry align="center">yes</entry> + <entry> + In the console renderer, this option takes just + &true; or &false; in order to denote if line numbers + should be displayed or not. The HTML rendered accepts + three different values: <constant>HL_NUMBERS_LI</constant> + instructs the class to number the lines using the + <literal><ol /></literal> HTML tag, while + <constant>HL_NUMBERS_TABLE</constant> uses a two-column + table with the line numbers in the first and the source code + in the second column. Setting the value to &false; turns + line numbering off in the HTML renderer. + </entry> + </row> + <row> + <entry align="center"><literal>tabsize</literal></entry> + <entry>Tab width</entry> + <entry align="center">yes</entry> + <entry align="center">yes</entry> + <entry /> + </row> + <row> + <entry align="center"><literal>colors</literal></entry> + <entry>Additional colors</entry> + <entry align="center">no</entry> + <entry align="center">yes</entry> + <entry> + An associate array of additional colors for color-enabled + consoles. The key of each array entry must be the name of + the color and the corresponding value must be the escape + sequence for it. (Example: <literal>\033[1;31mRed</literal>.) + </entry> + </row> + </tbody> + </tgroup> + </table> </sect2> \ No newline at end of file