Procedural File: geshi.php

Source Location: /bblog/bBlog_plugins/geshi/geshi.php ( Revision Log )

Page Details

GeSHi - Generic Syntax Highlighter

The GeSHi class for Generic Syntax Highlighting. Please refer to the documentation at http://qbnz.com/highlighter/documentation.php for more information about how to use this class.

For changes, release notes, TODOs etc, see the relevant files in the docs/ directory

This file is part of GeSHi.

GeSHi is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

GeSHi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GeSHi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Version:  $Id: geshi.php,v 1.13 2005/09/03 12:54:37 oracleshinoda Exp $
License:  GNU GPL
Copyright:  Copyright © 2004, 2005, Nigel McNie
Author:  Nigel McNie <nigel@geshi.org>
Classes
Class Description
GeSHi The GeSHi Class.
Constants
GESHI_ACTIVE  [line 91]

GESHI_ACTIVE = 2

Links in the source in the :active state


[ Top ]

GESHI_CAPS_LOWER  [line 83]

GESHI_CAPS_LOWER = 2

Leave keywords found as the case that they are


[ Top ]

GESHI_CAPS_NO_CHANGE  [line 79]

GESHI_CAPS_NO_CHANGE =

Lowercase keywords found


[ Top ]

GESHI_CAPS_UPPER  [line 81]

GESHI_CAPS_UPPER = 1

Uppercase keywords found


[ Top ]

GESHI_DIR_SEPARATOR  [line 49]

GESHI_DIR_SEPARATOR = ('WIN'!=substr(PHP_OS,0,3))?'/':'\\'

Set the correct directory separator


[ Top ]

GESHI_END_IMPORTANT  [line 101]

GESHI_END_IMPORTANT = '<END GeSHi>'

The ender for important parts of the source


[ Top ]

GESHI_FANCY_LINE_NUMBERS  [line 67]

GESHI_FANCY_LINE_NUMBERS = 2

Use fancy line numbers when building the result


[ Top ]

GESHI_HEADER_DIV  [line 73]

GESHI_HEADER_DIV = 1

Use a <div> to surround the source


[ Top ]

GESHI_HEADER_NONE  [line 71]

GESHI_HEADER_NONE =

Use nothing to surround the source


[ Top ]

GESHI_HEADER_PRE  [line 75]

GESHI_HEADER_PRE = 2

Use a


[ Top ]

GESHI_HOVER  [line 89]

GESHI_HOVER = 1

Links in the source in the :hover state


[ Top ]

GESHI_LANG_ROOT  [line 58]

GESHI_LANG_ROOT = GESHI_ROOT.'geshi'.GESHI_DIR_SEPARATOR

The language file directory for GeSHi


[ Top ]

GESHI_LINK  [line 87]

GESHI_LINK =

Links in the source in the :link state


[ Top ]

GESHI_NORMAL_LINE_NUMBERS  [line 65]

GESHI_NORMAL_LINE_NUMBERS = 1

Use normal line numbers when building the result


[ Top ]

GESHI_NO_LINE_NUMBERS  [line 63]

GESHI_NO_LINE_NUMBERS =

Use no line numbers when building the result


[ Top ]

GESHI_OUTPUT_HTML  [line 46]

GESHI_OUTPUT_HTML =

For the future (though this may never be realised)


[ Top ]

GESHI_ROOT  [line 54]

GESHI_ROOT = dirname(__FILE__).GESHI_DIR_SEPARATOR

The root directory for GeSHi


[ Top ]

GESHI_START_IMPORTANT  [line 99]

GESHI_START_IMPORTANT = '<BEGIN GeSHi>'

The starter for important parts of the source


[ Top ]

GESHI_VERSION  [line 43]

GESHI_VERSION = '1.0.7.2'

The version of this GeSHi file


[ Top ]

GESHI_VISITED  [line 93]

GESHI_VISITED = 3

Links in the source in the :visited state


[ Top ]


Functions
geshi_highlight  [line 2614]

string geshi_highlight( string $string, string $language, string $path, [boolean $return = false]  )

Easy way to highlight stuff. Behaves just like highlight_string

Parameters:
string   $string:  The code to highlight
string   $language:  The language to highlight the code in
string   $path:  The path to the language files. You can leave this blank if you need as from version 1.0.7 the path should be automatically detected
boolean   $return:  Whether to return the result or to echo

API Tags:
Return:  The code highlighted (if $return is true)

Information Tags:
Since:  1.0.2

[ Top ]