I've found two main solutions which I find to be helpful, one that uses javascript to highlight code as its presented in your code and another that uses an emacs buffer to translate code from its formatted and highlighted form into HTML source.
SyntaxHighlighter
This is the more convenient of the two methods as you can do it straight from blogger. It involves hosting some code and modifying your blogger template to utilize that code. Then when you post code to blogger you utilize certain codes to provide the syntax highlighting. The sites I found to be most informative were the following:htmlize.el
This method involves the use of emacs but is not limited to the languages supported by SyntaxHighlighter. Since emacs is such a widely used editor I would assume that syntax highlighting is supported for just about every programming language. I have no experience using emacs, but its only been on my radar to try out one day, considering my extensive use of Linux and VI. What better time than now?htmlize.el (follow the link for the source) is an emacs package that "converts the buffer text and the associated decorations to HTML" as quoted by the original author. It was interesting because Steve Yegge described in a blog post of how he attempted to implent such a tool but was later pointed to htmlize by one of the comments on his blog.
3 comments:
I sooo didn't understand that post - too cerebral for me! What I do know is that you'll help me jazz up my bloggity blog in your oodles of spare time, because I'm your Ate.
Please?
Sure Ate, no problem. Seeing as you're probably the only person who reads this randomness
If you don't have ur own hosting...
Don't worry ...
See
http://urenjoy.blogspot.com/2008/10/publish-source-code-in-blogger.html
Post a Comment