Markdown and Get PDF'd Up

I really dig Markdown. It provides rich formatting with minimal markup so I can focus on writing instead of </p> and </a> tags. The thing is, while it looks good online, Markdown isn’t print-ready out of the box. That’s why you need the markdown-pdf node module from Alan Shaw.

Markdown-pdf parses input files, converts them to HTML, and generates PDFs using phantom.js. It’s got a good API & pairs well with gulp/grunt, but for one-off applications the CLI is a snap. Download the demo input and output files and try it out for yourself:

```sh # install globally so you can use the command line interface npm install -g markdown-pdf

convert to a letter-sized landscape PDF

markdown-pdf -f letter -r landscape ```

N.B. I recognize that LaTeX was designed almost specifically for the purpose of print & precision typesetting - but unless you’re writing a scientific paper / calculus textbook, it’s overkill.

Join the discussion

2017 Neal Shyam