dp.SyntaxHighlighter一款基于JavaScript的客户端源代码加亮脚本。
1.5版本支持12中编程语言:C#、CSS、C++、Delphi、Java、JavaScript、PHP、Python、Ruby、SQL、Visual、Basic、XML/HTML。
1.5版本支持12中编程语言:C#、CSS、C++、Delphi、Java、JavaScript、PHP、Python、Ruby、SQL、Visual、Basic、XML/HTML。
dp.SyntaxHighlighter的使用非常简单,你只需在源代码页的页面头部、尾部分别导入下面代码
头部:
尾部:
<script class="JavaScript" src="/blog/Scripts/shCore.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushCSharp.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushPhp.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushJScript.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushJava.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushVb.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushSql.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushXml.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushDelphi.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushPython.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushRuby.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushCss.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushCpp.js"></script>
<script class="JavaScript">
dp.SyntaxHighlighter.ClipboardSwf = 'Scripts/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
</script>
你现在看到的这个页面的源代码加亮功能就是使用dp.SyntaxHighlighter,感觉效果比较清爽。
展示地址:http://www.livebaby.cn/blog/u/meil/archives/2007/811.html
<script class="JavaScript" src="/blog/Scripts/shBrushCSharp.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushPhp.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushJScript.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushJava.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushVb.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushSql.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushXml.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushDelphi.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushPython.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushRuby.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushCss.js"></script>
<script class="JavaScript" src="/blog/Scripts/shBrushCpp.js"></script>
<script class="JavaScript">
dp.SyntaxHighlighter.ClipboardSwf = 'Scripts/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
</script>
你现在看到的这个页面的源代码加亮功能就是使用dp.SyntaxHighlighter,感觉效果比较清爽。
展示地址:http://www.livebaby.cn/blog/u/meil/archives/2007/811.html