2013年6月15日 星期六

How to add syntax highlighting to your blogger site


just wrap your code with the following tag:
<pre class="brush: html">

</pre>
A little testing:
#include <stdio.h>

int main(){
  printf("Hello world!");
  return 0;
}

Brush List:
Brush name Brush aliases File name
ActionScript3as3, actionscript3shBrushAS3.js
Bash/shell bash, shell shBrushBash.js
ColdFusioncf, coldfusionshBrushColdFusion.js
C# c-sharp, csharpshBrushCSharp.js
C++cpp, cshBrushCpp.js
CSScssshBrushCss.js
Delphidelphi, pas, pascalshBrushDelphi.js
Diffdiff, patchshBrushDiff.js
Erlangerl, erlangshBrushErlang.js
GroovygroovyshBrushGroovy.js
JavaScriptjs, jscript, javascriptshBrushJScript.js
JavajavashBrushJava.js
JavaFXjfx, javafxshBrushJavaFX.js
Perlperl, plshBrushPerl.js
PHPphpshBrushPhp.js
Plain Textplain, textshBrushPlain.js
PowerShellps, powershellshBrushPowerShell.js
Pythonpy, pythonshBrushPython.js
Rubyrails, ror, rubyshBrushRuby.js
ScalascalashBrushScala.js
SQLsqlshBrushSql.js
Visual Basicvb, vbnetshBrushVb.js
XMLxml, xhtml, xslt, html, xhtmlshBrushXml.js
另外一款Syntax highlighter:
     

沒有留言:

張貼留言