Skip to content

The deck names a templates file, not a chrome file - #37

Merged
fabeat merged 1 commit into
mainfrom
feature/templates-file
Oct 30, 2026
Merged

fabeat merged 1 commit into
mainfrom
feature/templates-file

Conversation

@fabeat

@fabeat fabeat commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

"Chrome" was doing two jobs in this library, and a deck could not tell them apart.

It named the shapes a template draws — the free shapes, and the words a :::content block carries — and it named the file those template definitions live in. A deck wrote:

---
chrome: ./templates/chrome.md
template: wordmark
---

and the two keys read as two names for one thing, when one is a path and the other is a name.

What changes

The word "chrome" keeps the first job. The file is templates-file: now:

---
templates-file: ./templates.md
template: wordmark
---

The classes follow the key:

Was Is
Template\ChromeFile Template\TemplatesFile
Exception\ChromeNotFound Exception\TemplatesFileNotFound
Exception\ChromeTooLarge Exception\TemplatesFileTooLarge
MalformedChrome::slide() Exception\MalformedTemplatesFile

MalformedChrome keeps the failures about a template's own body — ordinary Markdown in it, a column marker in it, nothing in it — because those are about the template and not about the file.

Why now

The templates feature is unreleased: v0.2.2 has no src/Template/, and DIRECTIVES was ['title', 'name', 'level', 'layout', 'theme', 'author', 'description']. chrome: has never been in a release, so the rename costs nobody a migration, and it is much cheaper now than after v0.3.0.

templates: was the obvious alternative and was rejected: template: wordmark and templates: ./templates.md would differ by one letter and mean unrelated things, and the near-miss would be on the key every slide uses.

What is left alone

Every use of "chrome" that means the shapes keeps its word — the error message that says "a template holds chrome, not content", Render\Chrome, and the prose about the chrome being drawn over what the slide placed itself.

The example files are renamed to match what they hold: examples/markdown/templates/chrome.md is examples/markdown/templates/templates.md, and examples/markdown/corporate/chrome.md is examples/markdown/corporate/templates.md. The templates/ directory stays, because every .md file beside the decks is a deck.

Checks

composer check passes: PHPStan clean, 1592 tests, 3410 assertions.

The documentation site follows in its own pull request, because it renders its examples with this library and so cannot be built against a main that does not have the rename yet.

"Chrome" was doing two jobs: it named the shapes a template draws, and it
named the file the definitions of those templates live in. A deck wrote

    chrome: ./templates/chrome.md
    template: wordmark

and the two keys read as two names for one thing, when one is a path and the
other is a name.

"Chrome" keeps the first job. The file is `templates-file:` now,
`Template\ChromeFile` is `Template\TemplatesFile`, `ChromeNotFound` and
`ChromeTooLarge` are `TemplatesFileNotFound` and `TemplatesFileTooLarge`,
and a templates file that holds a slide is a `MalformedTemplatesFile` rather
than a case of `MalformedChrome`.

The feature is unreleased, so the rename costs nobody a migration.
@sonarqubecloud

Copy link
Copy Markdown

@fabeat
fabeat merged commit cdd6401 into main Oct 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant