From 0a278b0aba3b524262f3e6b56c430ea5d6072faf Mon Sep 17 00:00:00 2001 From: damien clochard Date: Fri, 3 Feb 2023 22:00:18 +0100 Subject: [PATCH] [doc] How to use the pandoc/extra docker image (#319) * Add documentation in the README on how to use the `pandoc/extra` docker image --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 6d5b269..577706d 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,36 @@ A clean **pandoc LaTeX template** to convert your markdown files to PDF or LaTeX If there are no folders called `templates` or `pandoc` you need to create them and put the template `eisvogel.latex` inside. You can find the default user data directory on your system by looking at the output of `pandoc --version`. + +### Docker image + +Alternatively, if you don't want to install LaTeX, you can use the Docker +image named [pandoc/extra]. The image contains pandoc, LaTeX and a curated +selection of components such as the eisvogel template, pandoc filters and +open source fonts. A common use of the image looks like this +(line breaks for readability): + +``` bash +docker run --rm \ + --volume "$(pwd):/data" \ + --user $(id -u):$(id -g) \ + pandoc/extra example.md -o example.pdf --template eisvogel --listings +``` + +For frequent command line use, you can define the following shell alias: + +``` bash +alias pandock='docker run --rm -v "$(pwd):/data" -u $(id -u):$(id -g) pandoc/extra' +``` + +The example invocation with Docker from above now looks like this: + +``` bash +pandock example.md -o example.pdf --template eisvogel --listings +``` + +[pandoc/extra]: https://hub.docker.com/r/pandoc/extra + ## Usage 1. Open the terminal and navigate to the folder where your markdown file is located.