Sign inSign up

schoolcraft/pandocker

By schoolcraft

Updated almost 5 years ago

Pandoc auto convert to pdf with npm-watch as entrypoint

Image
0

390

schoolcraft/pandocker repository overview

schoolcraft/pandocker

This image is a fork of dalibo/pandocker modified to auto convert index.md file mounted on host.

npm-watch as default entrypoint

The default entrypoint runs file watcher and auto-converts to pdf on $(pwd)/data/index.md file change.

docker run
docker run \
    -it \
    -u `id -u`:`id -g` \
    --mount type=bind,src=`pwd`,dst=/app/data \
    schoolcraft/pandocker
docker-compose
version: '3'
services:
  pandocker:
    image: schoolcraft/pandocker
    volumes:
      
      # mount data dir which contains index.md file
      - './data:/app/data'
      
      # optionally mount resources
      - './resources:/app/resources'
docker-compose up

pandoc as entrypoint

The container can also be used in headless mode without the watcher. Call pandoc directly with the command below:

generate pdf with template eisvogel
docker run \
    --rm \
    -u `id -u`:`id -g` \
    -v `pwd`:/pandoc \
    -w /pandoc \
    --entrypoint pandoc \
    schoolcraft/pandocker \
    README.md -o README.pdf \
    --number-sections \
    --listings \
    --citeproc \
    --pdf-engine=xelatex \
    --template=eisvogel
generate pdf with standard template
docker run \
    --rm \
    -u `id -u`:`id -g` \
    -v `pwd`:/pandoc \
    -w /pandoc \
    --entrypoint pandoc \
    schoolcraft/pandocker \
    README.md -o README.pdf \
    --number-sections \
    --listings \
    --citeproc \
    --pdf-engine=xelatex
generate pdf with template letter
docker run \
    --rm \
    -u `id -u`:`id -g` \
    -v `pwd`:/pandoc \
    -w /pandoc \
    --entrypoint pandoc \
    schoolcraft/pandocker \
    README.md -o README.pdf \
    --number-sections \
    --listings \
    --citeproc \
    --pdf-engine=xelatex \
    --template=letter

Tag summary

Content type

Image

Digest

Size

707.7 MB

Last updated

almost 5 years ago

docker pull schoolcraft/pandocker