How do I syntax highlight my code with xinotes? 

Joined:
04/09/2007
Posts:
784

April 22, 2007 21:58:45    Last update: January 19, 2009 20:26:12
Your code will be syntax highlighted when you specify the language of your code with the BBcode code tag:

[code=lang]Your code here[/code]


where "lang" is the language of your code. For example, the following Perl code

#!/usr/bin/perl
print "Hello World!\n";


is rendered with:

[code=perl]
#!/usr/bin/perl
print "Hello World!\n";
[/code]


The following are supported languages and their corresponding names for BBcode:
Apache conf: apacheconf, aconf, apache
Bash, sh: bash, sh
C: c
C++: cpp, c++
C#: csharp, c#
Cascading Style Sheets (CSS): css
Delphi, Pascal, Object Pascal: delphi, pas, pascal, objectpascal
Diff file: diff
DOS/Windows batch: bat
Haskell: haskell
HTML: html
INI file: ini, cfg
Java: java
JavaScript: js, javascript
JSP: jsp
Makefile: make, makefile, mf
Objective C: objective-c, objectivec, obj-c, objc
Perl: perl, pl
PHP: php
Python: python, py
Python Console: pycon
Ruby: ruby, rb
Ruby Console: irb
Scheme: scheme
SQL: sql
Tex, LaTex: tex, latex
VB.Net: vb.net, vbnet
XML: xml


The full list is available from http://pygments.org/, which is our backend engine for syntax highlight rendering.
Share |
| Comment  | Tags