Musings by @thedevel

Marky: The Markdown Previewer

264 words · 04 Sep 2012

Alternate markup languages to HTML have become increasingly more prolific due to their simplicity and readability. Among the crew, John Gruber's Markdown syntax has arguably become the de facto for most blog engines, commenting systems and many things in between.

When I am not writing up a GitHub issue or comment, I get frustrated not having an easy to preview my Markdown before I make use of it. So I wrote Marky which is live previewer.

It is implemented as a Django app here: https://github.com/bruth/marky

It supports a few extensions such as:

  • Table of Contents (though a bit buggy)
  • Superscript and subscript text
  • Pygments highlighting
  • Footnotes
  • Abbreviations
  • Autolinks
  • Real newline breaks
  • .. and few other

Check out the current list of extensions here.

Most of the extensions are built-in to the Python Markdown implementation with a few additions.

Future

Some additional ideas I have thought about:

  • Support exporting a zip/tarball of the HTML and CSS for quick one-off editing
  • Support cross-origin requests for JavaScript client library integration
    • Refactoring the current JavaScript client code as a standalone script for a drop-in previewer
    • Better mobile support (media queries are currently being used, but the scrolling is a bit flaky)
    • Drop-and-drop of a Markdown document from the OS which loads the contents in the browser
    • Smart preview scrolling based on the location of the last edit

Tickets for these ideas and others have been created. Feel free provide your opinion and open new tickets for your own ideas (or issues).