Build art-directed cookbooks (PDF + EPUB) from markdown recipes.
Project description
ladle
Build a beautiful cookbook — an art-directed PDF and a validated, reflowable EPUB — from a folder of markdown recipes.
Recipes are plain markdown files with a little YAML front matter. ladle turns
the whole collection into a print-ready PDF (via WeasyPrint) and an
epubcheck-clean EPUB (via pandoc), driven by one book.yaml and a swappable
theme for the look. The design (fonts, palette, layout) is fully decoupled
from the content, so the same recipes can render under any theme, and any book
can bring its own.
A full worked example — 11 recipes, stories, illustrations, the works — lives in
examples/community-cookbook/. That is the book this tool grew out of; it now ships as the reference example.
Install
pip install ladlebook # the PyPI package; the command it installs is `ladle`
ladle is Python plus two small command-line tools (one runtime, no browser,
no Node):
| Tool | Version | Used for |
|---|---|---|
| Python | 3.11+ | the tool itself |
| pandoc | 3.x | EPUB generation |
| poppler | any recent | pdfinfo + pdftoppm (PDF checks, EPUB cover) |
| Java | 17+ | optional — only to run epubcheck in ladle validate |
WeasyPrint (a dependency) needs the Pango/cairo system libraries:
- macOS:
brew install pango poppler pandoc - Debian/Ubuntu:
sudo apt-get install libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf-2.0-0 poppler-utils pandoc
Run ladle doctor to check everything is present, with per-OS install hints.
Quickstart
ladle new mybook # scaffold books/mybook/ (book.yaml + a draft recipe)
cd books/mybook
# …add your recipes under recipes/…
ladle build # -> build/cookbook.pdf and build/cookbook.epub
ladle validate # schema + PDF structure + epubcheck + contact sheet
open build/contact-sheet.png
Book-scoped commands take --book PATH (default: $BOOK_CONFIG or
./book.yaml), so you can keep several books side by side and build any of them.
Commands
| Command | Does |
|---|---|
ladle new [--name X] |
scaffold a new book under books/X/ |
ladle build |
build PDF + EPUB (html → pdf → epub) |
ladle html / pdf / epub |
run a single stage |
ladle validate |
recipe schema, PDF trim + page count, epubcheck, contact sheet |
ladle illustrations |
(re)generate the SVG placeholder art |
ladle assets [--theme DIR] |
re-bake a theme's raster brand assets (paper grain, patterns) |
ladle doctor |
check pandoc/poppler/WeasyPrint/Java are installed |
A book
mybook/
book.yaml # title, language, theme, palette/font overrides, section order
recipes/*.md # one recipe per file (front matter + body)
content/introduction.md
assets/illustrations/recipes/* # generated per-recipe art (real art drops in as PNG)
book.yaml needs only a title to build — everything else (palette, fonts,
labels) falls back to the theme's defaults. Point theme: at a bundled theme by
name (default) or at your own theme directory.
Recipe format
---
title: Carrot Cake
category: Desserts # Savory | Desserts | Beverages
servings: "6 people" # optional — omit when the source gives no quantity
credits: "Marine Gora, Café Gramme, Paris" # optional — omit when there's no named source
illustration: assets/illustrations/recipes/carrot-cake.svg
# optional: page, story, author:{name,org}, headshot, attribution, tags, license, draft
---
## INGREDIENTS
### Cake # optional group headings
- 2 large eggs
- 200g sugar
## DIRECTIONS
1. Pre-heat the oven to 180°C.
2. …
## NOTES # optional
- Keeps for several days.
A recipe with a non-empty story: gets a full story page (with optional
headshot); without one it gets a compact opener. Every recipe is validated
against src/ladle/schema/recipe.schema.json.
Section headings (## INGREDIENTS etc.) and all UI chrome ("Yields",
"Contents", section names) are localizable per book via a labels: block in
book.yaml — see the example book for a template.
Themes
The look is a theme: a self-contained bundle of theme.yaml (palette,
fonts, font files) plus templates/, css/, fonts/, and
illustrations/patterns/. The tool ships one theme, default. To restyle,
override tokens in book.yaml, or fork the theme and point theme: at it. See
docs/THEMING.md.
Illustrations
Each recipe ships with an on-brand SVG placeholder (ladle illustrations),
so builds are always green. To add real artwork, generate it in any image model
using the theme's locked style and save it as
assets/illustrations/recipes/<slug>.png (transparent PNG) next to the
placeholder — the build prefers the raster automatically, no front-matter change.
Developing the tool (from a checkout)
git clone https://github.com/dimitri-kandassamy/ladle && cd ladle
pip install -e . # or: pip install -r requirements.txt
make all # builds the example book (examples/community-cookbook)
make validate
make drives the package straight from src/ (no install needed):
make all BOOK=path/to/book.yaml builds any book. The Makefile targets mirror
the CLI commands. CI (.github/workflows/build.yml) builds + validates the
example book and a torture-test fixture on every push.
Credits & thanks
- Inspiration — the Cloud Native Community Cookbook, originated by Equinix Metal.
- Type (default theme) — Playfair Display and Bitter, both under the SIL Open Font License.
- Tooling — WeasyPrint (PDF), pandoc (EPUB), poppler, epubcheck, plus Jinja, PyYAML, jsonschema, and Pillow.
Licensing
- Code (the tool, themes, CSS, templates): Apache-2.0 — see
LICENSE-CODE. - Content (the example book's recipes, stories, illustrations): CC BY-SA 4.0
— see
LICENSE-CONTENT, unless a recipe'slicense:says otherwise.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ladlebook-0.1.0.tar.gz.
File metadata
- Download URL: ladlebook-0.1.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ead3b2afcac9e164d4de5e53531ec404a36230f0f8ee2f10f3118feb8682d0d
|
|
| MD5 |
85374a1de5fb7475ae44acfbdebee987
|
|
| BLAKE2b-256 |
94419c19f3c561541e7874d3cbfc66cc406bc3d58b047f4a86ea1fc46bd09c46
|
Provenance
The following attestation bundles were made for ladlebook-0.1.0.tar.gz:
Publisher:
build.yml on dimitri-kandassamy/ladle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ladlebook-0.1.0.tar.gz -
Subject digest:
2ead3b2afcac9e164d4de5e53531ec404a36230f0f8ee2f10f3118feb8682d0d - Sigstore transparency entry: 2082387770
- Sigstore integration time:
-
Permalink:
dimitri-kandassamy/ladle@4e655abe78badffc9941001bb7085454e5e6a881 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dimitri-kandassamy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@4e655abe78badffc9941001bb7085454e5e6a881 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ladlebook-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ladlebook-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a25d60e927572f10b677d83f735c843f8505f467504e1b52b176a9c17c4e983b
|
|
| MD5 |
034b180b735a49727500386596e0a9e3
|
|
| BLAKE2b-256 |
e746cd49046f26e24fbc3635d6bc424aa138f3b9058950c9490078646149d61e
|
Provenance
The following attestation bundles were made for ladlebook-0.1.0-py3-none-any.whl:
Publisher:
build.yml on dimitri-kandassamy/ladle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ladlebook-0.1.0-py3-none-any.whl -
Subject digest:
a25d60e927572f10b677d83f735c843f8505f467504e1b52b176a9c17c4e983b - Sigstore transparency entry: 2082387958
- Sigstore integration time:
-
Permalink:
dimitri-kandassamy/ladle@4e655abe78badffc9941001bb7085454e5e6a881 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dimitri-kandassamy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@4e655abe78badffc9941001bb7085454e5e6a881 -
Trigger Event:
push
-
Statement type: