mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +08:00
feat(mermaid): support ELK diagrams in editor
This commit is contained in:
parent
482cb46afa
commit
e3c8c0c1f2
@ -58,7 +58,10 @@ const FORCE_GRAPH = {
|
||||
};
|
||||
|
||||
const MERMAID = {
|
||||
js: [ "node_modules/mermaid/dist/mermaid.min.js" ]
|
||||
js: [
|
||||
"node_modules/mermaid/dist/mermaid.min.js",
|
||||
"libraries/mermaid-elk/elk.min.js"
|
||||
]
|
||||
}
|
||||
|
||||
const EXCALIDRAW = {
|
||||
|
@ -61,6 +61,7 @@ export default class MermaidWidget extends NoteContextAwareWidget {
|
||||
const documentStyle = window.getComputedStyle(document.documentElement);
|
||||
const mermaidTheme = documentStyle.getPropertyValue('--mermaid-theme');
|
||||
|
||||
mermaid.registerLayoutLoaders(MERMAID_ELK);
|
||||
mermaid.mermaidAPI.initialize({
|
||||
startOnLoad: false,
|
||||
theme: mermaidTheme.trim(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user