8000 GitHub - jzer7/pandoc-plus: container image with pandoc, pdf-latex, and tooling to automate generation of PDF files
[go: up one dir, main page]

Skip to content

container image with pandoc, pdf-latex, and tooling to automate generation of PDF files

Notifications You must be signed in to change notification settings

jzer7/pandoc-plus

Repository files navigation

Pandoc/LaTeX container image

Build, Test, and Publish

This image simplifies the process of generating PDF documents from Markdown using Pandoc with LaTeX.

It starts with the official pandoc/latex:ubuntu image, and adds a few additional LaTeX packages to produce better-formatted documents. The image also includes tools so it can be used in document pipelines.

Features

  • additional LaTeX styles and packages
  • simple tools (make, wget, and unzip)
  • run as a non-root user
  • CI/CD automated tests, builds, and publishing to GitHub Container Registry

Usage

The entrypoint of the image is set to pandoc. So it's usage is similar to running the pandoc command directly on a Linux host.

pandoc document.md -o document.pdf

To use a pre-built version of the Docker image, run:

docker run --rm \
           --volume "`pwd`:/data" \
           --user `id -u`:`id -g` \
           ghcr.io/jzer7/pandoc-plus:main \
           document.md -o document.pdf

Or use a locally built version of the image:

docker run --rm \
           --volume "`pwd`:/data" \
           --user `id -u`:`id -g` \
           jzer7/pandoc-plus:latest \
           document.md -o document.pdf

Development

Configuration

All project configuration is centralized in image.cfg. This file is the single source of truth for all build parameters:

  • Image names and registry settings
  • LaTeX and system packages to install
  • Platform targets for multi-arch builds
  • Build optimization flags

The build system will fail immediately if image.cfg is missing or if any required configuration values are not set.

Build image

The Makefile includes a target to build the image locally:

make image

To customize the build, edit image.cfg directly:

# Edit configuration
vim image.cfg

# Build with your changes
make image

Available targets

View all available Makefile targets:

make help

Essential targets:

  • make image - Build the Docker image
  • make test-all - Run all tests (container + conversion)
  • make show-config - Display current configuration
  • make clean - Clean up test artifacts and build cache

Debugging the container

The image entrypoint is set to pandoc. So any command you pass to docker run will be executed as arguments to pandoc. To debug issues, you might want to bypass the entrypoint and start an interactive shell.

docker run --rm -it \
           --volume "`pwd`:/data" \
           --user `id -u`:`id -g` \
           --entrypoint "" \
           jzer7/pandoc-plus /bin/bash

Container Registry

Automated Builds

Container images are automatically built and published to GitHub Container Registry. Look at .github/workflows/build-test-publish.yml for details.

The path to the image is ghcr.io/jzer7/pandoc-plus:TAG. Where TAG can be:

  • main: latest image built from main branch
  • sha-<commit>: specific commit
  • vX.Y.Z: release versions (when tagged)

About

container image with pandoc, pdf-latex, and tooling to automate generation of PDF files

Topics

Resources

Stars

Watchers

Forks

0