SyntaxHighlighter for Blogger Dynamic View
http://blog.cruxframework.org/2011/10/easy-code-syntax-highlight-on-blogger.html
因為dynamic view不能更改html template,所以他們把SyntaxHighlighter先用Google Closure Compiler Service compile成js.用的時候直接將code放在<pre>跟</pre>之間就可以了。
原本SyntaxHighlighter還有其他的brushes,http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/
可以支援其他的語言,不過在這個cruxframework的版本裡就沒有了。
因為dynamic view不能更改html template,所以他們把SyntaxHighlighter先用Google Closure Compiler Service compile成js.用的時候直接將code放在<pre>跟</pre>之間就可以了。
<pre class="brush:java">    public class SyntaxHighlighterWorksFineHere    {        public static void main(String[] args)        {            System.out.println("Yes!");        }    }</pre><script src="
http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js
"></script>可以支援其他的語言,不過在這個cruxframework的版本裡就沒有了。
Comments
Post a Comment