added mermaid samples to demo document

This commit is contained in:
zadam 2021-09-30 13:17:37 +02:00
parent a68fd5ab83
commit 291b434d70
5 changed files with 15 additions and 34 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -278,7 +278,7 @@ export default class ApperanceOptions {
this.$themeSelect.val(options.theme);
this.$overrideThemeFonts.prop('checked', options.overrideThemeFonts);
this.$overrideThemeFonts.prop('checked', options.overrideThemeFonts === 'true');
this.$overridenFontSettings.toggle(options.overrideThemeFonts === 'true');
this.$mainFontSize.val(options.mainFontSize);
@ -290,8 +290,6 @@ export default class ApperanceOptions {
this.$detailFontSize.val(options.detailFontSize);
this.fillFontFamilyOptions(this.$detailFontFamily, options.detailFontFamily);
console.log(options);
this.$monospaceFontSize.val(options.monospaceFontSize);
this.fillFontFamilyOptions(this.$monospaceFontFamily, options.monospaceFontFamily);
}

View File

@ -94,6 +94,11 @@ async function getRenderedContent(note, options = {}) {
.css("display", "flex")
.css("justify-content", "space-around");
const documentStyle = window.getComputedStyle(document.documentElement);
const mermaidTheme = documentStyle.getPropertyValue('--mermaid-theme');
mermaid.mermaidAPI.initialize({ startOnLoad: false, theme: mermaidTheme.trim() });
try {
mermaid.mermaidAPI.render("in-mermaid-graph-" + idCounter++, content,
content => $renderedContent.append($(content)));

View File

@ -48,6 +48,8 @@ export default class MermaidWidget extends NoteContextAwareWidget {
const documentStyle = window.getComputedStyle(document.documentElement);
const mermaidTheme = documentStyle.getPropertyValue('--mermaid-theme');
console.log(mermaidTheme, "mermaidTheme");
mermaid.mermaidAPI.initialize({ startOnLoad: false, theme: mermaidTheme.trim() });
const noteComplement = await froca.getNoteComplement(note.noteId);