/pandocker

🐳 A simple docker image for pandoc with filters, fonts, and the latex bazaar

Primary LanguageShellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

pandocker

github release Docker Image CI License Last Commit

A simple docker image for pandoc with filters, templates, fonts and the latex bazaar.

How To

Run dalibo/pandocker with regular pandoc args. Mount your files at /pandoc.

$ docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker README.md

Tip: use a shell alias to use pandocker just like pandoc. Add this to your ~/.bashrc :

$ alias pandoc="docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker"
$ pandoc document.md

Note: if SELinux is enabled on your system, you might need to add the --privileged tag to force access to the mouting points. See https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities .

Filters

This image embeds a number of usefull pandoc filters. You can simply enable them by adding the option --filter xxx where xxx is the name of one of the following filter below:

NOTE: By default when using the pandoc-include filter, the path to target files is relative to the /pandoc mountpoint. For instance, the !include [foo/bar.md] statement will look for a /pandoc/foo/bar.md file. You can use the docker arg --workdir="some/place/elsewhere" to specify another location.

Supported Tags

You can use 2 different versions of this machine with the following tags:

  • latest : this is the default (based on master branch)
  • stable or 17.12 : for production

Other tags are not supported and should be used with care.

Build it

Use make or docker build .

Embedded template : Eisvogel

We're shipping a latex template inside the image so that you can produce a nice PDF without installing anything. The template is called eisvogel and you can use it simply by adding --template=eisvogel to your compilation lines:

$ docker run [...] --pdf-engine=xelatex --template=eisvogel foo.md -o foo.pdf

Warning: you need to remove the -u option when using eisvogel.

Additional tools

The docker image embeds additional software related to editing and publishing:

  • dia a simple tool to design diagrams
  • poppler-utils a collection of tools built to manage PDF and extract content
  • rsync for deployment

These tools can be used by modifying the entrypoint of the image. For instance, you can convert a dia source file into an SVG image like this:

$ docker run [..] --entrypoint dia dalibo/pandocker foo.dia -e foo.svg