進痞客邦『管理後台』→『部落格管理』→『側邊欄位設定』→『頁尾描述』中輸入以下程式碼︰

<script src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shBrushCSharp.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shBrushCss.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shBrushDiff.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shBrushJScript.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shBrushPlain.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shBrushSql.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shBrushVb.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shBrushXml.js" type="text/javascript"></script>
<script type="text/javascript">
     SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/3.0.83/scripts/clipboard.swf';     
     SyntaxHighlighter.all(); 
</script>
<link type="text/css" rel="stylesheet" href="http://www.csie.ncu.edu.tw/~emn178/ref/syntaxhighlighter_3.0.83/styles/shCoreDefault.css"/>

當要貼上程式碼時,請進入html模式,並輸入以下格式︰

<pre class="brush:哪種程式語法"> 
//這裡輸入程式碼
</pre>


其他語法可參考下面列表

Brush name Brush aliases File name
Bash/shell bash, shell shBrushBash.js
C# c-sharp, csharp shBrushCSharp.js
C++ cpp, c shBrushCpp.js
CSS css shBrushCss.js
Delphi delphi, pas, pascal shBrushDelphi.js
Diff diff, patch shBrushDiff.js
Groovy groovy shBrushGroovy.js
JavaScript js, jscript, javascript shBrushJScript.js
Java java shBrushJava.js
Perl perl, pl shBrushPerl.js
PHP php shBrushPhp.js
Plain Text plain, text shBrushPlain.js
Python py, python shBrushPython.js
Ruby rails, ror, ruby shBrushRuby.js
Scala scala shBrushScala.js
SQL sql shBrushSql.js
Visual Basic vb, vbnet shBrushVb.js
XML xml, xhtml, xslt, html, xhtml shBrushXml.js
創作者介紹

吉米.NET

Jimmy 發表在 痞客邦 留言(0) 人氣()