gp-dimm-city 1.2.0-alpha.1 → 1.2.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -45,6 +45,55 @@ Books pinned to an earlier gp-dimm-city are unaffected until re-pinned.
45
45
  new markers; `components.yaml` lists them as plugin-origin, and its
46
46
  `card-variants` entry now describes `.section.dc-flaws` (the class the CSS
47
47
  actually selects).
48
+ - **`@specialty`, `@learning-path` and `@skill` are declared too, then
49
+ transformed** ("declare, then transform"). Core now opens, nests and closes
50
+ them, and two ordinary markdown-it core rules (`dcLearningPaths`,
51
+ `dcSkillCards`, over a small inlined `forEachComponent` helper) rewrite what
52
+ sits inside: the path's title, subtitle and sticker chain, `data-path-ref`,
53
+ and one skill card per `####` heading. The state machine drops from 865 to
54
+ 468 lines (`plugin.js` is 97 lines shorter overall, new rules included):
55
+ its skill, path and specialty flags and branches are gone. `@continue`
56
+ inside a skill's card still opens the
57
+ `{name} ▸` continuation card; the classifier that claims it ahead of core
58
+ now reads core's marker tokens instead of the raw paragraphs.
59
+ - **`@card`, `@outcome` and `@procedure` are declared and transformed the same
60
+ way.** Three more core rules (`dcCards`, `dcOutcomes`, `dcProcedures`) run
61
+ ahead of the skill rules and rewrite what sits inside each. The state
62
+ machine drops from 468 to 122 lines: it now holds only `@callout`,
63
+ `@dm-note`, `@tape`, the retired `@roll-table` / `@options-table` no-ops and
64
+ the image-only paragraph class. `plugin.js` is another 208 lines shorter
65
+ (1,765 to 1,557), new rules, validation and docs comments included. The
66
+ emitted HTML is unchanged: rendering the design guide and both books
67
+ through the old and new plugin gives the same markup apart from the
68
+ attributes and the one page listed below.
69
+ - `@card` is `div.dc-card` with its heading, pull quote, body and footer as
70
+ before, and takes classes, `#id` and `key=value` as before.
71
+ - `@outcome` is `div.dc-outcomes`; `flush` is now a declared variant (it
72
+ adds `.dc-flush` and `data-outcome="flush"`), and `@outcome .dc-flush`
73
+ works too. The compact form (rows with no blank lines) still works.
74
+ - `@procedure` still renders only the `ol.dc-steps`: its declared wrapper is
75
+ hidden, so no `div` appears in the HTML.
76
+ - A `@card`, `@outcome` or `@procedure` inside a skill stays inside the
77
+ skill's card, as before.
78
+ - New on cards and outcomes: `data-source-range`, so the editor can map them.
79
+ - **More structure checks.** An `@outcome` line that is not `roll | name |
80
+ text`, a table, list or heading inside an `@outcome` (they are left out), an
81
+ `@outcome` with no rows, and a `@procedure` with no numbered list are
82
+ reported in plain words, at the line.
83
+ - `@specialty augmerc` is the new spelling for a specialty (names:
84
+ `augmerc`, `proxy`, `streetwarden`, `gutterdruid`, `cybersurgeon`,
85
+ `wirephreak`, `technosorcerer`, `etherlock`, `dualist`, `generalist`, each
86
+ styled by `.dc-specialty.<name>`). `@specialty .augmerc` and
87
+ `@specialty {.augmerc}` work unchanged and give the same element.
88
+ `data-path-ref` reads the enclosing specialty's variant or class, so
89
+ `@specialty .augmerc` still gives `AUG1`.
90
+ - **Structure checks, in plain words.** Skills sitting directly in a
91
+ `@specialty` are reported once per run, at the first one ("This skill (and
92
+ any right after it) is outside a learning path…"), and so
93
+ is a `@learning-path` or `@specialty` that starts inside a skill. The usual
94
+ cause is an `@end-learning-path` above the skills it was meant to close.
95
+ - Snippets: `specialty` shows the whole specialty > learning path > skill
96
+ hierarchy, and `learning-path` shows its skills.
48
97
  - devDependency `gutterpress` is `0.11.16-alpha.2`.
49
98
  - `docs/plans/specialty-section-variants.md`: the plan for styling section
50
99
  components per specialty (`@npc-stat wirephreak`), for a later release.
@@ -52,6 +101,10 @@ Books pinned to an earlier gp-dimm-city are unaffected until re-pinned.
52
101
  ### Removed
53
102
 
54
103
  - `@block variant=panel`. No book or guide page used it; write `@block panel`.
104
+ - `@end-skills` (no book used it; it is plain text now).
105
+ - `@end-skill` no longer closes the `@learning-path` around the skill. It
106
+ closes the skill, like every declared closer; `@end-learning-path` ends the
107
+ path.
55
108
 
