I think highlight.js is better than SyntaxHighlighter. It supports more languages and you don't need to specify. It has pre-defined styles and they looks quite good.
You can download it here. If you are lazy to set up, you can just use mine. I picked up Bash, C#, C++, CSS, Django, HTML, XML, Javascript, PHP, Python, Python profile, and diff. I use Zenburn style with one modification, I make footer bar's background color of code block as transparent.
You can download it here. If you are lazy to set up, you can just use mine. I picked up Bash, C#, C++, CSS, Django, HTML, XML, Javascript, PHP, Python, Python profile, and diff. I use Zenburn style with one modification, I make footer bar's background color of code block as transparent.
Installation
You can add a HTML/JavaScript gadget to your footer with the code like:<script src="http://yandex.st/highlightjs/6.1/highlight.min.js"></script>
<script>
var hl_style = document.createElement('link');
hl_style.setAttribute('rel', 'stylesheet');
hl_style.setAttribute('type', 'text/css');
hl_style.setAttribute('href', 'http://yandex.st/highlightjs/6.1/styles/zenburn.min.css');
document.getElementsByTagName('head')[0].appendChild(hl_style);
hljs.initHighlightingOnLoad();
</script>
If you have your highlight.pack.js, please replace first line with your location. For CSS, please replace sixth line with your CSS location. If you want my settings, just leave them all.
Usage
Wrap your code like<pre><code>First line of code
Second and ...
</code></pre>
Changelog
- 2012-02-23 - Update links to script and stylesheet, using the Yandex CDN.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.