One can render a Markdown file on a static site client-side using the code below.
<div id="txt"></div>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
fetch("https://raw.githubusercontent.com/ccharles/pages-test/master/markdown.md")
.then(r=>r.blob()).then(b=>b.text()).then(m=>{document.getElementById("txt").innerHTML=marked.parse(m)})
</script>
I found there are two ways to embed a URL in another URL. However, I couldn't figure out how to pass the Markdown file URL as a parameter to the Marked.js URL. Can one add a Markdown file URL to the GET parameter of a library URL to render Markdown to HTML client side using this or any other library? Something like this..
https://cdn.jsdelivr.net/npm/marked/marked.min.js?MDUri=https://raw.githubusercontent.com/ccharles/pages-test/master/markdown.md
@chris