Repository navigation
feat(themes): formal theme, and per-document header and footer lines - #7
Merged
Merged
Conversation
`formal` is the word-processor document for contracts and official letters: all black, Liberation Serif 12pt (Times New Roman metrics, vendored), 2.5 cm margins, `::: clauses` numbering, `::: signatures`, a page-number footer. Frontmatter or scriptorium.yaml `header:` / `footer:` take left/center/right templates that repeat on every page; a theme may ship defaults and `false` removes them. Running-head values are now escaped for CSS. Fixes #6 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
Fixes #6.
What changed
themes/formal/: extendsbase. All vars are black. Body and headings use Liberation Serif 12pt (Times New Roman metrics) with 2.5 cm margins. Text is justified withhyphens: manual, which matches a word processor's default.::: clausesnumbers its##headings 1., 2. and the ordered lists under them 1.1, 1.2, restarting under each clause. The theme registers it askeep_together: false, because a contract body is one long block.::: signaturesholds::: signature {name=… role=…}blocks side by side, with signing space above a rule.::: rightand::: centeralign a date line or a seal line.{page} / {total}.header:/footer:(galley._furniture_css): left/center/right templates as@pagemargin boxes on every page.{page}/{total}count pages, and any other{key}reads the frontmatter or a project'svars:. A theme's top-level keys are the default; frontmatter orscriptorium.yamlreplaces the whole mapping, andfalseremoves it. A non-mapping value raisesValueError.project.pynow passesheader/footerthrough as content keys._tpl_to_css_contentescapes\,"and newlines. Before, a value containing a double quote ended the CSS string and the whole margin box dropped silently.themes/README.md, the authoring know-how, the CHANGELOG.examples/formal.mdis a two-page services agreement that uses everything above, with citations and a footnote.Measured
test_furniture.pyandtest_formal.py). This repo has no CI, so the local run is the gate.examples/formal.mdhas 0 colored pixels at 150 dpi (no pixel with |max−min| > 8). The same check onexamples/article.mdpage 1 finds 7985, so the check can fail.pdffonts: Liberation Serif regular, bold and italic are embedded. DejaVu Serif also appears, but only for the↩back-link glyph, which Liberation Serif lacks.Tried and dropped
@pagehas zero margin. The test stays as a guard.pdffontsas the font check: it cannot fail on a machine with Liberation Serif installed system-wide, so the test checks that the rewritten@font-faceURLs point at existing vendored files.Left out
↩back-links in footnotes and references are bare text emitted by the engine, so the theme cannot hide them.<html lang='en'>is hardcoded inemit().formaldoes not hyphenate, so it is unaffected, but every other theme hyphenates Spanish text with English rules._emit_cssintoemit.py: whichever lands second moves_furniture_csswith it.🤖 Generated with Claude Code