Skip to content

About

Render Pandoc-fenced-div Markdown lessons to print-quality PDF via pandoc + tectonic.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

lesson-press

Render Pandoc-fenced-div Markdown lessons to print-quality PDF.

lesson-press is the source-of-truth renderer for curriculum authored in Markdown with Pandoc fenced divs (::: name … :::). It produces lesson packets via Pandoc + tectonic using a bundled LaTeX template and Lua filter. The same assets are designed to be embedded in other consumers (e.g., a Laravel app rendering on demand) so a lesson written once renders identically everywhere.

A lesson rendered by lesson-press

Status

v0.1.0 — the CLI, asset pipeline, and three goldens (hello, all-classes, image-sidecar) are stable. Multi-file packet composition and theme overrides are not built yet.

Requirements

  • Node ≥ 20
  • pandoc ≥ 3.1 on PATH
  • tectonic ≥ 0.15 on PATH
  • pdftotext (poppler) — only needed if running the test suite

macOS install:

brew install pandoc tectonic poppler

Install

From a clone (current path — package is not yet published to npm):

git clone https://github.com/gig3m/lesson-press.git
cd lesson-press
npm install
npm run build
npm link    # makes `lesson-press` callable globally

Once published:

npm install -g lesson-press

Usage

lesson-press doctor
lesson-press render lesson.md -o lesson.pdf
lesson-press render - -o lesson.pdf < lesson.md
lesson-press render lessons/*.md --separate -o out/

Authoring

See docs/contract.md for the input contract. docs/examples/lesson-1.md is a complete worked example exercising every major block class.

Embedding

The assets/ directory (Lua filter + LaTeX template) is the same in every consumer. To embed lesson-press in another application, point its renderer at this directory:

assets/
├── filters/fenced-divs.lua
└── template.latex

The CLI's --asset-dir flag overrides the bundled location for development.

Design

One renderer, many hosts: the Lua filter (assets/filters/) and LaTeX template (assets/) are the source of truth, and the CLI is a thin wrapper around pandoc + tectonic that applies them. Anything that can shell out to pandoc can reuse the same assets and render the same layout. The input format is pinned down in docs/contract.md.

License

MIT — see LICENSE.

About

Render Pandoc-fenced-div Markdown lessons to print-quality PDF via pandoc + tectonic.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages