Formatting code for the blog

In case people were wondering how the code I’ve been posting has been formatted, here’s the procedure.

This blog is running on a WordPress installation.  I’ve installed the “Raw HTML” plugin.  This allows me to insert HTML directly into postings by surrounding them with “[raw]” and “[/raw]” in the text input mode.

I program in emacs, so I just needed an emacs package to convert the buffer to HTML.  I started out trying to use the built-in htmlfontify-buffer function, but it produced HTML with CSS elements that affected the rest of the page.  So, after looking around a bit, I settled on htmlize, which is available at this location.

So, load the code to be rendered, load the htmlize library, and run htmlize-buffer.  This creates a new buffer holding the HTML version of the displayed text, ready to be copied into the blogging software.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

反垃圾邮件 / Anti-spam question * Time limit is exhausted. Please reload CAPTCHA.