replace the shortcode syntax with generic directives
`::name{key=value}` alone on a line, quotes only where a value has spaces,
braces omitted when there are none. The old form cost eleven characters of
punctuation per call and could not carry a body, which admonitions will need.
Generic directives are an existing convention — remark-directive, MyST,
Docusaurus — so this is a syntax authors and tools already know rather than one
more invention, and it reserves `:::name` for containers and `:name[…]` for the
inline dynamic calls that come later.
Retired outright rather than aliased: two syntaxes is two parsers and two test
sets forever. `khosra check` reports every leftover call as fatal and names the
replacement, so migrating a site root is running it until it exits zero — proven
on an unmigrated root, which exits 1 with the file and the fix.
The trigger byte moves from `{` to `:`, which prose uses constantly, so the
parser refuses `3::4`, `: a definition` and `:::note`, each with a case. The
definition-list parser sits at priority 101 and this one at 100, so it gets
first refusal and everything it rejects falls through.
Two things the syntax change would have broken silently. check's alt-text regex
still matched the old form, so the one accessibility check the engine has would
have stopped finding anything — it moves with the syntax and keeps its case. And
a test asserted that hostile arguments fail at the syntax because quotes cannot
be expressed; unquoted values are legal now, so it asserts the property that
actually holds: the fragment escapes them.
Demo migrated. core 2790/2800, ext 1077/2000, 34 gates green, 0 warnings.
This commit is contained in:
@@ -6,7 +6,7 @@ tags: [monsoon]
|
||||
Three studies and a diagram. The gallery below is every picture in this directory, in filename order — the
|
||||
numeric prefixes do the ordering without appearing in any URL.
|
||||
|
||||
{{< gallery >}}
|
||||
::gallery
|
||||
|
||||
The three JPEGs carry generated widths in a `srcset`. The SVG does not: nothing here can resample it, so it is
|
||||
rendered exactly as it was drawn rather than dropped for being inconvenient.
|
||||
|
||||
@@ -6,6 +6,6 @@ tags: [monsoon]
|
||||
---
|
||||
Chapter two, written as a directory bundle so it can own the picture below.
|
||||
|
||||
{{< figure src="water.jpg" alt="A wall of grey water" caption="Day three" >}}
|
||||
::figure{src=water.jpg alt="A wall of grey water" caption="Day three"}
|
||||
|
||||
It has a chapter on either side, so the sequence nav shows both, plus its position in the series.
|
||||
|
||||
@@ -8,6 +8,6 @@ to point at. Its Bengali twin is `index.bn.md` beside this file.
|
||||
|
||||
It also owns a picture, which only a *directory* bundle can do:
|
||||
|
||||
{{< figure src="cover.jpg" alt="A grey-green gradient standing in for a photograph" caption="A caption, rendered by the theme's figure fragment" >}}
|
||||
::figure{src=cover.jpg alt="A grey-green gradient standing in for a photograph" caption="A caption, rendered by the theme's figure fragment"}
|
||||
|
||||
The picture above is served from this bundle's own directory, and the `srcset` on it names generated widths.
|
||||
|
||||
@@ -5,7 +5,7 @@ tags: [monsoon, journal]
|
||||
---
|
||||
The finished piece. Below, a part of it lives in a separate file and is included here:
|
||||
|
||||
{{< include file="_method.md" >}}
|
||||
::include{file=_method.md}
|
||||
|
||||
That fragment starts with an underscore, so the scanner never treats it as a bundle: it has no URL of its own
|
||||
and appears in no listing. An included file cannot itself include — one level, deliberately.
|
||||
|
||||
Reference in New Issue
Block a user