parody
A play on parity: keeping the print and web versions of a work in parity.
One authoring toolchain for books and course notebooks: pandoc markdown (with executed jupytext code cells) in, multiple targets out —
- JSON artifact (schema-versioned; the contract consumed by ricopic.one's Django importer and other tools)
- standalone HTML preview (no server needed; resolves the artifact's site-template tags itself)
- print-quality PDF via LaTeX profiles (lualatex/latexmk; generic profile bundled, book-private profiles pluggable)
Parody unifies and replaces the toolchains of two ancestor systems: the
homepage-django notebooks pipeline and the rtc-book meta-* book machinery.
See NEW_PROJECT_SEED_PLAN.md for the full plan.
Install / develop
Requires Python ≥ 3.11 and pandoc (pinned version in
parody/toolchain.py), or use the Dockerfile/devcontainer.
uv sync # create venv + install
uv run parody --help
uv run pytest # golden tests need the ancestor corpora; see tests/golden/
CLI
parody init <dir> # scaffold a content repo (incl. CI workflow)
parody build <project_dir> <output.json> [--clozes blank|key|full] # JSON artifact
parody preview <project_dir> -o preview # static HTML site for review
parody watch <project_dir> # rebuild on save (pip install 'parody[watch]')
parody pdf <project_dir> [--solutions] [--clozes MODE] [--section ch/sec] # print PDF (needs TeX)
parody check <artifact.json> # validate artifact against schema
parody check --toolchain # verify pinned toolchain versions
Content repos use parody.yaml + chapters/<ch>/<sec>.md; the legacy
System A layout (__meta.yaml + chapter_*/) builds bit-compatibly and
remains covered by golden tests.
Fill-in-the-blank (cloze) content
[answer]{.cloze} hides text behind a blank sized to it; []{.blank size=lg}
is an empty blank with nothing behind it (sm/md/lg/xl = 2/5/10/20 em, or
width=4cm). Block forms: ::: {.blank lines=6} for work space, ::: {.cloze}
for a hidden passage. Inside math, use the macros — a span cannot live inside
$…$: $\tau = \cloze{RC}$, $y = \clozeblank{3em}$. A figure can carry
incomplete artwork with cloze="fig-blank.pdf", or by putting a
<stem>-cloze.<ext> sibling next to it.
Three build modes, set by --clozes (or cloze: {default: …} in
parody.yaml), independent of --solutions:
| mode | who it is for |
|---|---|
blank (default) |
student handout — answers replaced by rules at build time |
key |
instructor copy — answers shown, accented |
full |
publication — answers as ordinary text, blanks dropped entirely |
parody pdf . --clozes blank
parody build . artifact/book-full.json --clozes full
In blank mode the answer never reaches the browser or the PDF content stream —
it is removed at build time, not hidden with CSS. Print measures the real box
with \settowidth, so widths are exact; the web estimates from character count.
A cloze inside an exercise solution always renders full.
Metadata
Release files for parody 0.58.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| parody-0.58.0.tar.gz | 1.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| parody-0.58.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.4 MB
Release files / parody-0.58.0.tar.gz
| Download URL | parody-0.58.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6a8f6f923ab48315c7db79752276340c90180dcf4c5c18296d9e495534e95d7
|
|
BLAKE2b-256 checksum How to use checksums |
671ff14e1c3c72c2f933f35fb75231749ad462202a59e84cc8993725f395dfb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / parody-0.58.0-py3-none-any.whl
| Download URL | parody-0.58.0-py3-none-any.whl |
|---|---|
| Size | 238.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88467f28155fdf02252d45074a3b4a4f69c94e8b03bc699d33d6619b979a686f
|
|
BLAKE2b-256 checksum How to use checksums |
78da5f5f09476b862a27a95f52bd0ca21db99d2d6a065e7236624d81a78eccce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|