Add cheatsheet-pdf plugin#4
Open
wesnick wants to merge 1 commit into
Open
Conversation
Renders a Markdown document into a compact, print-ready PDF cheatsheet (dense single-page, or single-sheet two-sided) via pandoc → HTML → headless Chromium. The bundled build_cheatsheet.py automates the density tuning: it binary- searches the largest uniform zoom whose render still fits --max-pages, so the sheet fills the page without spilling. Stdlib-only; shells out to pandoc and a Chromium browser, naming no harness-specific tools. The SKILL.md captures the two non-obvious layout traps as durable knowledge: table-layout:fixed (wide tables otherwise overflow and paint over the neighbouring column) and rendering the title outside the column flow (a column-spanning title corrupts downstream positions). Includes the standard registration: codex sidecar symlink, marketplace and README catalog entries, CODEOWNERS, and a 4-case eval suite (positive / two-sided / negative-longform / edge-overlap). Passes validate, lint, and stats. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new
cheatsheet-pdfplugin: renders a Markdown document into a compact, print-ready PDF cheatsheet — a dense single-page (or single-sheet, two-sided) reference — viapandoc→ HTML → headless Chromium.It grew out of a real task (turning a tool cheatsheet into a one-page printable PDF), generalized into a reusable, evals-backed skill.
Why it's more than a wrapper
The headline feature is auto-fit: instead of hand-tuning font sizes until content fits,
build_cheatsheet.pybinary-searches the largest uniformzoomwhose render still respects--max-pages(default 1). The result fills the sheet as much as possible without spilling — the same outcome as manual tuning, found in ~7 renders.The
SKILL.mdteaches the two non-obvious layout traps as durable knowledge (per the "explain WHY" bar inAGENTS.md):table-layout: fixed— without it a wide table sizes past its column and paints over the neighbouring column (text-on-text overlap)..colsavoids that.Contents
Plus standard registration:
.codex/skills/cheatsheet-pdfsidecar symlink,marketplace.jsonentry, root README catalog row (new Documents category),CODEOWNERS, and a 4-case eval suite inevals/cases/cheatsheet-pdf/(positive / two-sided / negative-longform / edge-overlap).Requirements
External tools on PATH (not packages):
pandocand a Chromium browser (google-chrome,chromium, …). The script is stdlib-only and names no harness-specific tools — runs the same under Claude Code, Codex, and pi.Verification
just validate— plugin metadata, frontmatter, codex sidecar: all in syncjust lint—ruff check+ruff format --check: cleanjust stats— 6/6 skills have eval coverage; cheatsheet-pdf: 4 casesPR checklist
## When to Use/## When NOT to Usepresent🤖 Generated with Claude Code