npm

markdown-pdf

markdown-pdf

Node module that converts Markdown files to PDFs.

The PDF looks great because it is styled by HTML5 Boilerplate. What? - Yes! Your Markdown is first converted to HTML, then pushed into the HTML5 Boilerplate index.html. Phantomjs renders the page and saves it to a PDF. You can even customise the style of the PDF by passing an optional path to your CSS and you can pre-process your markdown file before it is converted to a PDF by passing in a pre-processing function, for templating.

API

from.path(path, opts) / from(path, opts)

Create a readable stream from path and pipe to markdown-pdf. path can be a single path or array of paths.

from.string(string)

Create a readable stream from string and pipe to markdown-pdf. string can be a single string or array of strings.

concat.from.paths(paths, opts)

Create and concatenate readable streams from paths and pipe to markdown-pdf.

concat.from.strings(strings, opts)

Create and concatenate readable streams from strings and pipe to markdown-pdf.

to.path(path, cb) / to(path, cb)

Create a writeable stream to path and pipe output from markdown-pdf to it. path can be a single path, or array of output paths if you specified an array of inputs. The callback function cb will be invoked when data has finished being written.

to.buffer(opts, cb)

Create a concat-stream and pipe output from markdown-pdf to it. The callback function cb will be invoked when the buffer has been created.

to.string(opts, cb)

Create a concat-stream and pipe output from markdown-pdf to it. The callback function cb will be invoked when the string has been created.