| 1 | import type { ExternalDiagramDefinition } from 'mermaid'; |
| 2 | |
| 3 | const id = 'zenuml'; |
| 4 | |
| 5 | const detector = (txt: string) => { |
| 6 | return /^\s*zenuml/.test(txt); |
| 7 | }; |
| 8 | |
| 9 | const loader = async () => { |
| 10 | const { diagram } = await import('./zenuml-definition.js'); |
| 11 | return { id, diagram }; |
| 12 | }; |
| 13 | |
| 14 | const plugin: ExternalDiagramDefinition = { |
| 15 | id, |
| 16 | detector, |
| 17 | loader, |
| 18 | }; |
| 19 | |
| 20 | export default plugin; |
| 21 |