Convert a document to Markdown