markdown for paged documents. Outputs to pdf
Head over the examples folder to see some examples of the built in themes, or check out some templates that I am using at Hyla Soft.
Markdawn generates pdfs from markdown documents and HTML+CSS templates using remarkable markdown generator and node-html-pdf pdf generator behind the scenes.
You can call markdawn from command line. To install:
$ npm install -g markdawn
type markdawn -h
to show a list of options.
you can use markdawn in your node app as well:
var md = require('markdawn');
var options = {};
md.generate('This _is_ my **input**!', options);
the options
object can contain the following properties:
index
: path to the index.html file that defines a themeformat
: (e.g. "Letter", "A4") overrides the format specified in the themeout
: name of output filetheme
: name of a preconfigured theme to use (this property has priority over theindex
property)contentDir
: content directory to take the content source from
Visit https://github.com/itajaja/grunt-markdawn/ for more informations
A theme needs at least two objects (in the same folder). The index.html
defines the layout of the document. The page.json
declares some values to use for the pdf generation (e.g: format).
You can look at the preconfigured themes to get an idea on how to build a theme of your own!
You can also use a preconfigured theme right away! type markdawn --themes
to see the list of available themes and then use the -t
option to use one of these themes.
You can declare multi-markdown style metadata at the top of your markdown file. The metadata will be stripped down, and the values will be injected in the generated file. For example, if your markdown file starts like that:
Title: How to fart silently
Author: Giacomo Tagliabe
and the index.html looks like that:
<div class="title-page">
<div>{{Title}}</div>
<div>{{Author}}</div>
</div>
The generated pdf will show the injected values in the title page. Have a look at the preconfigured themes for additional examples.
- a folder that contains all the static elements. (defaults to running folder?)
- title page
- breakpages
- header + footer
- margins (maybe inside metadata?)
- metadata (title, author, whatever... multimarkdown style)
- themed sections
- multi column (hardly doable :/)
- pdf options
- theme selector
- @page media type
- math functions
- fix link and references