I’ve noticed that the wmd editor can either output HTML or markdown. Does it make more sense to store the user input (in a database) as markdown or HTML? If as markdown, what is the best way to display it on a webpage later on (any examples would be greatly appreciated).
Given that the recommendation is store it as markdown, are there any standard converters / stylesheets / anything else to actually display it afterwards?
I would say it’s easier to store the markdown in the database, and process it into HTML when you display it.
You could store the input as HTML, then when the user wants to edit it, use something like markdownify to convert it back to markdown – but you don’t really gain anything, and lose a lot (the original markdown formatting, for one). It’s also rather round-a-bout (you convert the markdown to HTML, store it. Then convert the HTML to markdown, allow the user to edit it, convert it back to HTML, and store that..)
If you are worried about performance of parsing markdown on every page-view: cache the output HTML somewhere temporary (in memory, or on disc). The HTML is easier to recreate than the source markdown