htmlize.el by HrvojeNiksic? is a package for exporting the contents of an Emacs buffer to HTML while respecting display properties such as colors, fonts, underlining, invisibility, etc. Get it from,
The conversion is quite sophisticated, it understands non-ascii characters, looks up colours in the X11 RGB database, and can generate either
css or old style
Its typical usage is to export fontified (syntax-highlighted) source code as HTML, but it can be used for any Emacs buffer, such as Gnus or
org-mode buffers. The resulting HTML can be used by other tools, published on the web, printing, etc.
The following packages use or extend
See also HtmlFontify which does similar things (and hopefully will be included in Emacs soon). However, HtmlFontify appears not to support converting a region which is really practical for publishing small snippets on blogs.
Converting a region is supported in hfyview.el (which uses htmlfontify.el).
You can use this package to render code snippets with syntax highlighting when exporting Org-mode files to HTML. http://orgmode.org/, see manual “Literal Examples”, 6.26 d, Chapter 12, p. 102, footnote1. – StefanVollmar
See also htmlize.sh by Volkan YAZICI which is a small shell script wrapped around htmlize.el with some syntax highligting enhancements for particular emacs modes. Moreover, htmlize.sh has an extensible syntax recognition enhancement module that you can introduce new functionalities relatively easily; e.g., it provides CLHS and MOP symbol linking capabities for lisp-mode. (See README file for details.)