GeSHiThe GeSHi Class.
Please refer to the documentation for GeSHi 1.0.X that is available at http://qbnz.com/highlighter/documentation.php for more information about how to use this class.
Located in /geshi.php (line 158)
void
add_keyword_group
(int $key, string $styles, [boolean $case_sensitive = true], [array $words = array()])
void
set_line_style
(string $style1, [string|boolean $style2 = ''], [boolean $preserve_defaults = false])
Constructor GeSHi (line 438)
Creates a new GeSHi object, with source and language
add_keyword (line 1190)
Adds a keyword to a keyword group for highlighting
add_keyword_group (line 1215)
Creates a new keyword group
disable_highlighting (line 1062)
Disables all highlighting
enable_classes (line 606)
Sets whether CSS classes should be used to highlight the source. Default is off, calling this method with no arguments will turn it on
enable_highlighting (line 1076)
Enables all highlighting
The optional flag parameter was added in version 1.0.7.21 and can be used to enable (true) or disable (false) all highlighting.
enable_ids (line 1355)
Whether CSS IDs should be added to each line
enable_important_blocks (line 1345)
Sets whether context-important blocks are highlighted
enable_inner_code_block (line 1283)
Sets whether to force a surrounding block around the highlighted code or not
enable_keyword_links (line 1449)
Turns linking of keywords on or off.
enable_line_numbers (line 678)
Sets whether line numbers should be displayed.
Valid values for the first parameter are:
enable_strict_mode (line 1049)
Enables/disables strict highlighting. Default is off, calling this method without parameters will turn it on. See documentation for more details on strict mode and where to use it.
error (line 451)
Returns an error message associated with the last GeSHi operation, or false if no error has occured
get_language_name (line 473)
Gets a human-readable language name (thanks to Simon Patterson for the idea :))
get_language_name_from_extension (line 1103)
Given a file extension, this method returns either a valid geshi language name, or the empty string if it couldn't be found
get_real_tab_width (line 1033)
Returns the tab width to use, based on the current language and user preference
get_stylesheet (line 2886)
Returns a stylesheet for the highlighted code. If $economy mode is true, we only return the stylesheet declarations that matter for this code block instead of the whole thing
get_time (line 2429)
Gets the time taken to parse the code
highlight_lines_extra (line 1370)
Specifies which lines to highlight extra
The extra style parameter was added in 1.0.7.21.
load_from_file (line 1173)
Given a file name, this method loads its contents in, and attempts
to set the language automatically. An optional lookup table can be passed for looking up the language name. If not specified a default table is used
The language table is in the form
array(
'lang_name' => array('extension', 'extension', ...),
'lang_name' ...
);
parse_code (line 1463)
Returns the code in $this->source, highlighted and surrounded by the nessecary HTML.
This should only be called ONCE, cos it's SLOW! If you want to highlight the same source multiple times, you're better off doing a whole lot of str_replaces to replace the <span>s
remove_keyword (line 1201)
Removes a keyword from a keyword group
remove_keyword_group (line 1229)
Removes a keyword group
set_brackets_highlighting (line 811)
Turns highlighting on/off for brackets
This method is DEPRECATED: use set_symbols_highlighting instead. This method will be remove in 1.2.X
set_brackets_style (line 792)
Sets the styles for brackets. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
This method is DEPRECATED: use set_symbols_style instead. This method will be removed in 1.2.X
set_case_keywords (line 992)
Sets the case that keywords should use when found. Use the constants:
set_case_sensitivity (line 978)
Sets whether a set of keywords are checked for in a case sensitive manner
set_code_style (line 625)
Sets the style for the actual code. This should be a string
containing valid stylesheet declarations. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
Note: Use this method to override any style changes you made to the line numbers if you are using line numbers, else the line of code will have the same style as the line number! Consult the GeSHi documentation for more information about this.
set_comments_highlighting (line 745)
Turns highlighting on/off for comment groups
set_comments_style (line 729)
Sets the styles for comment groups. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
set_encoding (line 1437)
Sets the encoding used for htmlspecialchars(), for international support.
NOTE: This is not needed for now because htmlspecialchars() is not being used (it has a security hole in PHP4 that has not been patched). Maybe in a future version it may make a return for speed reasons, but I doubt it.
set_escape_characters_highlighting (line 774)
Turns highlighting on/off for escaped characters
set_escape_characters_style (line 759)
Sets the styles for escaped characters. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
set_footer_content (line 1252)
Sets the content of the footer block
set_footer_content_style (line 1272)
Sets the style for the footer content
set_header_content (line 1242)
Sets the content of the header block
set_header_content_style (line 1262)
Sets the style for the header content
set_header_type (line 546)
Sets the type of header to be used.
If GESHI_HEADER_DIV is used, the code is surrounded in a "div".This means more source code but more control over tab width and line-wrapping. GESHI_HEADER_PRE means that a "pre" is used - less source, but less control. Default is GESHI_HEADER_PRE.
From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code should be outputted.
set_highlight_lines_extra_style (line 1392)
Sets the style for extra-highlighted lines
set_important_styles (line 1333)
Sets styles for important parts of the code
set_keyword_group_highlighting (line 714)
Turns highlighting on/off for a keyword group
set_keyword_group_style (line 698)
Sets the style for a keyword group. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
set_language (line 497)
Sets the language for this object
set_language_path (line 525)
Sets the path to the directory containing the language files. Note that this path is relative to the directory of the script that included geshi.php, NOT geshi.php itself.
set_line_ending (line 1402)
Sets the line-ending
set_line_style (line 646)
Sets the styles for the line numbers.
set_link_styles (line 1308)
Sets styles for links in code
set_link_target (line 1318)
Sets the target for links in code
set_methods_highlighting (line 937)
Turns highlighting on/off for methods
set_methods_style (line 922)
Sets the styles for methods. $key is a number that references the
appropriate "object splitter" - see the language file for the language you are highlighting to get this number. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
set_numbers_highlighting (line 905)
Turns highlighting on/off for numbers
set_numbers_style (line 890)
Sets the styles for numbers. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
set_overall_class (line 584)
Sets the overall classname for this block of code. This class can then be used in a stylesheet to style this object's output
set_overall_id (line 595)
Sets the overall id for this block of code. This id can then be used in a stylesheet to style this object's output
set_overall_style (line 567)
Sets the styles for the code that will be outputted when this object is parsed. The style should be a string of valid stylesheet declarations
set_regexps_highlighting (line 967)
Turns highlighting on/off for regexps
set_regexps_style (line 951)
Sets the styles for regexps. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
set_source (line 486)
Sets the source code for this object
set_strings_highlighting (line 876)
Turns highlighting on/off for strings
set_strings_style (line 861)
Sets the styles for strings. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
set_symbols_highlighting (line 845)
Turns highlighting on/off for symbols
set_symbols_style (line 826)
Sets the styles for symbols. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority
set_tab_width (line 1007)
Sets how many spaces a tab is substituted for
Widths below zero are ignored
set_url_for_keyword_group (line 1296)
Sets the base URL to be used for keywords
set_use_language_tab_width (line 1022)
Sets whether or not to use tab-stop width specifed by language
start_line_numbers_at (line 1421)
Sets what number line numbers should start at. Should be a positive integer, and will be converted to one.
Warning: Using this method will add the "start" attribute to the <ol> that is used for line numbering. This is not valid XHTML strict, so if that's what you care about then don't use this method. Firefox is getting support for the CSS method of doing this in 1.1 and Opera has support for the CSS method, but (of course) IE doesn't so it's not worth doing it the CSS way yet.
Documentation generated on Sun, 23 Mar 2008 13:36:21 +0100 by phpDocumentor 1.4.1