[![RubyGems][gem_version_badge]][ruby_gems]
Convert things to PDF. This is a quick and dirty collection of scripts I have grown accustomed to coupled with an inherent lazyness to enter tedious commands. Remember: it is dirty by design.
Currently supports:
- Markdown
- HTML
(Ok, it is currently not really Any2Pdf yet... The motivation is clear.)
It uses available tools to do so, it just glues them together.
- Ruby
- Pandoc
- wkhtmltopdf
- fonts
- Google Web Fonts: OpenSans
- monospace fonts
- Consolas (the preferred monospace font)
- Droid Sans Mono (alternative; part of Google Web Fonts)
- DejaVu Sans Mono (another alternative for monospace)
1. Install requirements
Eg for Ubuntu:
# in case you don't have ruby:
apt-get install ruby1.9.3
# and any other applications
apt-get install pandoc wkhtmltopdfEg for Arch Linux: Get pandoc from haskell-core. It requires in your pacman.conf:
[haskell-core]
Server = http://xsounds.org/~haskell/core/$arch
Eg. for mac
Download the wkhtmltopdf tool from http://wkhtmltopdf.org/downloads.html. Do not use any gems to install wkhtmltopdf because this leads to strange rendering issues.
Then you can:
```bash
pacman -S ruby haskell-pandoc wkhtmltopdf
2. Install this app
gem install any2pdfRead the help
any2pdf --helpTry it
any2pdf test.mdView test.pdf. View test.html.
Try styles:
# have mystyle.css in your folder
any2pdf test.md -s mystyle.cssTry global styles:
any2pdf test.md -s blueThis is for the very lazy (like me). Put your own styles into the installed gem folder under data/, eg:
cd ~/.gem/ruby/1.9.1/gems/any2pdf-1.0.0/data/
ls
touch mysexystyle.cssAnd now you can use it with either:
any2pdf test.md -s mysexystyle.cssOr just:
any2pdf test.md -s mysexystyleYou can also replace default.css if you like. It's called if you don't use the -s option, eg:
any2pdf test.mdAuthor: Dominik Richter [email protected]
License: see LICENSE file