{"id":13419806,"url":"https://github.com/walle/gimli","last_synced_at":"2025-03-15T05:33:17.912Z","repository":{"id":56874184,"uuid":"1682588","full_name":"walle/gimli","owner":"walle","description":"Utility for converting markup files to pdf files","archived":false,"fork":false,"pushed_at":"2019-02-22T14:37:59.000Z","size":173,"stargazers_count":538,"open_issues_count":24,"forks_count":44,"subscribers_count":8,"default_branch":"development","last_synced_at":"2024-10-19T16:47:41.000Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/walle/gimli","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-29T21:04:35.000Z","updated_at":"2024-09-23T14:23:54.000Z","dependencies_parsed_at":"2022-08-20T22:30:37.164Z","dependency_job_id":null,"html_url":"https://github.com/walle/gimli","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walle%2Fgimli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walle%2Fgimli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walle%2Fgimli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walle%2Fgimli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walle","download_url":"https://codeload.github.com/walle/gimli/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690112,"owners_count":20331726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:21.149Z","updated_at":"2025-03-15T05:33:17.632Z","avatar_url":"https://github.com/walle.png","language":"Ruby","funding_links":[],"categories":["Ruby","RUBY","PDF"],"sub_categories":[],"readme":"# gimli – utility for converting markup to pdf\n\n[![](https://secure.travis-ci.org/walle/gimli.png)](http://travis-ci.org/walle/gimli)\n\n## Description\n\nGimli is a utility for converting markup to pdf files. Useful for reports and such things.\nIt’s a developed version of [textile2pdf](https://github.com/walle/textile2pdf) to support multiple markup styles and to get syntax highlighting.\n\nIt’s inspired by the markup convertion in [gollum](https://github.com/github/gollum). The markup code is adapted from gollum.\nIt works by converting the markup to pdf using [wkhtmltopdf](https://github.com/antialize/wkhtmltopdf)\nThe markup is converted to html using [github/markup](https://github.com/github/markup)\n\n### Markup\n\nMarkup files may be written in any format supported by GitHub-Markup (except roff).\n\n### Images\n\nImages 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.\n\n\u003cpre\u003e\n!/tmp/test.jpg!\n!http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png!\n!../images/test.jpg!\n\u003c/pre\u003e\n\n## Installation\n\nThe best way to install Gimli is with RubyGems:\n\n    $ [sudo] gem install gimli\n\nYou can install from source:\n\n```\n$ cd gimli/\n$ bundle\n$ rake install\n```\n\n### On Windows\n\nIf you want to use gimli on windows you will have to make the following actions.\n\n* Install `wkhtmltopdf` separatly on your OS. Find the package [here](http://wkhtmltopdf.org/downloads.html).\n\u003e Make sure that the path to the `wkhtmltopdf.exe` binary is in your `$PATH` environement variable. Also make sure that it's palced before the path to the ruby directory.\n\n* Install the `which` command of the GnuWin32 on your OS. Find the package [here](http://gnuwin32.sourceforge.net/packages/which.htm).\nThis command allow gimli to locate the correct binary or `wkhtmltopdf` on your hard drive to perform the html-\u003ePDF conversion.\n\u003e Make sure that the path to `which.exe` the binary is in your `$PATH` environement variable\n\n## Running\n\nThe standard way to run gimli is to go to a folder with markup files and running\n\n    $ gimli\n\nTo 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.\n\nStandard 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.\n\nGimli 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 \u0026 Jekyll together on your Blog/Resume/Catalogue to create nicely formatted versions for online and offline viewing.\n\nGimli can add a cover to your document based on another markdown file. To do this use the `-cover` flag. eg.\n\n    $ gimli -f doc-file.md -cover cover-file.md\n\nTo pass parameters directly to wkhtmltopdf, use the `-w` flag. eg.\n\n    $ gimli -f test.md -w '--toc --footer-right \"[page]/[toPage]\"'\n\nThis gives a pdf with a table of contents and page numbers in the footer.\n\nSee the [man page](http://wkhtmltopdf.org/usage/wkhtmltopdf.txt) for wkhtmltopdf for all possible parameters.\n\nRun `gimli -h` for a full list of options available\n\n### Gimli Docker Container\n\nThere is a Docker container to use for converting files using gimli without installing gimli to your computer, you can see more about it at https://registry.hub.docker.com/u/walle/gimli/\n\n#### Running the image\n\n    $ docker run -v \u003chost_dir\u003e:\u003ccontainer_dir\u003e walle/gimli -f \u003ccontainer_dir\u003e/my-file.md -o \u003ccontainer_dir\u003e\n\nWhere `\u003chost_dir\u003e` is the directory with the files you want to convert and `\u003ccontainer_dir\u003e` is the directory in the image where the files will be put. This will write the pdf files to the same directory as where your source files is. If you want to make a new directory for the pdfs you can call the image like this:\n\n    $ docker run -v \u003chost_dir\u003e:\u003ccontainer_dir\u003e walle/gimli -f \u003ccontainer_dir\u003e/my-file.md -o \u003ccontainer_dir\u003e/pdfs\n\nThis will put the pdfs in a folder named pdfs in your `\u003chost_dir\u003e`.\n\n##### A real example\n\n    $ docker run -v /home/walle/gimlidocuments:/tmp/gimli walle/gimli -f /tmp/gimli/my-file.md -o /tmp/gimli\n\nThis will generate a pdf from the file in `/home/walle/gimlidocuments/my-file.md` in the `/home/walle/gimlidocuments` directory.\n\n##### Arguments\n\nAll arguments you supply to running the image will end up in gimli, so for an example you could supply the `-s` flag to use a custom stylesheet. But the stylesheet must be in `\u003chost_dir\u003e` to be readable by gimli.\n\n## Syntax highlighting\n\nIn page files you can get automatic syntax highlighting for a wide range of languages by using the following syntax:\n\n    ```ruby\n      def foo\n        puts 'bar'\n      end\n    ```\n\nThe 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.\n\nIf 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).\n\nThe block must end with three backticks as the first characters on a line.\n\nThe syntax highlightning is powered by [coderay](https://github.com/rubychan/coderay) and is using a [github theme](https://github.com/pie4dan/CodeRay-GitHub-Theme).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalle%2Fgimli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalle%2Fgimli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalle%2Fgimli/lists"}