Hello world

Hello World

2013年10月10日 星期四

[網站插件] Blog 或網站插入程式碼框 - SyntaxHighlighter


=========================================================

【SyntaxHighlighter】官方網站:點我前往

SyntaxHighlighter_3.0.83.zip

官方載點:點我下載

本站載點:點我下載

=========================================================

【設置教學:】

下載完並解壓縮後上傳至 [Google協作平台], [DropBox] 或是放到自己擁有的網頁空間中。

開啟 Blogger 進入管理介面/設計/修改HTML,插入以下必要之程式碼在 <head> 到 </head> 之間加入即可。

註:要記得把程式碼中的 "yoursite" 改成自己所上傳的檔案位址。

程式原碼:
<link type="text/css" rel="stylesheet" href="yoursite/styles/shCore.css"/>
<link type="text/css" rel="stylesheet" href="yoursite/styles/shThemeDefault.css" id="shTheme"/>
<script type="text/javascript" src="yoursite/scripts/shAutoloader.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushAppleScript.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushAS3.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushBash.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushColdFusion.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushCpp.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushCSharp.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushCss.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushDelphi.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushDiff.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushErlang.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushGroovy.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushJava.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushJavaFX.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushPerl.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushPlain.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushPowerShell.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushPython.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushRuby.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushSass.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushScala.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushSql.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushVb.js"></script>
<script type="text/javascript" src="yoursite/scripts/shBrushXml.js"></script>
<script type="text/javascript" src="yoursite/scripts/shCore.js"></script>
<script type="text/javascript" src="yoursite/scripts/shLegacy.js"></script>
<script type='text/javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</script>
使用教學:

註:發文時將程式碼以下列成對標籤圍起來即可。

更改格式:將 brush: 的 XXX 改為程式碼格式。

參考格式範本:點我前往
<pre class="brush: XXX;">你的程式碼</pre>

=========================================================

沒有留言 :

張貼留言

提供匿名留言,歡迎留言詢問 ^ ^