From 2e2031ed4c3e7ba39cdda4210551881a389da9d6 Mon Sep 17 00:00:00 2001 From: kamiazya Date: Thu, 7 Apr 2022 01:18:42 +0900 Subject: [PATCH] feat: add mermaid version option --- README.md | 18 +++++++++++++++ src/index.ts | 2 +- src/plugin.ts | 31 +++++++++++++++++++------- test/__snapshots__/plugin.test.ts.snap | 2 +- test/plugin.test.ts | 7 ++++-- 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a141f0e..69ead1a 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,24 @@ export class Mermaid { } [![Example](./media/example.png)](https://kamiazya.github.io/typedoc-plugin-samples/classes/hoge.html) +### Arguments + +The following arguments can be used in addition to the default TypeDoc arguments. + +```bash +$ typedoc --help +... +Options: + --mermaidVersion [Mermaid Plugin] The version of mermaid.js to use. +... +``` + +- `--mermaidVersion` + + Specify mermaid.js version to use. + + Default: `latest`, Example: `8.14.0` + ## Contributors Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): diff --git a/src/index.ts b/src/index.ts index fdd35ad..2899870 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,5 +2,5 @@ import { Application } from 'typedoc'; import { MermaidPlugin } from './plugin'; export function load(app: Application): void { - new MermaidPlugin().addToApplication(app); + new MermaidPlugin(app).initialize(); } diff --git a/src/plugin.ts b/src/plugin.ts index 4f49a48..ae76815 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,5 +1,5 @@ import * as html from 'html-escaper'; -import { Converter, Context, PageEvent, Application, ReflectionKind, MarkdownEvent } from 'typedoc'; +import { Converter, Context, PageEvent, Application, ReflectionKind, MarkdownEvent, ParameterType } from 'typedoc'; const style = String.raw`
- +