Repository navigation
The deck names a templates file, not a chrome file - #37
Merged
Merged
Conversation
"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.
|
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.



"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
:::contentblock carries — and it named the file those template definitions live in. A deck wrote: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:The classes follow the key:
Template\ChromeFileTemplate\TemplatesFileException\ChromeNotFoundException\TemplatesFileNotFoundException\ChromeTooLargeException\TemplatesFileTooLargeMalformedChrome::slide()Exception\MalformedTemplatesFileMalformedChromekeeps 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.2has nosrc/Template/, andDIRECTIVESwas['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 afterv0.3.0.templates:was the obvious alternative and was rejected:template: wordmarkandtemplates: ./templates.mdwould 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.mdisexamples/markdown/templates/templates.md, andexamples/markdown/corporate/chrome.mdisexamples/markdown/corporate/templates.md. Thetemplates/directory stays, because every.mdfile beside the decks is a deck.Checks
composer checkpasses: 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
mainthat does not have the rename yet.