Hacker News new | ask | show | jobs
by tikhonj 5206 days ago
This is an awesome feature. Naturally, Emacs also supports this, right out of the box. Just use M-x htmlfontify-buffer.

Here's a sample of the output: http://inst.eecs.berkeley.edu/~tikhon/Interpreter.hs.html

EDIT: Also, note that while the VIM one uses a bunch of <font color="..."> tags, the Emacs one uses a bunch of span tags with reasonable class names like "function-name" or "string", so it produces much nicer code and is easy to use with your own CSS.

2 comments

VIM too can be told use span tags and css rather than lots of messy font tags, relevant .vimrc goodness:

let html_use_css=1

let use_xhtml = 1

M-x htmlize-buffer
Hmm, on mine (GNU Emacs 23.3.1 on Fedora) it's M-x htmlfontify-buffer. It came with the Emacs distribution as standard. I suspect htmlize-buffer is either from some external package or from a different version of Emacs.
It's from an external package called htmlize http://www.emacswiki.org/emacs/Htmlize