2007年2月5日 星期一

syntaxhighlighter的相關連結檔案

要使用syntaxhighlighter必須要下載該套件中的js以及相關的css檔案,目前網路上看到的作法,都是將相關的檔案上傳到google page,然後再使用該連結連接。感謝google page提供如此好用的功能。 底下列出我在google page上傳的相關檔案連結 http://avilin.googlepages.com/TestPages.css http://avilin.googlepages.com/shBrushCSharp.js http://avilin.googlepages.com/shBrushCpp.js http://avilin.googlepages.com/shBrushCss.js http://avilin.googlepages.com/shBrushJScript.js http://avilin.googlepages.com/shBrushJava.js http://avilin.googlepages.com/shBrushPhp.js http://avilin.googlepages.com/shBrushSql.js http://avilin.googlepages.com/shBrushXml.js http://avilin.googlepages.com/shCore.js http://avilin.googlepages.com/syntaxhighlighter.css 使用的方法: 進入bloger的html編輯模式將 <link type="text/css" rel="stylesheet" href="http://avilin.googlepages.com/syntaxhighlighter.css"></link> <link href="http://avilin.googlepages.com/TestPages.css" rel="stylesheet" type="text/css"> 貼到最上面 然後再將 <script class="javascript" src="Scripts/shCore.js"> <script class="javascript" src="Scripts/shBrush[languageName].js"></script> <script class="javascript"> dp.SyntaxHighlighter.HighlightAll('code'); </script> 貼到最下面,此時再進入撰寫模式,寫到程式碼的時候 記得要將程式碼貼到textarea裡,然後設定textarea的name="code"以及class="[languageName]"即可,千萬記住,此時不要再切回html編輯模式,否則所貼入的程式碼將會被至入許多換行符號。

沒有留言: