I have written a small markdown exporter that improves over the default one for publication with
http://leanpub.com. In particular, it separates code from its output, and it handles footnotes properly. It's a very limited one-morning hack, but I thought it might be of interest to others:
(I am writing a book with lots of code samples and their output. Exporting for the web was simple: