diff --git a/package.json b/package.json
index 979f105..b843bea 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,7 @@
"html-escaper": "^3.0.0"
},
"peerDependencies": {
- "typedoc": ">=0.21.0"
+ "typedoc": ">=0.22.0"
},
"devDependencies": {
"@types/html-escaper": "^3.0.0",
@@ -56,7 +56,7 @@
"rollup": "^2.53.3",
"rollup-plugin-typescript2": "^0.30.0",
"ts-jest": "^27.0.4",
- "typedoc": "^0.21.4",
+ "typedoc": "^0.22.6",
"typescript": "^4.3.5"
}
}
diff --git a/src/index.ts b/src/index.ts
index f608988..fdd35ad 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,14 +1,6 @@
-import { Application } from 'typedoc/dist/lib/application';
+import { Application } from 'typedoc';
import { MermaidPlugin } from './plugin';
-export function load(PluginHost: Application): void {
- const app = PluginHost.owner;
- if (app.converter.hasComponent('mermaid')) {
- return;
- }
-
- /**
- * Add the plugin to the converter instance
- */
- app.converter.addComponent('mermaid', new MermaidPlugin(app.converter));
+export function load(app: Application): void {
+ new MermaidPlugin().addToApplication(app);
}
diff --git a/src/plugin.ts b/src/plugin.ts
index 5018c6b..54b0d90 100644
--- a/src/plugin.ts
+++ b/src/plugin.ts
@@ -1,155 +1,85 @@
import * as html from 'html-escaper';
-import { Converter } from 'typedoc/dist/lib/converter';
-import { Component, ConverterComponent } from 'typedoc/dist/lib/converter/components';
-import { Context } from 'typedoc/dist/lib/converter/context';
-import { Comment, CommentTag } from 'typedoc/dist/lib/models/comments';
-import { MarkdownEvent, PageEvent } from 'typedoc/dist/lib/output/events';
+import { Converter, Context, PageEvent, Application, ReflectionKind } from 'typedoc';
/**
- * Mermaid plugin component.
+ * 1. Load mermaid.js library.
+ * 2. Initialize mermaid.
*/
-@Component({ name: 'mermaid' })
-export class MermaidPlugin extends ConverterComponent {
- /**
- * 1. Load mermaid.js library.
- * 2. Initialize mermaid.
- * 3. Close body tag.
- */
- private static customScriptsAndBodyClosingTag = `
-
-
-