2011-10-15 47 views

回答

0

對於其他人尋找一個解決這個問題 - 確保你從你的<頭內引用shBrushCss.js庫> < /頭>標籤,像這樣:

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/> 

此外,您還可以在http://oneqonea.blogspot.com/2012/04/how-do-i-add-syntax-highlighting-to-my.html

籤這個答案的來源這是一個非常容易遵循博客,我寫了一個覆蓋幾個簡單的步驟加入語法高亮顯示您的Blogger博客從上到下(帶截圖)。

0

如果您運行博客博客,您可以按照以下步驟來集成SyntaxHighlighter。

我已經很好地解釋說:

<link href='http://alexgorbatchev.com/pub/sh/current//styles/shCore.css' rel='stylesheet' type='text/css'/> 
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js'/> 
<script> 
    SyntaxHighlighter.config.bloggerMode = true; 
    SyntaxHighlighter.config.clipboardSwf = "http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf"; 
    SyntaxHighlighter.all(); 
</script> 

接下來我在文章中寫道:

<pre class="brush:bash"> 
ls -al | grep .jpg 
</pre> 

在例How to Add Syntax Highlighter to Blogger

0

我在模板頭部分的結尾寫道:這here見。