Utility for converting markup files to pdf files
Clone or download
Pull request Compare This branch is 149 commits behind walle:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


gimli – utility for converting markup to pdf


Gimli is a utility for converting markup to pdf files. Useful for reports and such things.
It’s a developed version of textile2pdf to support multiple markup styles and to get syntax highlighting.

It’s inspired by the markup convertion in gollum. The markup code is adapted from gollum.
It works by converting the markup to pdf using PDFKit
The markup is converted to html using github/markup

Check out a small presentation here. http://slides.wallgren.me/gimli


Markup files may be written in any format supported by GitHub-Markup (except roff).


The best way to install Gimli is with RubyGems:

$ [sudo] gem install gimli

You can install from source:

$ cd gimli/
$ bundle
$ rake install


The standard way to run gimli is to go to a folder with markup files and running

$ gimli

To apply some style to the pdf or override the standard style add a css file in the directory named gimli.css or use the -s flag to point out another css file.

Standard behavior is for gimli to output the files in the current directory. To override this use the -o flag to point out another output directory. Gimli tries to create it if it doesn’t exist.

Run gimli -h for a full list of options available

Syntax highlighting

In page files you can get automatic syntax highlighting for a wide range of languages by using the following syntax:

If you want to be able to use the syntax highlightning you have to install pygments

Example installation on Ubuntu

$ sudo aptitude install python-setuptools
$ sudo easy_install pygments
  def foo
    puts 'bar'

The block must start with three backticks (as the first characters on the line). After that comes the name of the language that is contained by the block. The language must be one of the short name lexer strings supported by Pygments. See the list of lexers for valid options.

If the block contents are indented two spaces or one tab, then that whitespace will be ignored (this makes the blocks easier to read in plaintext).

The block must end with three backticks as the first characters on a line.