21 lines
403 B
TypeScript
Raw Normal View History

import type { ExternalDiagramDefinition } from 'mermaid';
2022-10-07 10:40:01 +02:00
const id = 'example-diagram';
const detector = (txt: string) => {
return txt.match(/^\s*example-diagram/) !== null;
};
2022-10-07 10:40:01 +02:00
const loader = async () => {
const { diagram } = await import('./diagram-definition.js');
2022-10-07 10:40:01 +02:00
return { id, diagram };
};
const plugin: ExternalDiagramDefinition = {
id,
detector,
loader,
};
export default plugin;