Class GeSHi

Description

Located in /mambots/content/geshi/geshi.php (line 100)


	
			
Variable Summary
Method Summary
GeSHi GeSHi (mixed $source, mixed $language, [mixed $path = 'geshi/'])
void add_keyword (mixed $key, mixed $word)
void add_keyword_group (mixed $key, mixed $styles, [mixed $case_sensitive = true], [mixed $words = array()])
void add_url_to_keyword (mixed $keyword, mixed $group, mixed $start_or_end)
void change_case (mixed $instr)
void enable_classes ([mixed $flag = true])
void enable_ids ([mixed $flag = true])
void enable_important_blocks (mixed $flag)
void enable_line_numbers (mixed $flag, [mixed $nth_row = 5])
void enable_strict_mode ([mixed $mode = true])
void error ()
void finalise (mixed $parsed_code)
void footer ()
void get_attributes ()
void get_stylesheet ([mixed $economy_mode = true])
void get_time ()
void header ()
void highlight_lines_extra (mixed $lines)
void indent (mixed $result)
void load_language ()
void parse_code ()
void parse_non_string_part (mixed &$stuff_to_parse)
void remove_keyword (mixed $key, mixed $word)
void remove_keyword_group (mixed $key)
void replace_keywords (mixed $instr)
void set_brackets_highlighting (mixed $flag)
void set_brackets_style (mixed $style, [mixed $preserve_defaults = false])
void set_case_keywords (mixed $case)
void set_case_sensitivity (mixed $key, mixed $case)
void set_code_style (mixed $style, mixed $preserve_defaults)
void set_comments_highlighting (mixed $key, [mixed $flag = true])
void set_comments_style (mixed $key, mixed $style, [mixed $preserve_defaults = false])
void set_encoding (mixed $encoding)
void set_escape_characters_highlighting ([mixed $flag = true])
void set_escape_characters_style (mixed $style, [mixed $preserve_defaults = false])
void set_footer_content (mixed $content)
void set_footer_content_style (mixed $style)
void set_header_content (mixed $content)
void set_header_content_style (mixed $style)
void set_header_type (mixed $type)
void set_highlight_lines_extra_style (mixed $styles)
void set_important_styles (mixed $styles)
void set_keyword_group_highlighting (mixed $key, [mixed $flag = true])
void set_keyword_group_style (mixed $key, mixed $style, [mixed $preserve_defaults = false])
void set_language (mixed $language)
void set_language_path (mixed $path)
void set_line_style (mixed $style1, [mixed $style2 = ''], [mixed $preserve_defaults = false])
void set_link_styles (mixed $type, mixed $styles)
void set_link_target (mixed $target)
void set_methods_highlighting (mixed $flag)
void set_methods_style (mixed $key, mixed $style, [mixed $preserve_defaults = false])
void set_numbers_highlighting (mixed $flag)
void set_numbers_style (mixed $style, [mixed $preserve_defaults = false])
void set_overall_class (mixed $class)
void set_overall_id (mixed $id)
void set_overall_style (mixed $style, [mixed $preserve_defaults = false])
void set_regexps_highlighting (mixed $key, mixed $flag)
void set_regexps_style (mixed $key, mixed $style, [mixed $preserve_defaults = false])
void set_source (mixed $source)
void set_strings_highlighting (mixed $flag)
void set_strings_style (mixed $style, [mixed $preserve_defaults = false])
void set_symbols_highlighting (mixed $flag)
void set_symbols_style (mixed $style, [mixed $preserve_defaults = false])
void set_tab_width (mixed $width)
void set_time (mixed $start_time, mixed $end_time)
void set_url_for_keyword_group (mixed $group, mixed $url)
void start_line_numbers_at (mixed $number)
Variables
mixed $add_ids = false (line 125)
mixed $code_style = 'font-family: \'Courier New\', Courier, monospace; font-weight: normal;' (line 133)
mixed $enable_important_blocks = true (line 123)
mixed $encoding = '' (line 147)
mixed $error = false (line 111)
mixed $footer_content = '' (line 119)
mixed $footer_content_style = '' (line 121)
mixed $header_content = '' (line 118)
mixed $header_content_style = '' (line 120)
mixed $header_type = GESHI_HEADER_PRE (line 114)
mixed $highlight_extra_lines = array() (line 126)
mixed $highlight_extra_lines_style = 'color: #cc0; background-color: #ffc;' (line 127)
mixed $important_styles = 'font-weight: bold; color: red;' (line 124)
mixed $language = '' (line 108)
mixed $language_data = array() (line 109)
mixed $language_path = 'geshi/' (line 110)
mixed $lexic_permissions = array() (line 115)
mixed $line_nth_row = 0 (line 140)
mixed $line_numbers = GESHI_NO_LINE_NUMBERS (line 139)
mixed $line_numbers_start = 1 (line 128)
mixed $line_style1 = 'font-family: \'Courier New\', Courier, monospace; color: black; font-weight: normal; font-style: normal;' (line 137)
mixed $line_style2 = 'font-weight: bold;' (line 138)
mixed $link_styles = array() (line 122)
mixed $link_target = '' (line 146)
mixed $max_tabs = 20 (line 144)
mixed $min_tabs = 0 (line 145)
mixed $output_format = GESHI_OUTPUT_HTML (line 150)
mixed $overall_class = '' (line 134)
mixed $overall_id = '' (line 135)
mixed $overall_style = '' (line 131)
mixed $source = '' (line 107)
mixed $strict_mode = false (line 112)
mixed $tab_width = 8 (line 143)
mixed $time = 0 (line 117)
mixed $use_classes = false (line 113)
Methods
Constructor GeSHi (line 158)

