Using PanWriter and Pandoc to edit markdown and convert to other formats

I’ve been working on a proposal and of course prefer to write here on Discourse. An added advantage is that I can iterate with help from the AI bot. Discourse lets you edit formatted text using markdown - if you haven’t heard of markdown you might like to head over to this primer to learn more about it and then come back.

Markdown is great for formatting forum posts and even documentation topics, but it’s not so great for collaborating with others or getting their feedback. For that google docs or offline files shared in docx format do a better job. And of course one you’ve completed a long document like a proposal you’ll want to deliver it as a properly paginated PDF attached to an email.

I did some investigating and found PanWriter, an open source program you can install on your own device to edit markdown that doesn’t look very different from the Discourse composer. Looks like this:

That said, there are some markdown elements specific to Discourse that will not work in PanWriter.

The PanWriter feature that stands out is the Import/Export feature.[1]

Import/Export: Word, HTML and plenty of other formats

Simply drag a .docx-file onto the PanWriter app: it will be converted to Markdown and opened so you can edit the text in the distraction-free writing environment of PanWriter. When you’re done, use File -> Export to convert the text back to .docx, or any other of pandoc’s output formats.

Export formats

For hardcore markdown afficionados, PanWriter also lets you add styling to your document for printing and exporting to PDF. Pretty sweet!

Paginated preview for print and PDF

Once you’ve written a first draft of your text, you might want to see how it would look like in print. Instead of exporting, you can simply open the preview pane. A unique feature among markdown editors is that PanWriter actually lays out your text on pages in the preview – suddenly your text becomes tangible, and you can see where pagebreaks end up.

It’s not a good idea to start layouting before you’ve finished the hard work of the first few drafts. But once you’re there, you can apply a pre-defined layout template – or tune the layout yourself by adding a few lines of CSS, the layouting language of the web. Changes are reflected live in the preview.

CSS is reflected live


  1. Pamwriter depends on PanDoc, an open source command line tool that also needs to be installed - it’s easy and once installed you can convert files on the command line as well as interactively using PanWriter ↩︎