Menu

D68. Module templates: a charter with placeholder screens, in templates/, copied by init --template (28 Oct 2026)

People expect templates: a module whose content is simple and abstract, whose identity (theme, fonts, components, an animated backdrop and its variants) is ready, to start a module by hand or with an agent from a charter already made. The examples show what Elabora does with a real subject; a template is the opposite: no subject, a charter.

Decided:

  • A template is a course. templates/<id>/ holds an ordinary course folder: course.json, the plan, 14 screens made of the core’s blocks (no HTML made once), the theme, its fonts (OFL, embedded), its components, its backdrop object, its generators and its French translation. Every check a course passes, it passes; an author changes a block, adds one or rewords a text from the inspector, and a screen added later takes the charter as it is.
  • The same screens in every template. The same 14 screen ids, titles and order (cover, objectives, part-one, key-message, text-and-picture, cards, key-figures, practice, steps, quote, comparison, chart, recap, the-end), the same five sections and the same plan: an author who moves from one template to another finds the same module in another charter. Placeholder texts are in English at their real length, translated into French with Elabora’s translation.
  • CC0. The templates are dedicated to the public domain (their LICENSE.md); their fonts keep their SIL OFL licence beside them. Nothing comes from the network, and nothing generated is committed (dist/, captures).
  • templates/index.json lists them in the order people see them, with their name, a sentence and their audiences in the languages of the app.
  • In the module’s language, in the editor too (amended 29 Oct 2026). A module made in French from a template read in English in the Charte and the inspector: the translation covered what learners read, not the words authors read about the charter. It covers them now (SPEC §13): what the course’s styles and backdrop variants are for, its components’ names, descriptions, slots and settings, and the settings and events of the free objects its blocks place, translated in their own files. So init --template writes them in the module’s language, as it does the screens, and every template’s French translation has them (test/unit/templates.test.ts makes a French module from each template and finds no English left). A component’s instructions are for agents and stay in English, as AGENTS.md and README.md do. These words hold no language back: counted apart (editor in translate status), they never keep a translation out of a learner’s package, and the translated course keeps the source’s words where none is given; only a template’s translation must have them all (its test). The names too (schemas 0.1.6): a style or a backdrop variant has a label beside its identifier, which screens and stylesheets keep using ("lead": { "label": "Lead", "description": "…" }), and a component’s choice words its values with x-enum-labels, as a free object’s does; every template names each of its styles, variants and choices, since a name left to its identifier reads in English in any language.
  • Starting from one copies it. elabora init <dir> --template <id> (and elabora projects create --template, and the library’s createProject the app calls) copies the template without its licence, history or builds, in the language asked when the template is translated into it (the translation built as elabora translate build does), then gives the course the author’s id and title, the cover that title, AGENTS.md notes that say where the course comes from (README.md says how the charter works), and the brief as init keeps it. elabora templates lists them. A project made so records its origin (kind: "template").

Weighed:

  • A theme alone (a theme/ folder to apply to any course). Lighter, but an author sees a charter only on screens: a template without its screens shows nothing of the backdrop’s movement, the part openers or the charts in its colours. A theme apply may come later, from these templates.
  • Templates inside packages/node/templates/ beside the course scaffold. Rejected: they are content, read and reviewed as the examples are, not code.
  • Charter words in a file of each template’s, written by init --template (for the amendment of 29 Oct). Rejected: a second translation format that only templates would have, with its own checks; translated with the course, these words use the same tools (translate status, elabora_translate_text), the same staleness and the same checks, and any translated course reads in its language in the editor.
  • A copy that keeps the template’s id and title. Rejected: an LMS tells courses by their id, and the cover would say « Your module title ».

Revisit if: templates need to be updated in courses made from them (then a theme apply), or people make their own templates (then a template from a course).