constructor: GeSHi

------------------ Creates a new GeSHi object, with source and language

GeSHi GeSHi (mixed $source, mixed $language, [mixed $path = 'geshi/'])
add_keyword (line 845)

method: add_keyword

------------------- Adds a keyword to a keyword group for highlighting

void add_keyword (mixed $key, mixed $word)
add_keyword_group (line 867)

method: add_keyword_group

------------------------- Creates a new keyword group

void add_keyword_group (mixed $key, mixed $styles, [mixed $case_sensitive = true], [mixed $words = array()])
add_url_to_keyword (line 1574)

method: add_url_to_keyword -------------------------- Adds a url to a keyword where needed.

Added in 1.0.2

void add_url_to_keyword (mixed $keyword, mixed $group, mixed $start_or_end)
change_case (line 1554)

method: change_case

------------------- Changes the case of a keyword for those languages where a change is asked for

void change_case (mixed $instr)
disable_highlighting (line 763)

method: disable_highlighting

---------------------------- Disables all highlighting

void disable_highlighting ()
enable_classes (line 327)

method: enable_classes

---------------------- Sets whether CSS classes should be used to highlight the source. Default is off, calling this method with no arguments will turn it on

void enable_classes ([mixed $flag = true])
enable_highlighting (line 804)

method: enable_highlighting

--------------------------- Enables all highlighting

void enable_highlighting ()
enable_ids (line 1005)

method: enable_ids

------------------ Whether CSS IDs should be added to each line

void enable_ids ([mixed $flag = true])
enable_important_blocks (line 994)

method: enable_important_blocks

------------------------------- Sets whether context-important blocks are highlighted

void enable_important_blocks (mixed $flag)
enable_line_numbers (line 394)

method: enable_line_numbers

--------------------------- Sets whether line numbers should be displayed. GESHI_NO_LINE_NUMBERS = not displayed, GESHI_NORMAL_LINE_NUMBERS = displayed, GESHI_FANCY_LINE_NUMBERS = every nth line a different class. Default is for no line numbers to be used

void enable_line_numbers (mixed $flag, [mixed $nth_row = 5])
enable_strict_mode (line 740)

method: enable_strict_mode

-------------------------- 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

void enable_strict_mode ([mixed $mode = true])
error (line 179)

method: error

------------- Returns an error message associated with the last GeSHi operation, or false if no error has occured

void error ()
finalise (line 1899)

method: finalise ---------------- Takes the parsed code and various options, and creates the HTML surrounding it to make it look nice.

void finalise (mixed $parsed_code)
footer (line 2109)

method: footer

-------------- Returns the footer for the code block. Ending newline removed in 1.0.2

void footer ()
format_footer_content (line 2137)

method: format_footer_content

----------------------------- Returns the footer content, formatted for output

void format_footer_content ()
format_header_content (line 2080)

method: format_header_content

----------------------------- Returns the header content, formatted for output

void format_header_content ()
get_attributes (line 2188)

method: get_attributes

---------------------- Gets the CSS attributes for this code

void get_attributes ()
get_language_name (line 209)

get_language_name()

--------------- Gets a human-readable language name (thanks to Simon Patterson for the idea :))

void get_language_name ()
get_stylesheet (line 2215)

method: get_stylesheet

---------------------- 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

void get_stylesheet ([mixed $economy_mode = true])
get_tab_replacement (line 1874)

method: get_tab_replacement --------------------------- Gets the replacement string for tabs in the source code. Useful for HTML highlighting, where tabs don't mean anything to a browser.

void get_tab_replacement ()
get_time (line 1834)

method: get_time

---------------- Gets the time taken to parse the code

void get_time ()
header (line 2027)

method: header

-------------- Creates the header for the code block (with correct attributes)

void header ()
highlight_lines_extra (line 1016)

method: highlight_lines_extra

----------------------------- Specifies which lines to highlight extra

void highlight_lines_extra (mixed $lines)
indent (line 1536)

method: indent -------------- Swaps out spaces and tabs for HTML indentation. Not needed if the code is in a pre block...

void indent (mixed $result)
load_language (line 1844)

method: load_language

--------------------- Gets language information and stores it for later use

void load_language ()
parse_code (line 1075)

method: parse_code()

-------------------- 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

void parse_code ()
parse_non_string_part (line 1606)

method: parse_non_string_part ----------------------------- Takes a string that has no strings or comments in it, and highlights stuff like keywords, numbers and methods.

void parse_non_string_part (mixed &$stuff_to_parse)
remove_keyword (line 856)

method: remove_keyword

---------------------- Removes a keyword from a keyword group

void remove_keyword (mixed $key, mixed $word)
remove_keyword_group (line 885)

method: remove_keyword_group

---------------------------- Removes a keyword group

void remove_keyword_group (mixed $key)
replace_keywords (line 2167)

method: replace_keywords

---------------------- Replaces certain keywords in the header and footer with certain configuration values

void replace_keywords (mixed $instr)
set_brackets_highlighting (line 525)

method: set_brackets_highlighting --------------------------------- Turns highlighting on/off for brackets

This method is DEPRECATED: use set_symbols_highlighting instead. This method will be remove in 1.2.X

void set_brackets_highlighting (mixed $flag)
set_brackets_style (line 504)

method: set_brackets_style

-------------------------- 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

void set_brackets_style (mixed $style, [mixed $preserve_defaults = false])
set_case_keywords (line 712)

method: set_case_keywords

------------------------- Sets the case that keywords should use when found. Use the constants: GESHI_CAPS_NO_CHANGE: leave keywords as-is GESHI_CAPS_UPPER: convert all keywords to uppercase where found GESHI_CAPS_LOWER: convert all keywords to lowercase where found Method added in 1.0.1

void set_case_keywords (mixed $case)
set_case_sensitivity (line 697)

method: set_case_sensitivity

---------------------------- Sets whether a set of keywords are checked for in a case sensitive manner

void set_case_sensitivity (mixed $key, mixed $case)
set_code_style (line 346)

method: set_code_style

---------------------- 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.

void set_code_style (mixed $style, mixed $preserve_defaults)
set_comments_highlighting (line 457)

method: set_comments_highlighting

--------------------------------- Turns highlighting on/off for comment groups

void set_comments_highlighting (mixed $key, [mixed $flag = true])
set_comments_style (line 439)

method: set_comments_style

-------------------------- 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

void set_comments_style (mixed $key, mixed $style, [mixed $preserve_defaults = false])
set_encoding (line 1061)

method: set_encoding -------------------- Sets the encoding used for htmlentities(), for international support.

void set_encoding (mixed $encoding)
set_escape_characters_highlighting (line 488)

method: set_escape_characters_highlighting

------------------------------------------ Turns highlighting on/off for escaped characters

void set_escape_characters_highlighting ([mixed $flag = true])
set_escape_characters_style (line 470)

method: set_escape_characters_style

----------------------------------- 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

void set_escape_characters_style (mixed $style, [mixed $preserve_defaults = false])
set_footer_content (line 910)

method: set_footer_content

-------------------------- Sets the content of the footer block

void set_footer_content (mixed $content)
set_footer_content_style (line 932)

method: set_footer_content_style

-------------------------------- Sets the style for the footer content

void set_footer_content_style (mixed $style)
set_header_content (line 899)

method: set_header_content

-------------------------- Sets the content of the header block

void set_header_content (mixed $content)
set_header_content_style (line 921)

method: set_header_content_style

-------------------------------- Sets the style for the header content

void set_header_content_style (mixed $style)
set_header_type (line 270)

method: set_header_type

----------------------- 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

void set_header_type (mixed $type)
set_highlight_lines_extra_style (line 1037)

method: set_highlight_lines_extra_style

--------------------------------------- Sets the style for extra-highlighted lines

