CodeCodex:Syntax Highlighting

From CodeCodex

Revision as of 17:58, 18 February 2007 by WikiSysop (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Syntax Highlighting

Syntax Highlighting is availabe on CodeCodex thanks to Mike Jewell at Beautifier.org and Lucas@AmieStreet.

To markup your code add a <highlightsyntax> tag before your code and </highlightsyntax> after. To render a specific language, change the opening tag to <highlightsyntax language="language"> where 'language' is one of the available languages.

Languages

Below is some of the common languages available for specific syntax highlighting, for a full list, see this list.

  • ada95
  • c
  • cobol
  • cpp (C++)
  • cppheader
  • cppsource
  • csharp (C#)
  • css
  • delphi
  • dosbatch
  • fortran90
  • haskell
  • html
  • htmlphpsql
  • java122 (written for 1.22, but works fine for newer versions of Java)
  • javascript
  • matlab5
  • maya
  • mysql
  • ocaml
  • pascal
  • perl
  • php3
  • phphtml
  • python
  • qbasic
  • rexx
  • scheme
  • tcltk
  • vb
  • xhtml10
  • xhtml11
  • xhtmlbasic
  • xml
  • xsl

Example

<highlightsyntax language="java122"> for (int i = 0 ; i <= 10 ; i++) { System.println.out(i); } //counting is fun!</highlightsyntax> <HIGHLIGHTSYNTAX language="java122"> for (int i = 0 ; i <= 10 ; i++) { System.println.out(i); } //counting is fun!</HIGHLIGHTSYNTAX>