It turns out that creating syntax highlighted source in blogger is not difficult even if it's not convenient
The first step is to find an application that can syntax highlight and convert your code to HTML. I choose to hack together a quick little script on top of the Syntax library (the code's below)
Depending on on your formatter you may need to add it's CSS to your Blogger template.
The first step is to find an application that can syntax highlight and convert your code to HTML. I choose to hack together a quick little script on top of the Syntax library (the code's below)
require 'rubygems'Now when ever you want to make a post just choose 'Edit Html' in the composer and insert the output from your formatter application.
require 'syntax/convertors/html'
convertor = Syntax::Convertors::HTML.for_syntax "ruby"
puts convertor.convert(File.read(ARGV[0]))
Depending on on your formatter you may need to add it's CSS to your Blogger template.
1 comment:
Hi,
you may also be interested in this post I've made on my blog. It's some kind of generic syntax highlighting which works quite well.
Post a Comment