#!/usr/bin/env python # mimedown - generate multipart text and HTML MIME message from Markdown input. from markdown import Markdown def mimedown(input, output): text = input.read() md = Markdown() html = md.convert(text) html = "%s" % html print >> output, '''<#multipart type=alternative> %s <#part type=text/html> %s <#/multipart> ''' % (text, html) if __name__ == '__main__': import sys mimedown(sys.stdin, sys.stdout)