Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Convert (multi)markdown documents to PDF through webkit
CSS Shell
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
MultiMarkdown @ ef1038d
wkpdf @ dc3c2b3
.gitmodules First working version
README.md
adc.css
createApp.sh
document-ss.css
document.css
markdown2pdf.sh
sample-document.md

README.md

Convert Markdown documents to PDF

Update 2014-01-07: wkpdf breaks under Mavericks. It is an essential part of this script/app and Markdown2PDF therefore does not work anymore. I am not able to fix it. Consider alternatives such as Marked

The script (markdown2pdf.sh) calls Multimarkdown to convert from Markdown to HTML. Then the HTML is rendered into a PDF through webkit by wkpdf. It uses a default CSS which resembles the one used on Apple Developer Documentation, but if a css style is specified in the document using the multimarkdown syntax, the script honors it instead.

The script is packaged into a droppable application with platypus.

Installation

Get the code

git clone git://github.com/jiho/Markdown2pdf.git
cd Markdown2pdf
git submodule init
git submodule update

If you live in a country not using A4 as the default paper size, open markdown2pdf.sh and change the default (to letter for example). It is set in the first lines of the script.

Install platypus.

Open Platypus' preferences and install the command line tool.

Install wkpdf dependencies

sudo gem install jeweler
sudo gem install trollop

and RubyCocoa.

Create the app (which will be put on your desktop)

./createApp.sh

Move the app wherever you want.

Finally, I recommend adding it to your Finder's title bar for easy drag and drop access.

Update

cd Markdown2pdf
git pull
git submodule update

./createApp.sh

Usage

Just drag and drop documents with extension md, markdown, txt, text, or mdown on the application. The resulting PDF should appear next to the markdown document.

Beware, if a PDF exists already, it will be silently overwritten

(c) Copyright 2011-2014 JiHO GNU General Public License v3

Something went wrong with that request. Please try again.