# Self Rendered Markdown Docs I wrote up some research and background on JavaScript libraries that can be included to "self render" Markdown documents. That is, you are authoring a plain text file in Markdown, and can add a script tag so that the file doesn't have to be processed or rendered by an external app. The document is rendered on the fly by the script from Markdown to HTML and displayed in the browser. This is interesting for people that already write a lot of Markdown and related markup who want to make their files very portable. This index file is rendered using **TeXme**, so we kind of found our winner already? I am bad at javascript, so I'm sure there are ways to setup these various libraries to render like TeXme, but there are no default examples with it. ## Examples You can [browse the examples folder directly](examples/), or use the links below to jump straight to one of the libraries. ### [TeXme](examples/texme.html) > TeXMe is a lightweight JavaScript utility to create self-rendering Markdown + LaTeX documents. There was an open textarea tag at the top which I removed, and the rest of the document had spaces which made the whole thing wrapped in `pre` tag. I deleted all the spaces and then it rendered. * `blockquote` tags aren't rendering? * fancy math equations! * supports LaTeX * looks like a scientific whitepaper ### [Showdown](examples/showdown.html) > Showdown is a Javascript Markdown to HTML converter, based on the original works by John Gruber. Showdown can be used client side (in the browser) or server side (with NodeJS). I just included the `textarea` based converter as is. Haven't found an example of self rendering. ### [Markdown-It](examples/markdown-it.html) Copied files from the [demo](https://github.com/markdown-it/markdown-it.github.io). Included script from [cdnjs](https://cdnjs.com/libraries/markdown-it). ### [Marked](examples/marked.html) That link doesn't work :) I was attempting to glue in the quickref file and load it in. There's a [demo](https://marked.js.org/demo) that I got the quickref content from. ### [Remark](examples/remark.html) ["The world's most popular Markdown parser"](https://www.npmtrends.com/remark-parse-vs-marked-vs-markdown-it): links to an npm trends chart, remark has ~4.3M downloads, Marked is in second place ~3.75M, and Markdown-It is in third with ~1.5M. ### [Markdown WASM](examples/markdown-wasm.html) WASM! Turns out I have to figure out how to [fetch and load a WASM](https://developer.mozilla.org/en-US/docs/WebAssembly/Loading_and_running).