From ad7c37db105d65d3b11b3cb95eab15e100c51989 Mon Sep 17 00:00:00 2001 From: mitty Date: Wed, 27 Oct 2010 03:21:11 +0000 Subject: [PATCH] * vendor drop partially from GeSHi-1.0.8.9.tar.gz * http://qbnz.com/highlighter/ git-svn-id: https://lab.mitty.jp/svn/lab/vendor@73 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- GeSHi-1.0.8.9/contrib/example.php | 217 +++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 GeSHi-1.0.8.9/contrib/example.php diff --git a/GeSHi-1.0.8.9/contrib/example.php b/GeSHi-1.0.8.9/contrib/example.php new file mode 100644 index 0000000..32e6f0c --- /dev/null +++ b/GeSHi-1.0.8.9/contrib/example.php @@ -0,0 +1,217 @@ + tag inside the list items (
  • ) thus producing valid HTML markup. + // HEADER_PRE puts the
     tag around the list (
      ) which is invalid in HTML 4 and XHTML 1 + // HEADER_DIV puts a
      tag arount the list (valid!) but needs to replace whitespaces with   + // thus producing much larger overhead. You can set the tab width though. + $geshi->set_header_type(GESHI_HEADER_PRE_VALID); + + // Enable CSS classes. You can use get_stylesheet() to output a stylesheet for your code. Using + // CSS classes results in much less output source. + $geshi->enable_classes(); + + // Enable line numbers. We want fancy line numbers, and we want every 5th line number to be fancy + $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 5); + + // Set the style for the PRE around the code. The line numbers are contained within this box (not + // XHTML compliant btw, but if you are liberally minded about these things then you'll appreciate + // the reduced source output). + $geshi->set_overall_style('font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', false); + + // Set the style for line numbers. In order to get style for line numbers working, the
    1. element + // is being styled. This means that the code on the line will also be styled, and most of the time + // you don't want this. So the set_code_style reverts styles for the line (by using a
      on the line). + // So the source output looks like this: + // + //
        + //
      1. + + + GeSHi examples + + + +

        GeSHi Example Script

        +

        To use this script, make sure that geshi.php is in the parent directory or in your +include_path, and that the language files are in a subdirectory of GeSHi's directory called geshi/.

        +

        Enter your source and a language to highlight the source in and submit, or just choose a language to +have that language file highlighted in PHP.

        +parse_code(); + echo '
        '; +} +?> +
        +

        Source to highlight

        +

        + +

        +

        Choose a language

        +

        + +

        +

        + + +

        +
        + + + -- 1.7.9.5