My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

syntaxhighlight-blogger-dynamic (sbd)

sbd enables Blogger dynamic view users (like mine) to use Alex Gorbatchev's SyntaxHighlighter. It's based on the work done by they guys at Crux Framework. But I've made it more useful (at least to me).

To use sbd, add class="brush:style" attributes to your <pre> tags surrounding your code and add this line to the bottom of all of your blog entries that need syntax highlighting:

<script src='http://syntaxhighlight-blogger-dynamic.googlecode.com/files/syntaxhighlighter-20111212.js' type='text/javascript'></script>

Note: I'm giving up on using git tags to server up files -- it makes the blog very slow when compared to the /files/ section. I'm also experimenting with using a raw file right out of a git tag. This would be cool because you wouldn't have a versioning problem in your /files/ -- you would just create a tag and let people point directly to the raw files within it. The problem is the raw files are not crated right away -- it seems like there must be a process at google that takes tens of minutes to catch up. This makes debugging difficult.

Here's the line you need at the bottom of the blog post how to use my tagged version.

<script src='http://syntaxhighlight-blogger-dynamic.googlecode.com/git-history/hackaroid/out/highlightloader.js' type='text/javascript'></script>

This version of SyntaxHighlighter is precompiled to use these brushes: Bash Cpp Css Diff Java JScript Plain Python Sql Xml. Of course, there are many more available. If this set doesn't work for you, then best bet is to clone the project and rebuild. There's a make file that does almost all of the work for you.

Once you've cloned the code onto your Ubuntu box:

  • make # by itself will show a helpful menu of make targets
  • make get-external # will get all of the external dependencies and build them.
  • make BASEURL=http://URL/to/your/js BRUSHES="List Of Brushes Space Separated" clean output # will build the out directory.

Powered by Google Project Hosting