Giter Site home page Giter Site logo

gimli's Introduction

gimli – utility for converting markup to pdf

Description

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 wkhtmltopdf
The markup is converted to html using github/markup

Markup

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

Images

Images can be included by absolute url on your hard drive or a absolute url on the Internet. You can also refer to an image relative from the markup file. Example in textile.

!/tmp/test.jpg!
!http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png!
!../images/test.jpg!

Installation

The best way to install Gimli is with RubyGems:

$ [sudo] gem install gimli

You can install from source:

$ cd gimli/
$ bundle
$ rake install

Running

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.

Gimli also plays nice with Jekyll style markup files. You can pass gimli the -y flag to have it remove Jekyll’s YAML front matter from the top of your markup files. Allowing you to use gimli & Jekyll together on your Blog/Resume/Catalogue to create nicely formatted versions for online and offline viewing.

To pass parameters directly to wkhtmltopdf, use the -w flag. eg.

$ gimli -f test.md -w '--toc --footer-right "[page]/[toPage]"'

This gives a pdf with a table of contents and page numbers in the footer.

See the man page for wkhtmltopdf for all possible parameters.

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:

```ruby
  def foo
    puts 'bar'
  end
```

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 coderay. 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.

The syntax highlightning is powered by coderay and is using a github theme.

gimli's People

Contributors

walle avatar nicknovitski avatar svendahlstrand avatar clowder avatar zbelzer avatar ebeigarts avatar paynerc avatar

Watchers

James Cloos avatar 杨小福 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.