diff --git a/markdown_renderer/index.html b/markdown_renderer/index.html index 02bae57..e94bf7d 100644 --- a/markdown_renderer/index.html +++ b/markdown_renderer/index.html @@ -10,12 +10,59 @@ -
- -
+
diff --git a/markdown_renderer/index.js b/markdown_renderer/index.js deleted file mode 100644 index ee2ad31..0000000 --- a/markdown_renderer/index.js +++ /dev/null @@ -1,44 +0,0 @@ -const mark = /==([^=]*)==/gm; -const marksubst = `$1`; -const boxu = / \[( )\] /gim; -const boxusubst = ` `; -const boxc = / \[(x)\] (.*)/gim; -const boxcsubst = ` ~~$2~~`; -const link = /\[\[(.*)\]\]/gm; -const linksubst = `$1`; -var filename = decodeURI(window.location.search.replace("?", "")); -const done = new Event("done"); -if (filename == "") filename = "Main"; -fetch( - "https://raw.githubusercontent.com/jktechs/pxt-jannick/master/.obsidian/snippets/theme.css" -) - .then((x) => x.text()) - .then((x) => (document.getElementById("theme").innerHTML = x)); - -fetch( - "https://raw.githubusercontent.com/jktechs/pxt-jannick/master/" + - filename + - ".md" -) - .then((x) => x.text()) - .then((x) => { - document.getElementById("markdown").innerHTML = CmarkGFM.convert( - ("# " + filename + "\n" + x) - .replace(mark, marksubst) - .replace(boxu, boxusubst) - .replace(boxc, boxcsubst) - .replace(link, linksubst) - ); - Prism.highlightAll(); - for (i of document.getElementsByTagName("pre")) { - if (i.className == "language-mermaid") { - i.className = "mermaid"; - i.innerHTML = i.children[0].innerHTML; - } - } - document.body.dispatchEvent(done); - //mermaid.initialize({ startOnLoad: true }); - //for (const a of document.getElementsByTagName("a")) { - // console.log(a.id); - //} - });