Another similar script is <a href="http://casual-effects.com/markdeep/" rel="nofollow">http://casual-effects.com/markdeep/</a> which has a pretty wide set of features for ASCII art. With some slight tweaking, it can be used to embed markdown inside normal HTML+JS docs so I've been using it for some of my personal notes.
What a great idea. This lets me skip the md->html conversion step. Which means I can edit equations interactively by just cmd-R'ing in the browser, and share md files with people without telling them what tool to use to render.
This script could be automatically injected before .md files using the nginx directive add_before_body. An instant static site of markdown files with no preprocessing step.<p><pre><code> location ~* /markdown/.*\.md$ {
add_before_body "/markdown/header.html";
types {}
default_type text/html;
}
</code></pre>
And a little bit of CSS to keep the line breaks if the JS is disabled:<p><pre><code> <!DOCTYPE html><script src="https://cdn.jsdelivr.net/npm/texme@0.7.0"></script>
<style>body > main { white-space: normal; }</style>
<body style="white-space: pre-line;"></code></pre>
A lot of these scripts that focus on rendering just wrap around mathjax/katex and md processors that do the actual heavy lifting. To me the real innovation needed to advance math authoring lies in processing cross references. Browser tech has yet to be fully utilized to present arguments in a manner that best facilitates reading instead of the linear fashion that comes from the constraint of printed documents. To be sure there are some work done in this direction in online open textbooks, but the tools and formats are too heavy for wide adoption.
I really liked this because it's easy to save that line as a snippet in your text editor. It's a process of creating a new html file, inserting the snippet, and typing away.<p>Unfortunately, my usage came to a quick end when I discovered dollar signs in code are treated as math. It would have to switch from the Commonmark library to something like markdown-it that has a full set of features.