Building HTML from markdown in Python