Repository navigation
Mermaid: convert to a registry plugin; add plugin options - #2823
Merged
Merged
Conversation
- Replaces the dispatcher's hard-wired `scripts/mermaid.html` with the three plugin files: a deferred entry that imports Mermaid dynamically and starts it explicitly, a companion carrying the pin check and a JSON config block, a shim gating on the render hook's flag and aliasing the deprecated `params.mermaid.version` (MarkMap's pattern) - Explicit `run()` at or after `load`: a dynamic import can settle past Mermaid's load-bound auto-start, so auto-start is timing-fragile for a deferred entry (startup-contract evidence) - Theme-change observer installs before any await so a toggle during a pending render is not missed - Pin moves to the registry entry; the `mermaid-floating-version` id is unchanged since the loop warns under it - Nets: pin canary follows the read; the dispatch net drops mermaid (katex stays); a `mermaid-plugin` fixture covers gate, pins, deprecation, print gap, and a stale dispatcher override
- Network-tier probe with the real companion: per-language params reach Mermaid re-cased (viewBox differs), a hook-emitted fence renders, and the entry is the only script (no inline module, no cross-origin tag) - Holds `load` behind a pending image so the CDN import settles first: proves the explicit start still waits, and that a theme toggle mid-render reloads - Red-proofed: both timing probes fail against an entry without the wait and the observer
- Adds a "Mermaid version" subsection (the target of the deprecation warning's link) and the plugins table row - Trims Mermaid from the params.PACKAGE.version list, now KaTeX and Redoc only
- Entry selects the typed config block (`script#docsy-mermaid[type=...]`): Goldmark hands a `## Docsy Mermaid` heading the same id, which hijacked the config (r1.1) - Entry falls back to `init()` so Mermaid 9 pins keep rendering; `run()` is v10+ (r1.2) - Shim trims the legacy pin and aliases it on flagged pages only, where 0.17 read it: a stale pin on a diagram-free site stays inert (r1.3, r1.4); range pins stay rejected, documented in the UG note - Runtime net syncs on network idle with the held image pending, so a slow chunk can't false-clean the load-wait probe; healthy pages count diagrams, not SVGs (Mermaid renders errors as SVGs too); 9.x and heading-collision cases added (r1.5, r1.6) - Fixture net: companion-absence regex matched nothing the stub emits; labels per the tests standard; spelling assertions cut (r1.7-r1.9) - Quality inventory lists the two suites; link cache seeds their not-yet-live URLs (r1.10)
…ases - Drops the Mermaid 9 init() fallback: 0.18 supports the pinned 11.x (changelog § Official support); pins below 10 now render nothing, with the failure logged - Makes the runtime net's `en` language the hostile consumer otel.io isn't: a whitespace-padded legacy pin that must win, trimmed, alongside the existing per-language setting, heading-id collision and body-end fence - Replaces the 9.x case with the experimental 12.x one: renders under Mermaid's new defaults and dark differs from light, nothing tuned - Strips the SVG's per-render id before comparing light and dark styles, in both nets: Mermaid scopes its styles under it, so the old comparison could never fail
- States the support policy in one home, changelog § Official support (script dependencies at their pinned versions), and has the UG's Mermaid version section route there: pins below 10 don't render, 12 pins are experimental - Adds the Mermaid items to the 0.18 changelog entry and post (pin's move, override path, CSP consequence of the inline module's departure) - Updates the design, implementation, quality and maintainer pages for Mermaid as a plugin: shim-read gate, companion's CDN check, the nets' hostile consumer and 12.x case
✅ Deploy Preview for docsydocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- Drops the pre-0.18 migration note: history and upgrade guidance are the post's (its plugins item already carries them); the deprecated param keeps one current-behavior line, as the MarkMap section does - Links Mermaid 12's release notes instead of restating its defaults - Moves the turn-off sentence up to where the section explains automatic enabling, so the subsection is about the version only
…vior - Same placement rule as the Mermaid section: history and upgrade guidance are the post's, the guide describes Docsy as it is - The post's MarkMap item, which delegated legacy behavior to the note, now states it
- Drops the support sentence (the changelog's § Official support owns it) and the effective-pin troubleshooting line - Moves the below-10 and Mermaid 12 statements to the post: they are about versions at this release, not evergreen behavior; the changelog's experimental bullet points there
- Fails the build on `params.mermaid.version`, on any page, naming the registry field to set: a pin is a value the site moves once, while the alias needed a precedence rule the guide then had to explain - Drops the alias machinery with it: trim, flagged-page scoping, the `docsy-mermaid-legacy` warning; the offline net's two legacy cases now assert the refusal (red-first against the alias shim), and the runtime net's hostile consumer loses the padded pin, which had nothing left to prove - Records the rule at the implementation page § Shims; changelog lists the removal as breaking, the post says what to do
- Applies the same rule as Mermaid's to `params.markmap.version`, so 0.18 treats legacy version pins uniformly: a build error names the registry field; the `enable` alias stays, being behavioral - Offline net: the two legacy-pin cases assert the refusal (red-first against the alias shim); the legacy spellings leave the version-syntax cases, which now cover the entry alone - Post merges the two pins into one upgrade item; UG loses the effective-pin troubleshooting line
- Widens the entry's try to cover the config parse, the import and initialize, so a blocked CDN or a bad setting logs instead of rejecting unhandled (r1.3) - Guards the js-runtime dark check against running without its light capture (r1.14) - Trims shim and test comments to purpose plus pointer; the rationale lives on the project pages (r1.11, r1.15, r1.16) - Docs per content placement: changelog in past tense and what-changed only, the post's other-pins item split by pin class, the UG names the registry path its override lives under, project pages lose restated how and history (r1.1, r1.2, r1.5, r1.8, r1.17-23)
…tring - Reserves `options` in the entry schema as an opaque, plugin-owned field: the loop neither validates nor transforms it and passes it to the shim and companion unchanged, so a plugin chooses its own shape - Mermaid's `options` is the `mermaid.initialize()` object as a JSON string, decoded by the shim (build error for a map, malformed JSON, or a non-object); Hugo lowercases map keys at every depth with no opt-out, and the old defaults-walk re-casing could not recover a fifth of Mermaid 12's schema - Refuses the retired `params.mermaid` and `params.markmap` namespaces outright (any key, any page), replacing the per-key refusals and MarkMap's `enable` alias, so every migrated package has one home - Drops the runtime re-casing (`norm`) and with it the array/null mangling (r1.10); the runtime net's per-language geometry check now proves the options transport end to end - Nets: red-first cases for the options contract and the namespace refusals; the loop test that pinned `options` as retired now pins it as reserved
- Design page's registry section states the rule and the rejected alternatives; implementation § Shims covers refusal and decoding; quality page lists the new cases - Plugins guide: `options` in the configuration reference and a "Plugin settings" section for authors (why a JSON string for case-sensitive libraries) - UG: "Mermaid settings" replaces the `params.mermaid` example with the entry's `options` string in the three config formats; post and changelog carry the namespace removal and the migration by key
…n pause - Mermaid's shim decodes `options` first and dispatches on the result: Unmarshal already rejects maps and lists, maps empty and null to nil, and reports parse positions, so the type ladder goes and every non-string value now fails the build (r2.1, red-first) - Implementation § Security states the vendoring exception Mermaid is (CDN import at runtime by design; SRI covers Docsy's entry), and § Shims separates namespace refusal from options decoding (r2.4, r2.17) - Post: CSP action gets its own condition, the re-casing claim names what the old map actually lost, the Mermaid 12 item carries the Safari floor (r2.5-7); changelog back to past-tense what-changed and its support intro says pinned versions (r2.18, A4) - Plugins guide reconciles "unchanged" with the shim's decode; UG and design overview lose restated rationale; quality page splits its two Mermaid bullets into coverage, boundary, safeguards (r2.3, r2.11, r2.14-15) - Entry, shim and companion comments trimmed to what the code can't say (r2.9-10)
… net trims - Points Renovate's custom manager at the pin's new home; a pins-test canary now ties every pin row to its manager string, red before the fix (r3.1, r3.10) - Schema documents `options` as a string whose format and validation are the plugin's; the design page names the loop guard or decode as the follow-on when a second plugin takes options (β) - Shim error leads with what the value must be and carries the decoder's reason without the template chain; the companion fails on options that reach it undecoded instead of falling back to defaults, so a from-scratch shim override can't silently drop a site's settings (r3.2, r3.3, red-first) - Reload observer acts on a changed `data-bs-theme` only, not a same-value write (r3.8) - Nets: MarkMap refusals table-driven on the four distinguishing inputs; options rows deduplicated; the no-fetch case runs the real companion under a remote deny list; an environment-override case for options; shared visual helpers hoisted; waits target the asserted DOM state, which `networkidle0` had been masking (r3.11-12, 14-20) - Docs: UG failure rule and TOML literal string, post rows for `params.mermaid.enable` and the split override, quality coverage (r3.4-7, r3.22)
… rationale - Shim sets `options` to nothing on every path but a decoded object, so the companion's undecoded guard fires only for a shim override that skipped the decode; a real-companion case under a remote deny list pins the error count (r4.1, red-first); the decoder's reason loses Hugo's pseudo-filename prefix too - Config block carries a `data-docsy-plugin` attribute instead of a fixed id, which a heading could duplicate (r4.3); the reload observer compares rendered darkness, so attribute churn that doesn't change the theme no longer reloads (r4.2) - Design page gains the start-timing rationale that lived only in entry comments, and lists the rejected `options` alternatives one per item; the entry's header becomes purpose plus link (r4.7, r4.18) - Docs converge on one home per fact: the lowercase-keys rationale (design), the shim's job list (implementation), the Mermaid nets (quality, safeguards under red-proof rationale); UG names the dark-mode override and the hidden markup after turn-off; post tense and examples corrected; changelog cites docsy#2825; maintainer notes cover the Renovate canary (r4.4-6, 8-15, 17-22, 24, 26) - Comment trims and header rewraps (r4.23, r4.30)
options
- Breaking bullet names the inline module's replacement by a deferred same-origin entry, the one fact behind the post's CSP item - For maintainers: the pin's move with its Renovate row, the pins-to-Renovate canary, the two Mermaid nets - Experimental line reduced to the declaration; the reference states that language-specific params apply to entries
chalin
added a commit
to chalin/docsy
that referenced
this pull request
Sep 21, 2026
…c; terser guards row - docsy#2823's new script-version-pins check read `renovate.json5` by name and matched the JSON5 quote shape; it now reads `renovate.jsonc` and accepts either quote style around the JSONata keys (red on a stale mermaid path) - The guards routing table row goes back to a route: inputs and comment details live in the audit's header and the Dependency updates bullet
chalin
added a commit
that referenced
this pull request
Sep 24, 2026
- **Scope**: - `renovate.json5` → `renovate.jsonc`: `configMigration` rewrites JSON5 without its comments, JSONC keeps them (renovatebot/renovate#38646); the script-version-pins test (#2823) reads the new file - actions looked up as GitHub Releases, each bump its own SHA-named PR outside the patch/minor groups; shape from chalin/link-cache#14, rationale in the [maintainer notes](https://deploy-preview-2821--docsydocs.netlify.app/project/about/maintainer-notes/#dependency-updates) - every action pin comment names its full release version (each SHA peeled to its Release tag); the supply-chain audit guards the shape - audit run-step deny-list also refuses `npm init NAME` and `npm create` (both run `npm exec create-NAME`); bare `npm init -y` stays - maintainer notes carry the rationale, the Releases requirement for new actions and the guards table; stale comments trued there, in the publish/smoke workflows and in the audit test - **Out of scope**: - docsy-example: follow-up PR, same shape - enabling the Renovate app on the `docsy` org: owner step after both configs land - `.nvmrc` toolchain pinning, the config-validator one-liner in the maintainer notes, the Dependabot security-updates admin check: tracked separately - dependency bumps of any kind (the pending link-cache 0.5.0 included) - **Verified** with renovate 44.82.5: - strict validator green - local dry run overrides every action lookup to `github-releases`, age-holds the one pending action update, and shows the groups holding only npm/nvm/pin deps - each pin's SHA peeled to its Release tag via the API (shared-workflows' is an annotated tag) - **Preview**: https://deploy-preview-2821--docsydocs.netlify.app/project/about/maintainer-notes/#dependency-updates
chalin
added a commit
to chalin/opentelemetry.io
that referenced
this pull request
Oct 7, 2026
…ease) Pins the theme at docsy `main` (`7c511948`, the merged Mermaid plugin, docsy/docsy#2823), ahead of the 0.18.0 tag. Re-points the submodule at `docsy/docsy.git`, the theme's new home since the move out of the `google` org.
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.
_deferand the settingsoptions: a reserved, plugin-owned string field; Mermaid takes themermaid.initialize()object as JSONparams.mermaidandparams.markmaprefused, any key (breaking)main; none in the browser vs 0.17.0, light and darkrun()is 10+optionsto scripts: deferredtheme/data/docsy/schema/params/docsy.yaml, then the three Mermaid plugin files undertheme/layouts/_partials/scripts/plugins/andtheme/assets/js/plugins/mermaid.js;tests/visual/mermaid-runtime.test.mjsproves the transport end to end; design page § Registry shape holds theoptionsrationale