>>syntaxhighlighter網站
>>這裡是網友寫的搭配各式部落格的教學
在blogger中的用法
1. 到設計 > 修改HTML > 找到語法中<head>的位置,在<head>之下置入語法
<!--SYNTAX HIGHLIGHTER BEGINS--> <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/shLegacy.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js' type='text/javascript'/> <script type='text/javascript'>SyntaxHighlighter.all();</script> <!--SYNTAX HIGHLIGHTER ENDS-->
2. 編寫文章的時候在語法部份改用HTML編輯,將語法用<pre></pre>包起來(可能會要常切換面板就是了)
<pre class="brush: html"> 把語法放在這~! </pre>
附帶說明:
1. 後面的class需要指定目前使用的語法是哪一種,才會有顏色變化喔~
>> 語法對照表
2. 可以替換畫面的樣板
>>樣版DEMO
沒有留言:
張貼留言