A simple docker image for pandoc with filters, templates, fonts and the latex bazaar.
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 .
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:
- pandoc-codeblock-include: insert an external file into a codeblock
- pandoc-include : insert external markdown files into the main document
- pandoc-latex-admonition : adding admonitions on specific DIVs
- pandoc-latex-environment : adding LaTeX environments on specific DIVs
- pandoc-latex-barcode : insert barcodes and QRcodes in documents
- pandoc-mustache : basic variables substitution
- pandoc-minted : advanced syntax highlighting
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.
You can use 2 different versions of this machine with the following tags:
latest
: this is the default (based onmaster
branch)stable
or17.12
: for production
Other tags are not supported and should be used with care.
Use make
or docker build .
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.
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