56
109
  ### Behaviour notes
57
110
 
@@ -63,7 +116,45 @@ Books pinned to an earlier gp-dimm-city are unaffected until re-pinned.
63
116
  `data-lang`, where the old code emitted `lang` (likewise `dir`, `role`,
64
117
  `tabindex` and `aria-*`).
65
118
  - `@end-<wrapper>` with no open wrapper now warns
119
+ (`declared_marker_close_without_open`) instead of being ignored. That now
120
+ includes a stray `@end-skill`, `@end-learning-path` and `@end-specialty`.
121
+ - Specialties, paths and skills close like every declared marker: a new one
122
+ of the same kind closes the previous and what is inside it, `@end-<name>`
123
+ closes it and what is inside it, and `@page`, `@section`, `@chapter` and
124
+ `@continue` close all of them. A `@page` written inside a specialty used to
125
+ leave the specialty open across the page; it now ends the specialty. Use
126
+ `@page-break` to break a page inside one.
127
+ - A `@skill` glued to the line above it (no blank line) is now a marker, as
128
+ every declared marker is; it used to print as the text "@skill".
129
+ - A skill inside a learning path is numbered `PATHREF.N` by its place in the
130
+ path. An `@end-skill` in the middle of a path used to end the path (the
131
+ skills after it lost their tier); the path now stays open.
132
+ - A closer straight under a list item or a quote is a closer now, because core
133
+ reads declared markers there: `@end-procedure` under the last step and
134
+ `@end-card` under the footer quote no longer need a blank line (they used to
135
+ be folded into the item or the quote and never closed).
136
+ - `@procedure` and `@outcome` left open at the end of a file warn with core's
137
+ `declared_marker_eof_close` ("An open @procedure reached end-of-document…"),
138
+ replacing the plugin's `unclosed_procedure`. An unclosed `@outcome` used to
139
+ swallow the rest of the file without a word. `@card` still closes silently.
140
+ - `@end-card`, `@end-outcome` and `@end-procedure` with nothing open now warn
66
141
  (`declared_marker_close_without_open`) instead of being ignored.
142
+ - `@callout` and `@dm-note` are still hand-written, so they no longer close a
143
+ `@card` or `@procedure` that is open, and a card or procedure no longer
144
+ closes them. `@callout`, `@procedure`, `@end-procedure`, `@end-callout` is a
145
+ callout with the procedure in it. One book chapter wrote exactly that; it
146
+ used to close the callout at the `@procedure` and leave the steps and the
147
+ closing paragraph outside its box, and now renders them inside it, as
148
+ written.
149
+ - A bare word after `@card`, `@outcome` or `@procedure` is no longer a class
150
+ (core reads it as a variant, and only `flush` is one): write `@card .wide`.
151
+ No book or guide page used one.
152
+ - An `@outcome` shows only the lines of its own paragraphs: a list or heading
153
+ inside it is no longer read as a row (it is reported instead).
154
+ - Core drops a declared marker that is already open and nests the next one, so
155
+ a book that closes a path early (`@end-learning-path` above its skills) now
156
+ has its next `@learning-path` nested in the last skill. The checks above name
157
+ each place; remove the early `@end-learning-path`.
67
158
 
68
159
  ## [1.1.5] - 2026-10-09
69
160
 
package/components.yaml CHANGED
@@ -156,6 +156,7 @@ components:
156
156
  emits: ol.dc-steps > li > span.dc-step-no
157
157
  css: styles/components/data.css
158
158
  breaks: "break-inside: avoid"
159
+ notes: "Declared marker; no element of its own (its wrapper renders nothing), each numbered list inside is the step list. Left open at the end of the file it warns (declared_marker_eof_close); with no numbered list inside it is reported."
159
160
 
160
161
  - name: block
161
162
  status: live
