The usage of the dokerized pandoc is equal to the pandoc-CLI, just prepend it with a
docker run novarx/pandoc
with the according volume mapping to /data
like below:
docker run \
-v "$(pwd):/data" \
novarx/pandoc \
./02_part1.md \
-o converted.pdf \
--latex-engine=xelatex
or for bash on a Windows machine (like GitBash):
docker run \
-v "$(pwd -W):/data" \
novarx/pandoc \
./02_part1.md \
-o converted.pdf \
--latex-engine=xelatex
The /data
directory in the container will be the working directory, so i.e. *.md
resp. ./*.md
in the command
will convert every .md File in the mapped volume.
To use the image more like the Pandoc-Command it's recommended to add an alias. So it's easier to run a command. In example the command from above could look as somple as this:
pandocker "./02_part1.md" -o converted.pdf --latex-engine=xelatex
On Windows add following to the ~/.bashrc
file in the User-Directory when you use GitBash:
alias pandocker='docker run --rm -v "$(pwd -W):/data" novarx/pandoc '
On Linux you can edit the same File (~/.bashrc
), but add the pwd
command without the -W
Flag:
alias pandocker='docker run --rm -v "$(pwd):/data" novarx/pandoc '
Of course, instead of pandocker
you could use whatever you want, like pandoc
itself or pan
.