{"_id":"@boneskull/typedoc-plugin-mermaid","_rev":"3-e2d51f01da0f7b7f6f02b9233a6cc652","name":"@boneskull/typedoc-plugin-mermaid","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@boneskull/typedoc-plugin-mermaid","version":"0.1.0","keywords":["diagrams","documentation","mermaid","typedoc","typedoc-plugin"],"author":{"url":"https://boneskull.com/","name":"Christopher Hiller","email":"boneskull@boneskull.com"},"license":"BlueOak-1.0.0","_id":"@boneskull/typedoc-plugin-mermaid@0.1.0","maintainers":[{"name":"boneskull","email":"boneskull@boneskull.com"}],"homepage":"https://github.com/boneskull/typedoc-plugin-mermaid2#readme","bugs":{"url":"https://github.com/boneskull/typedoc-plugin-mermaid2/issues"},"dist":{"shasum":"8e104aa26dab7ffa5ccc4a64aacd0dc4d8a8124f","tarball":"https://registry.npmjs.org/@boneskull/typedoc-plugin-mermaid/-/typedoc-plugin-mermaid-0.1.0.tgz","fileCount":11,"integrity":"sha512-n2HhjqSNtDR+Egemce+JPceQLfZUvwWh5DHkPr8lkprly7nDPMTSm2KXsohRd106IaJl76uE8cJnSgX+BIqVzA==","signatures":[{"sig":"MEUCIBC86gRjE7EGFxaM89uby03vmqy8QtV2VwEGDYD8ama9AiEA5nmzO80VfQd3Uy+0bBbRI++izJ+A9JRKNZX3kjxWTt4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32100},"knip":{"tags":["-knipignore"],"ignore":["**/*.d.ts",".worktrees/**/*","examples/**/*"],"ignoreDependencies":["markdownlint-cli2-formatter-pretty"]},"main":"./dist/index.cjs","type":"module","zshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"types":"./dist/index.d.cts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.cts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"c1c04b90f97e7ee567f6eb76cd9cab2b89a24b9e","scripts":{"fix":"run-s -sl fix:*","lint":"run-p -sl --aggregate-output lint:*","test":"run-s test:runtime","build":"zshy","fix:pkg":"npm pkg fix","prepare":"husky; run-s -s build","lint:knip":"knip","commitlint":"commitlint","fix:eslint":"eslint --fix .","lint:types":"tsc --noEmit","test:watch":"node --import tsx --test --test-reporter=spec --watch \"test/**/*.test.ts\"","lint-staged":"lint-staged","lint:eslint":"eslint .","fix:markdown":"markdownlint-cli2 --fix \"**/*.md\"","fix:prettier":"prettier --write . && markdownlint-cli2 --fix \"**/*.md\"","test:runtime":"node --import tsx --test --test-reporter=spec \"test/**/*.test.ts\"","lint:markdown":"markdownlint-cli2 \"**/*.md\"","lint:prettier":"prettier --check .","lint:spelling":"cspell . \"./.*/**\""},"_npmUser":{"name":"boneskull","email":"boneskull@boneskull.com"},"prettier":{"tsdoc":true,"plugins":["prettier-plugin-jsdoc","prettier-plugin-pkg","prettier-plugin-sort-json"],"singleQuote":true,"jsdocPreferCodeFences":true,"jsdocCommentLineStrategy":"keep"},"repository":{"url":"git+https://github.com/boneskull/typedoc-plugin-mermaid2.git","type":"git"},"_npmVersion":"11.6.2","description":"TypeDoc plugin for rendering Mermaid diagrams","directories":{},"lint-staged":{"*.md":["markdownlint-cli2 --fix","prettier --write","cspell lint --no-must-find-files"],"*.{ts,js,yml,json5}":["eslint --fix","prettier --write","cspell lint --no-must-find-files"],"**/!(package-lock).json":["eslint --fix","prettier --write","cspell lint --no-must-find-files"]},"_nodeVersion":"24.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.21.0","knip":"5.78.0","zshy":"0.6.0","husky":"9.1.7","bupkis":"0.14.0","cspell":"9.4.0","eslint":"9.39.2","globals":"16.5.0","typedoc":"0.28.15","prettier":"3.7.4","@eslint/js":"9.39.2","typescript":"5.9.3","@types/node":"24.10.4","lint-staged":"16.2.7","npm-run-all2":"8.0.4","@commitlint/cli":"20.2.0","markdownlint-cli2":"0.20.0","typescript-eslint":"8.51.0","eslint-plugin-jsonc":"2.21.0","prettier-plugin-pkg":"0.21.2","prettier-plugin-jsdoc":"1.8.0","@stylistic/eslint-plugin":"5.6.1","prettier-plugin-sort-json":"4.1.1","eslint-plugin-perfectionist":"5.2.0","@commitlint/config-conventional":"20.2.0","markdownlint-cli2-formatter-pretty":"0.0.9"},"peerDependencies":{"typedoc":">=0.27.0"},"_npmOperationalInternal":{"tmp":"tmp/typedoc-plugin-mermaid_0.1.0_1768028942170_0.6208971377898795","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@boneskull/typedoc-plugin-mermaid","version":"0.2.0","keywords":["diagrams","documentation","mermaid","typedoc","typedoc-plugin"],"author":{"url":"https://boneskull.com/","name":"Christopher Hiller","email":"boneskull@boneskull.com"},"license":"BlueOak-1.0.0","_id":"@boneskull/typedoc-plugin-mermaid@0.2.0","maintainers":[{"name":"boneskull","email":"boneskull@boneskull.com"}],"homepage":"https://github.com/boneskull/typedoc-plugin-mermaid2#readme","bugs":{"url":"https://github.com/boneskull/typedoc-plugin-mermaid2/issues"},"dist":{"shasum":"bbc3f76c3a62ed30db7edecd4e1b5ce0249e06e8","tarball":"https://registry.npmjs.org/@boneskull/typedoc-plugin-mermaid/-/typedoc-plugin-mermaid-0.2.0.tgz","fileCount":9,"integrity":"sha512-ggbGNwn6of9ddmOL5/C6+8/REAoqiQ1uyt34AkJxYEev6rZSLBo938rJjHgjodmU3uE7DVptp5fUxAnW1qfVUw==","signatures":[{"sig":"MEQCIAFkAzFiHY/ekwgpsKLmQCtIHJMzIfMK74k0NxQdFitoAiBLFeiFs/skhGsqURewJKVqfv/o/IHGCLhKVhYomADsOQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@boneskull%2ftypedoc-plugin-mermaid@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50432},"knip":{"tags":["-knipignore"],"ignore":["**/*.d.ts",".worktrees/**/*","examples/**/*"],"ignoreDependencies":["markdownlint-cli2-formatter-pretty","mermaid"]},"type":"module","zshy":{"cjs":false,"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"c79a5a03e088e310c34f559c7b03067e43910f55","scripts":{"fix":"run-s -sl fix:*","lint":"run-p -sl --aggregate-output lint:*","test":"run-s test:runtime","build":"zshy","fix:pkg":"npm pkg fix","prepare":"husky; run-s -s build","lint:knip":"knip","commitlint":"commitlint","fix:eslint":"eslint --fix .","lint:types":"tsc --noEmit","test:watch":"node --import tsx --test --test-reporter=spec --watch \"test/**/*.test.ts\"","lint-staged":"lint-staged","lint:eslint":"eslint .","fix:markdown":"markdownlint-cli2 --fix \"**/*.md\"","fix:prettier":"prettier --write . && markdownlint-cli2 --fix \"**/*.md\"","test:runtime":"node --import tsx --test --test-reporter=spec \"test/**/*.test.ts\"","lint:markdown":"markdownlint-cli2 \"**/*.md\"","lint:prettier":"prettier --check .","lint:spelling":"cspell . \"./.*/**\""},"_npmUser":{"name":"boneskull","email":"boneskull@boneskull.com"},"prettier":{"tsdoc":true,"plugins":["prettier-plugin-jsdoc","prettier-plugin-pkg"],"singleQuote":true,"jsdocPreferCodeFences":true,"jsdocCommentLineStrategy":"keep"},"repository":{"url":"git+https://github.com/boneskull/typedoc-plugin-mermaid2.git","type":"git"},"_npmVersion":"11.6.2","description":"TypeDoc plugin for rendering Mermaid diagrams","directories":{},"lint-staged":{"*.md":["markdownlint-cli2 --fix","prettier --write","cspell lint --no-must-find-files"],"*.{ts,js,yml,json5}":["eslint --fix","prettier --write","cspell lint --no-must-find-files"],"**/!(package-lock).json":["eslint --fix","prettier --write","cspell lint --no-must-find-files"]},"_nodeVersion":"24.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.21.0","knip":"5.78.0","zshy":"0.6.0","husky":"9.1.7","bupkis":"0.14.0","cspell":"9.4.0","eslint":"9.39.2","globals":"16.5.0","mermaid":"11.12.2","typedoc":"0.28.15","prettier":"3.7.4","@eslint/js":"9.39.2","typescript":"5.9.3","@types/node":"24.10.4","lint-staged":"16.2.7","npm-run-all2":"8.0.4","@commitlint/cli":"20.2.0","markdownlint-cli2":"0.20.0","typescript-eslint":"8.51.0","eslint-plugin-jsonc":"2.21.0","prettier-plugin-pkg":"0.21.2","prettier-plugin-jsdoc":"1.8.0","@stylistic/eslint-plugin":"5.6.1","eslint-plugin-perfectionist":"5.2.0","@commitlint/config-conventional":"20.2.0","markdownlint-cli2-formatter-pretty":"0.0.9"},"peerDependencies":{"mermaid":">=11.0.0","typedoc":">=0.27.0 || ^0.28.0"},"peerDependenciesMeta":{"mermaid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/typedoc-plugin-mermaid_0.2.0_1768770882115_0.45091276550682347","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@boneskull/typedoc-plugin-mermaid","version":"0.2.1","type":"module","description":"TypeDoc plugin for rendering Mermaid diagrams","repository":{"type":"git","url":"git+https://github.com/boneskull/typedoc-plugin-mermaid2.git"},"author":{"name":"Christopher Hiller","email":"boneskull@boneskull.com","url":"https://boneskull.com/"},"license":"BlueOak-1.0.0","engines":{"node":">=22.0.0"},"types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["diagrams","documentation","mermaid","typedoc","typedoc-plugin"],"scripts":{"build":"zshy","commitlint":"commitlint","fix":"run-s -sl fix:*","fix:eslint":"eslint --fix .","fix:markdown":"markdownlint-cli2 --fix \"**/*.md\"","fix:pkg":"npm pkg fix","fix:prettier":"prettier --write . && markdownlint-cli2 --fix \"**/*.md\"","lint":"run-p -sl --aggregate-output lint:*","lint-staged":"lint-staged","lint:eslint":"eslint .","lint:knip":"knip","lint:markdown":"markdownlint-cli2 \"**/*.md\"","lint:prettier":"prettier --check .","lint:spelling":"cspell . \"./.*/**\"","lint:types":"tsc --noEmit","prepare":"husky; run-s -s build","test":"run-s test:runtime","test:runtime":"node --import tsx --test --test-reporter=spec \"test/**/*.test.ts\"","test:watch":"node --import tsx --test --test-reporter=spec --watch \"test/**/*.test.ts\""},"peerDependencies":{"mermaid":">=11.0.0","typedoc":">=0.27.0 || ^0.28.0"},"peerDependenciesMeta":{"mermaid":{"optional":true}},"devDependencies":{"@commitlint/cli":"20.2.0","@commitlint/config-conventional":"20.2.0","@eslint/js":"9.39.2","@stylistic/eslint-plugin":"5.6.1","@types/jsdom":"27.0.0","@types/node":"24.10.4","bupkis":"0.14.0","cspell":"9.4.0","eslint":"9.39.2","eslint-plugin-jsonc":"2.21.0","eslint-plugin-perfectionist":"5.2.0","globals":"16.5.0","husky":"9.1.7","jsdom":"27.4.0","knip":"5.78.0","lint-staged":"16.2.7","markdownlint-cli2":"0.20.0","markdownlint-cli2-formatter-pretty":"0.0.9","mermaid":"11.12.2","npm-run-all2":"8.0.4","prettier":"3.7.4","prettier-plugin-jsdoc":"1.8.0","prettier-plugin-pkg":"0.21.2","tsx":"4.21.0","typedoc":"0.28.15","typescript":"5.9.3","typescript-eslint":"8.51.0","zshy":"0.6.0"},"publishConfig":{"access":"public"},"knip":{"ignoreDependencies":["markdownlint-cli2-formatter-pretty","mermaid"],"ignore":["**/*.d.ts",".worktrees/**/*","examples/**/*"],"tags":["-knipignore"]},"lint-staged":{"*.{ts,js,yml,json5}":["eslint --fix","prettier --write","cspell lint --no-must-find-files"],"**/!(package-lock).json":["eslint --fix","prettier --write","cspell lint --no-must-find-files"],"*.md":["markdownlint-cli2 --fix","prettier --write","cspell lint --no-must-find-files"]},"prettier":{"jsdocCommentLineStrategy":"keep","jsdocPreferCodeFences":true,"plugins":["prettier-plugin-jsdoc","prettier-plugin-pkg"],"singleQuote":true,"tsdoc":true},"zshy":{"cjs":false,"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"gitHead":"e0eae673fb62d54c562dff1b782590b9d3425047","_id":"@boneskull/typedoc-plugin-mermaid@0.2.1","bugs":{"url":"https://github.com/boneskull/typedoc-plugin-mermaid2/issues"},"homepage":"https://github.com/boneskull/typedoc-plugin-mermaid2#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-Y786WignjXQ0E/PYh75epnsK/YpNTADk7Ol406sE7rS8b3SPdKxoYmAen8XCJrl2ZjQlvHXGdhT+F/VWHYPPlw==","shasum":"4ae55e70a4dea70302873176d9c4eaed68de1134","tarball":"https://registry.npmjs.org/@boneskull/typedoc-plugin-mermaid/-/typedoc-plugin-mermaid-0.2.1.tgz","fileCount":9,"unpackedSize":50867,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@boneskull%2ftypedoc-plugin-mermaid@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHjF7jHhX4s2MQYTek8uw5bf6dPb7A3c3jX2wo7m9upcAiBBcHb8+Y2ol9xeDPjj4dlzKT0fUsaHeq5LX/BogiPgsA=="}]},"_npmUser":{"name":"boneskull","email":"boneskull@boneskull.com"},"directories":{},"maintainers":[{"name":"boneskull","email":"boneskull@boneskull.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/typedoc-plugin-mermaid_0.2.1_1769916135964_0.8073892327704257"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-10T07:09:02.083Z","modified":"2026-02-01T03:22:16.432Z","0.1.0":"2026-01-10T07:09:02.312Z","0.2.0":"2026-01-18T21:14:42.264Z","0.2.1":"2026-02-01T03:22:16.116Z"},"bugs":{"url":"https://github.com/boneskull/typedoc-plugin-mermaid2/issues"},"author":{"name":"Christopher Hiller","email":"boneskull@boneskull.com","url":"https://boneskull.com/"},"license":"BlueOak-1.0.0","homepage":"https://github.com/boneskull/typedoc-plugin-mermaid2#readme","keywords":["diagrams","documentation","mermaid","typedoc","typedoc-plugin"],"repository":{"type":"git","url":"git+https://github.com/boneskull/typedoc-plugin-mermaid2.git"},"description":"TypeDoc plugin for rendering Mermaid diagrams","maintainers":[{"name":"boneskull","email":"boneskull@boneskull.com"}],"readme":"# @boneskull/typedoc-plugin-mermaid\n\n> TypeDoc plugin for rendering Mermaid diagrams\n\nThis plugin transforms Mermaid code blocks in your TypeDoc documentation into\nrendered diagrams. It automatically adapts to TypeDoc's light and dark themes.\n\n## Features\n\n- Renders Mermaid diagrams from fenced code blocks\n- Automatic dark/light theme switching based on TypeDoc theme\n- Graceful fallback to plain code when JavaScript is disabled\n- Loads Mermaid from CDN or locally from your `node_modules`\n- Responsive diagram sizing\n\n## Install\n\n```shell\nnpm install @boneskull/typedoc-plugin-mermaid -D\n```\n\n## Usage\n\nAdd the plugin to your `typedoc.json`:\n\n```json\n{\n  \"ignoredHighlightLanguages\": [\"mermaid\"],\n  \"plugin\": [\"@boneskull/typedoc-plugin-mermaid\"]\n}\n```\n\nThe `ignoredHighlightLanguages` option silences TypeDoc warnings about `mermaid`\nnot being a recognized highlight language (this plugin handles it separately).\n\nOr via command line:\n\n```shell\ntypedoc --plugin @boneskull/typedoc-plugin-mermaid\n```\n\nThen use Mermaid code blocks in your documentation comments:\n\n````typescript\n/**\n * Represents a workflow state machine.\n *\n * ```mermaid\n * stateDiagram-v2\n *   [*] --> Idle\n *   Idle --> Processing: start()\n *   Processing --> Complete: finish()\n *   Processing --> Error: fail()\n *   Complete --> [*]\n *   Error --> Idle: retry()\n * ```\n */\nexport class Workflow {\n  // ...\n}\n````\n\n### Supported Diagram Types\n\nAny diagram type supported by Mermaid works:\n\n- Flowcharts\n- Sequence diagrams\n- Class diagrams\n- State diagrams\n- Entity Relationship diagrams\n- Gantt charts\n- Pie charts\n- And more...\n\nSee the [Mermaid documentation](https://mermaid.js.org/intro/) for all diagram\ntypes and syntax.\n\n## Configuration\n\n### `mermaidSource`\n\nWhere to load the Mermaid library from. Defaults to `\"cdn\"`.\n\n| Value     | Description                                                      |\n| --------- | ---------------------------------------------------------------- |\n| `\"cdn\"`   | Load from a CDN URL (configured via `mermaidCdnUrl`)             |\n| `\"local\"` | Copy mermaid's ESM bundle from `node_modules` to the docs output |\n\n**typedoc.json:**\n\n```json\n{\n  \"mermaidSource\": \"local\"\n}\n```\n\nWhen using `\"local\"`, you must install mermaid in your project:\n\n```shell\nnpm install mermaid -D\n```\n\nThe plugin copies mermaid's ESM entry point and chunks directory to\n`assets/mermaid/` in your docs output. Diagram-specific code is lazy-loaded on\ndemand, so only the diagram types you actually use are downloaded by browsers.\n\n**Use `\"local\"` when you need:**\n\n- Offline documentation\n- Air-gapped or restricted network environments\n- Pinned mermaid versions bundled with your docs\n- Full control over the mermaid distribution\n\n### `mermaidCdnUrl`\n\nURL to load the Mermaid library from. Defaults to\n`https://unpkg.com/mermaid@latest/dist/mermaid.esm.min.mjs`.\n\nOnly used when `mermaidSource` is `\"cdn\"` (the default).\n\nThis is useful for using alternative CDNs or self-hosting the library.\n\n**typedoc.json:**\n\n```json\n{\n  \"mermaidCdnUrl\": \"https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs\"\n}\n```\n\n**Command line:**\n\n```shell\ntypedoc --mermaidCdnUrl \"https://your-cdn.example.com/mermaid.esm.min.mjs\"\n```\n\n## How It Works\n\nThe plugin hooks into TypeDoc's HTML rendering pipeline and:\n\n1. Finds `<pre><code class=\"mermaid\">` blocks in the output\n2. Wraps them in a container with both dark and light themed versions\n3. Injects CSS and JavaScript to render diagrams and switch themes\n4. Preserves the original code as a fallback for non-JS environments\n\nDiagrams are rendered client-side using the Mermaid library, loaded either from\na CDN or from a local copy in your docs output (depending on `mermaidSource`).\n\n## Acknowledgments\n\nThis plugin is adapted from\n[typedoc-plugin-mermaid](https://github.com/kamiazya/typedoc-plugin-mermaid) by\n[kamiazya](https://github.com/kamiazya).\n\n### Differences from the Original\n\n| Feature               | This Plugin                                 | kamiazya/typedoc-plugin-mermaid |\n| --------------------- | ------------------------------------------- | ------------------------------- |\n| TypeDoc version       | 0.27+                                       | 0.22–0.26                       |\n| Rendering strategy    | Dual dark/light diagrams with CSS switching | Single diagram per block        |\n| Theme support         | Automatic dark/light based on TypeDoc theme | Manual theme configuration      |\n| `@mermaid` JSDoc tag  | Not supported                               | Supported                       |\n| Mermaid loading       | CDN or local ESM bundle with lazy chunks    | Bundled UMD or CDN              |\n| Offline support       | Yes (with `mermaidSource: \"local\"`)         | Yes (when bundled)              |\n| Configuration options | `mermaidSource`, `mermaidCdnUrl`            | `mermaidVersion`, `mermaidCdn`  |\n\n**Why a new plugin?**\n\nThe original plugin stopped working with TypeDoc 0.27+ due to breaking API\nchanges and appears unmaintained.\n\n## License\n\nCopyright © 2026 [Christopher \"boneskull\" Hiller](https://github.com/boneskull). Licensed\n[BlueOak-1.0.0](https://blueoakcouncil.org/license/1.0.0).\n","readmeFilename":"README.md"}