@@ -184,6 +185,7 @@ components:
184
185
  - div.dc-card-body > blockquote.dc-card-footer (the last body blockquote, dc#44)
185
186
  css: styles/components/section.css
186
187
  breaks: "break-inside: avoid"
188
+ notes: "Declared marker, no variants: author classes (@card .dc-flaws), #id and key=value attributes ride on the wrapper. Inside a skill it stays in the skill's card. Left open at the end of the file it closes silently."
187
189
 
188
190
  - name: card-variants
189
191
  status: live
@@ -242,7 +244,7 @@ components:
242
244
  - name: outcome
243
245
  status: live
244
246
  origin: plugin
245
- recipe: "@outcome [flush] / 20 | Crit | text … @end-outcome, or a | Roll | Outcome | table inside a skill card"
247
+ recipe: "@outcome [flush] / 20 | Triumph | text / 11–19 | Success | text / 6–10 | Hard Choice | text / 2–5 | Failure | text / 1 | Catastrophe | text … @end-outcome, or a | Roll | Outcome | table inside a skill card"
246
248
  emits:
247
249
  - div.dc-outcomes[.dc-flush] > div.dc-outcomes-label
248
250
  - div.dc-outcome-row.crit|hit|mixed|miss|fail > span.dc-outcome-key.tier-* > span.dc-outcome-name + span.dc-outcome-roll
@@ -260,11 +262,12 @@ components:
260
262
  - --dc-outcome-name-opacity
261
263
  usage: ["| Roll | Outcome"]
262
264
  breaks: "break-inside: avoid; the skill-table form adds data-break-inside=avoid only when the parent card allows splitting"
265
+ notes: "Declared marker; `flush` is its one variant (also writable .dc-flush). One row per `roll | name | text` line, coloured by position; a sixth row is a plain hit. Left open at the end of the file it warns (declared_marker_eof_close); a line that is not a row, a non-row block, or no rows at all is reported."
263
266
 
264
267
  - name: specialty
265
268
  status: live
266
269
  origin: plugin
267
- recipe: "@specialty .augmerc|.proxy|.streetwarden|.gutterdruid|.cybersurgeon|.wirephreak|.technosorcerer|.etherlock|.dualist|.generalist … @end-specialty"
270
+ recipe: "@specialty augmerc|proxy|streetwarden|gutterdruid|cybersurgeon|wirephreak|technosorcerer|etherlock|dualist|generalist (or .augmerc, {.augmerc}) … @end-specialty"
268
271
  emits: div.dc-specialty.<name>
269
272
  css:
270
273
  - styles/components/specialty-identity.css
@@ -285,7 +288,7 @@ components:
285
288
  - --dc-specialty-intro-title-shape
286
289
  - --dc-specialty-intro-clip
287
290
  breaks: "none on the wrapper; children carry their own"
288
- notes: "Parent-selector model: every card, path and intro inside inherits shape and colour from .dc-specialty.<name>. Auto-closes any open path or skill."
291
+ notes: "Parent-selector model: every card, path and intro inside inherits shape and colour from .dc-specialty.<name>. Declared marker: the word and the .class spelling give the same wrapper. A new @specialty, @end-specialty, @page, @section or @chapter closes it with every path and skill inside; a skill sitting directly in it (outside a learning path) is reported."
289
292
 
290
293
  - name: specialty-intro
291
294
  status: live
@@ -345,11 +348,12 @@ components:
345
348
  - --dc-path-shell-padding-bottom
346
349
  - --dc-arrow-color
347
350
  breaks: "break-before/after: auto on the block; the h3 stays with what follows"
351
+ notes: "Declared marker. data-path-ref is the enclosing specialty's code and the path's number in it (AUG1, PRX2; PATH1 for a specialty with no code). @end-learning-path closes the path and the skills inside it; a new @learning-path closes the previous one."
348
352
 
349
353
  - name: skill
350
354
  status: live
351
355
  origin: plugin
352
- recipe: "@skill [id=…] [{.dc-allow-split}] [{.dc-two-col}] / #### Name | Tier / > flavor / 1. **N AP** *Ability:* text / ##### Sub-header … @end-skill (alias @end-skills)"
356
+ recipe: "@skill [id=…] [{.dc-allow-split}] [{.dc-two-col}] / #### Name | Tier / > flavor / 1. **N AP** *Ability:* text / ##### Sub-header … @end-skill"
353
357
  emits:
354
358
  - div.dc-skill-card[name][data-break-inside=avoid] > div.dc-card-tab > h4.dc-tab-title + span.dc-tab-tier
355
359
  - div.dc-card-body > div.dc-card-inner > p.dc-flavor + div.dc-sub-header
@@ -364,7 +368,7 @@ components:
364
368
  - --dc-card-gap
365
369
  - --dc-card-tab-shadow
366
370
  breaks: "data-break-inside=avoid by default; {.dc-allow-split} opts into splitting (see allow-split); tab break-after: avoid; last two abilities glued"
367
- notes: "A ##### Outcomes sub-header is swallowed (the outcomes block carries its own label)."
371
+ notes: "Declared marker. Every #### heading in one @skill is its own card, with the @skill line's classes and attributes. @end-skill closes only the skill, never the path around it. A ##### Outcomes sub-header is swallowed (the outcomes block carries its own label)."
368
372
 
369
373
  - name: skill-highlight
370
374
  status: live
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gp-dimm-city",
3
- "version": "1.2.0-alpha.1",
3
+ "version": "1.2.0-alpha.2",
4
4
  "description": "Dimm City design system for Gutterpress: the markdown-it macros (@skill, @specialty, @learning-path, @callout, …), print stylesheets, design tokens, fonts and page templates the Dimm City TTRPG books are set in.",
5
5
  "type": "module",
6
6
  "main": "plugin.js",