Tuesday, February 10, 2009

Source Code in blog ... again

A few posts after I outlined how to post source code in Blogger, it stopped working. Syntaxhighlighter released a new version and I don't really have time to figure out how to get it to work again.

I found a post that outlines how to use VIM to export the code and highlighting to html. After adding the CSS to the Blogger template produces the result below which I am much happier with.

public class HelloWorld()
public static void main(String [] args) {
System.out.println("hello world!");
}
}

VIM command:
:runtime syntax/2html.vim

Add to $HOME/.vimrc
syntax on
" Conversion HTML (:help 2html.vim)

let g:html_use_css = 1
let g:html_use_encoding = "utf8"
let g:use_xhtml = 1

No comments:

Post a Comment