mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 00:40:22 +02:00
docs:Improved keywords in index.html
This commit is contained in:
@@ -29,7 +29,7 @@
|
|||||||
src="https://plausible.io/js/plausible.js"
|
src="https://plausible.io/js/plausible.js"
|
||||||
></script>
|
></script>
|
||||||
<script>
|
<script>
|
||||||
var require = {
|
let require = {
|
||||||
paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.29.1/min/vs' },
|
paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.29.1/min/vs' },
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -51,16 +51,16 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script>
|
<script>
|
||||||
var initEditor = exports.default;
|
let initEditor = exports.default;
|
||||||
var parser = new DOMParser();
|
let parser = new DOMParser();
|
||||||
var currentCodeExample = 0;
|
let currentCodeExample = 0;
|
||||||
var colorize = [];
|
let colorize = [];
|
||||||
|
|
||||||
function colorizeEverything(html) {
|
function colorizeEverything(html) {
|
||||||
initEditor(monaco);
|
initEditor(monaco);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
monaco.editor.setTheme('mermaid');
|
monaco.editor.setTheme('mermaid');
|
||||||
var parsed = parser.parseFromString(html, 'text/html').body;
|
let parsed = parser.parseFromString(html, 'text/html').body;
|
||||||
Promise.all(
|
Promise.all(
|
||||||
[...parsed.querySelectorAll('pre[id*="code"]')].map((codeBlock) =>
|
[...parsed.querySelectorAll('pre[id*="code"]')].map((codeBlock) =>
|
||||||
monaco.editor.colorize(codeBlock.innerText, 'mermaid')
|
monaco.editor.colorize(codeBlock.innerText, 'mermaid')
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
function (hook, vm) {
|
function (hook, vm) {
|
||||||
hook.beforeEach(function (html) {
|
hook.beforeEach(function (html) {
|
||||||
url = 'https://github.com/mermaid-js/mermaid/blob/develop/src/docs/' + vm.route.file;
|
url = 'https://github.com/mermaid-js/mermaid/blob/develop/src/docs/' + vm.route.file;
|
||||||
var editHtml = '[:memo: Edit this Page](' + url + ')\n';
|
const editHtml = '[:memo: Edit this Page](' + url + ')\n';
|
||||||
return editHtml + html;
|
return editHtml + html;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
var num = 0;
|
let num = 0;
|
||||||
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||||
|
|
||||||
const conf = {
|
const conf = {
|
||||||
|
Reference in New Issue
Block a user