mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
21 lines
403 B
TypeScript
21 lines
403 B
TypeScript
import type { ExternalDiagramDefinition } from 'mermaid';
|
|
|
|
const id = 'example-diagram';
|
|
|
|
const detector = (txt: string) => {
|
|
return txt.match(/^\s*example-diagram/) !== null;
|
|
};
|
|
|
|
const loader = async () => {
|
|
const { diagram } = await import('./diagram-definition.js');
|
|
return { id, diagram };
|
|
};
|
|
|
|
const plugin: ExternalDiagramDefinition = {
|
|
id,
|
|
detector,
|
|
loader,
|
|
};
|
|
|
|
export default plugin;
|