Skip to content
/ Marx Public
forked from rmondello/Marx

Markdown to PDF using WebKit. Replacement for markdown2pdf.

Notifications You must be signed in to change notification settings

bkoltai/Marx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Marx: Markdown & CSS => PDF using WebKit

A convenient way of publishing Markdown and CSS to a PDF using WebKit as the printer. Huge shout-out to Jakob Truelsen and the fine people at wkhtmltopdf for making this possible.

Install

  1. Add Markdown.pl to your PATH.
  2. Add wkhtmltopdf to your PATH.
  3. Add Mark.rb to your PATH.

Use

  • Markdown => html

    Marx.rb in.mdown out.html

  • Markdown => pdf

    Marx.rb in.mdown out.pdf

  • Markdown + CSS => pdf

    Marx.rb in.mdown out.pdf -s style.css

  • Override file extension inference

    Marx.rb in.mdown out -f html

PDF Options

Any arguments that Marx.rb doesn't recognize are passed to wkhtmltopdf. To see all of the options wkhtmltopdf supports, run:

wkhtmltopdf -H

For convenience, here are some useful ones:

-g, --grayscale                  PDF will be generated in grayscale
-l, --lowquality                 Generates lower quality pdf/ps. Useful to
                                 shrink the result document space
-O, --orientation <orientation>  Set orientation to Landscape or Portrait
                                 (default Portrait)
-s, --page-size <Size>           Set paper size to: A4, Letter, etc.
--title <text>                   The title of the generated pdf file (The
                                 title of the first document is used if not
                                 specified)
-B, --margin-bottom <unitreal>   Set the page bottom margin (default 10mm)
-L, --margin-left <unitreal>     Set the page left margin (default 10mm)
-R, --margin-right <unitreal>    Set the page right margin (default 10mm)
-T, --margin-top <unitreal>      Set the page top margin (default 10mm)
--background                     Do print background (default)
--no-background                  Do not print background
--images                         Do load or print images (default)
--no-images                      Do not load or print images
--zoom <float>                   Use this zoom factor (default 1)

About

Markdown to PDF using WebKit. Replacement for markdown2pdf.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%