void set_highlight_lines_extra_style (mixed $styles)
set_important_styles (line 983)

method: set_important_styles

---------------------------- Sets styles for important parts of the code

void set_important_styles (mixed $styles)
set_keyword_group_highlighting (line 426)

method: set_keyword_group_highlighting

-------------------------------------- Turns highlighting on/off for a keyword group

void set_keyword_group_highlighting (mixed $key, [mixed $flag = true])
set_keyword_group_style (line 408)

method: set_keyword_group_style

------------------------------- 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

void set_keyword_group_style (mixed $key, mixed $style, [mixed $preserve_defaults = false])
set_language (line 239)

method: set_language

-------------------- Sets the language for this object

void set_language (mixed $language)
set_language_path (line 255)

method: set_language_path

------------------------- 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.

void set_language_path (mixed $path)
set_line_style (line 367)

method: set_line_style

---------------------- Sets the styles for the line numbers. 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

void set_line_style (mixed $style1, [mixed $style2 = ''], [mixed $preserve_defaults = false])
set_link_styles (line 954)

method: set_link_styles

----------------------- Sets styles for links in code

void set_link_styles (mixed $type, mixed $styles)
set_link_target (line 965)

method: set_link_target

----------------------- Sets the target for links in code

void set_link_target (mixed $target)
set_methods_highlighting (line 655)

method: set_methods_highlighting

-------------------------------- Turns highlighting on/off for methods

void set_methods_highlighting (mixed $flag)
set_methods_style (line 637)

method: set_methods_style

------------------------- 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

void set_methods_style (mixed $key, mixed $style, [mixed $preserve_defaults = false])
set_numbers_highlighting (line 622)

method: set_numbers_highlighting

-------------------------------- Turns highlighting on/off for numbers

void set_numbers_highlighting (mixed $flag)
set_numbers_style (line 604)

method: set_numbers_style

------------------------- 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

void set_numbers_style (mixed $style, [mixed $preserve_defaults = false])
set_overall_class (line 303)

method: set_overall_class

------------------------- Sets the overall classname for this block of code. This class can then be used in a stylesheet to style this object's output

void set_overall_class (mixed $class)
set_overall_id (line 315)

method: set_overall_id

---------------------- Sets the overall id for this block of code. This id can then be used in a stylesheet to style this object's output

void set_overall_id (mixed $id)
set_overall_style (line 283)

method: set_overall_style

------------------------- 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

void set_overall_style (mixed $style, [mixed $preserve_defaults = false])
set_regexps_highlighting (line 686)

method: set_regexps_highlighting

-------------------------------- Turns highlighting on/off for regexps

void set_regexps_highlighting (mixed $key, mixed $flag)
set_regexps_style (line 668)

method: set_regexps_style

------------------------- 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

void set_regexps_style (mixed $key, mixed $style, [mixed $preserve_defaults = false])
set_source (line 228)

method: set_source

------------------ Sets the source code for this object

void set_source (mixed $source)
set_strings_highlighting (line 591)

method: set_strings_highlighting

-------------------------------- Turns highlighting on/off for strings

void set_strings_highlighting (mixed $flag)
set_strings_style (line 573)

method: set_strings_style

------------------------- 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

void set_strings_style (mixed $style, [mixed $preserve_defaults = false])
set_symbols_highlighting (line 558)

method: set_symbols_highlighting

--------------------------------- Turns highlighting on/off for symbols

void set_symbols_highlighting (mixed $flag)
set_symbols_style (line 538)

method: set_symbols_style

-------------------------- 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

void set_symbols_style (mixed $style, [mixed $preserve_defaults = false])
set_tab_width (line 725)

method: set_tab_width

--------------------- Sets how many spaces a tab is substituted for This method will probably be re-engineered later to allow customisability in the maximum and minimum number of tabs without mutulating data fields.

void set_tab_width (mixed $width)
set_time (line 1822)

method: set_time

---------------- Sets the time taken to parse the code

void set_time (mixed $start_time, mixed $end_time)
set_url_for_keyword_group (line 943)

method: set_url_for_keyword_group

--------------------------------- Sets the base URL to be used for keywords

void set_url_for_keyword_group (mixed $group, mixed $url)
start_line_numbers_at (line 1049)

method: start_line_numbers_at ----------------------------- Sets what number line numbers should start at. Should be a positive integer, and will be converted to one.

void start_line_numbers_at (mixed $number)

Documentation generated on Fri, 4 Mar 2005 13:56:18 +1000 by phpDocumentor 1.3.0RC3