How to category Design category Development category News category

GeSHi – syntax highlighting

Just installed a modified version of Mikhail Kyurshin's GeSHi highlighter plugin.

http://qbnz.com/highlighter/index.php gives full details. updated the GeSHi lib to 1.0.7.11 also injected the language name into the resultant html etc… Also added line numbering support.
To use simply enter the tag code with lang="yourlanguage"
e.g.

[ code lang="actionscript"]function ExtendedXML(){
//code lang="actionscript"
super();
this.ignoreWhite = true;
}[/code]

gives –

<actionscript/>
function ExtendedXML(){
	//code lang=&quot;actionscript&quot;
	super();
	this.ignoreWhite = true;
	}

with line number – add num="XXX" e.g.- numbering from 120

[ code lang="actionscript" num="120"]function ExtendedXML(){
//code lang="actionscript" num="120"
super();
this.ignoreWhite = true;
}[/code]

gives –

<actionscript/>
  1. function ExtendedXML(){
  2. //code lang=&quot;actionscript&quot; num=&quot;120&quot;
  3. super();
  4. this.ignoreWhite = true;
  5. }

Note – tinymce in firefox looses the attributes to the code tag! therfore i modified this plugin to use ubb style tags rather than the HTML version as editing posts with marked-up "code" in firefox wont work if you use TinyMCE.

I also notice that some tabbing seems to get lost… might be worth making this an embeded control in the editor instead…
Supported languages for referance –

  • lang="actionscript" == ActionScript
  • lang="actionscript-french" == ActionScript (French Doc Links)
  • lang="ada" == Ada
  • lang="apache" == Apache Log File
  • lang="applescript" == AppleScript
  • lang="asm" == ASM (NASM based)
  • lang="asp" == ASP
  • lang="autoit" == AutoIT
  • lang="bash" == Bash
  • lang="blitzbasic" == BlitzBasic
  • lang="c" == C
  • lang="c_mac" == C for Macs
  • lang="caddcl" == CAD DCL
  • lang="cadlisp" == CAD Lisp
  • lang="cfdg" == CFDG
  • lang="cpp" == C++
  • lang="csharp" == C#
  • lang="css" == CSS
  • lang="d" == D
  • lang="delphi" == Delphi
  • lang="diff" == Diff
  • lang="div" == DIV
  • lang="dos" == DOS
  • lang="eiffel" == Eiffel
  • lang="fortran" == Fortran
  • lang="freebasic" == FreeBasic
  • lang="gml" == GML
  • lang="groovy" == Groovy
  • lang="html4strict" == HTML (4.0.1)
  • lang="inno" == Inno
  • lang="java" == Java
  • lang="java5" == Java 5
  • lang="javascript" == Javascript
  • lang="lisp" == Lisp
  • lang="lua" == Lua
  • lang="matlab" == Matlab
  • lang="mpasm" == MPASM
  • lang="mysql" == MySQL
  • lang="nsis" == NullSoft Installer
  • lang="objc" == Objective C
  • lang="ocaml" == OCaml
  • lang="ocaml-brief" == OCaml (Brief)
  • lang="oobas" == Openoffice.org BASIC
  • lang="oracle8" == Oracle 8
  • lang="pascal" == Pascal
  • lang="perl" == Perl
  • lang="php" == PHP
  • lang="php-brief" == PHP (Brief version)
  • lang="python" == Python
  • lang="qbasic" == QBasic/QuickBASIC
  • lang="reg" == Windows Registry
  • lang="robots" == robots.txt
  • lang="ruby" == Ruby
  • lang="sas" == SAS
  • lang="scheme" == Scheme
  • lang="sdlbasic" == SDLBasic
  • lang="smalltalk" == Smalltalk
  • lang="smarty" == Smarty
  • lang="sql" == SQL
  • lang="tcl" == TCL
  • lang="text" == Plain text
  • lang="tsql" == T-SQL
  • lang="vb" == VisualBasic
  • lang="vbnet" == VB.NET
  • lang="vhdl" == VHDL
  • lang="visualfoxpro" == VisualFoxPro
  • lang="winbatch" == Winbatch
  • lang="xml" == XML
Tags:

admin

Comments are closed.