Plan agreed with Stef on 2026-11-18 (grill session, task 3 of the release tasks).
Everything ends up in this repository (archetypes/…, doc/, the Pillar packages).
The book TemplateExperiments is only used for real dry-runs before a change is put here:
a step is not done until its result is in this repository.
_support mixes the files of Pillar (templates, book.css, fonts, sbabook.cls, Beamer styles) with the changes
authors make to them. Today pillar updateTemplate <archetype> (PRProject>>installTemplateNamed:) deletes the whole
_support and copies the archetype again: every change is lost. _support/archetypeID only records the archetype name.
_supportbelongs to Pillar; an update may replace it completely. The changes of a book live in_custom/, with the same layout as_support._customhas a README explaining the mechanism.- Two ways to customize:
- whole-file override: a file of
_customwith the same path as a file of_supportreplaces it at build time (templates, LaTeX class…); - additions:
_custom/html/css/custom.cssis loaded afterbook.css(Pillar gives the templates acustomCssvalue when it exists), and_custom/latex/custom.texis read at the end of the LaTeX preamble (\InputIfFileExists, also in the Beamer templates). The README recommends additions over copyingbook.css.
- whole-file override: a file of
- Applied in one place, the build copy:
PRWritingTarget>>prepareForExecutionOn:copies_support, then_custom(exceptREADME.md) over it, into_result/<output>/_support;PRAbstractOutputDocument>>templateDirectoryreads the templates from that merged copy. All paths in templates, CSS and LaTeX keep saying_support/…. pillar updateArchetype [name]replacespillar updateTemplate(removed, no alias;PRUpdateTemplateCommandLineHandlerremoved too). The name defaults to_support/archetypeID(another name switches the archetype). It never touches_custom, creates it when missing, and prints what it did (archetype, files added, changed, removed).- Migration of hand-edited books: before replacing, the old
_supportis moved to_support-previous/(ignored by the build, overwritten by the next update) and the files that differ from the new version are listed, so the author moves real changes into_custom. - Where
_customcomes from: each archetype gets acustom/folder (next tosample/andsupport/) withREADME.mdand a commented examplehtml/css/custom.css.pillar archetype <name>installs it as_custom/;updateArchetypeinstalls it only when_customis missing, never overwriting it. - Documentation is a main deliverable: the Pillar commands and the
_custommechanism are explained indoc/.
- Merge at build.
_customcopied over_supportin the output; templates read from the merged copy. Tests: an override in_customwins;README.mdis not copied; a book without_custombuilds as before. - Additions.
customCssvalue;main.mustacheandsite.mustachelinkcustom.cssafterbook.css; LaTeX and Beamer templates readcustom.tex. Dry-run in TemplateExperiments, then into every archetype of this repository. pillar updateArchetype [name]as in decisions 4 and 5; removeupdateTemplateand its old handler. Tests on a temporary book: default name,_customkept,_customcreated when missing,_support-previousand the list of differing files.pillar archetypeinstallscustom/as_custom/.custom/folder in every archetype of this repository:README.mdand the examplecustom.css(dry-run in TemplateExperiments first).- Integration tests (
PRIntegrationTest): a book with a template override and acustom.cssbuilds as a site and as LaTeX;updateArchetypekeeps_customand produces_support-previous. - Documentation in
doc/(with task 6, the architecture documentation):- every Pillar command with its options and an example:
archetype,build(html,site,pdf, file arguments, flags),updateArchetype,serve,checkers,bookTester,updateBuild(archetype development); - the layout of a book (
pillar.conf,index.md, chapters,_support,_custom,_result); - the
_custommechanism: overrides,custom.css,custom.tex, what an update does, how to migrate a hand-edited_supportwith_support-previous; - the
custom/README.mdof the archetypes points to it.
- every Pillar command with its options and an example: