77 points · by harporoeder · 6y ago · 15 comments
location ~* /markdown/.*\.md$ {
add_before_body "/markdown/header.html";
types {}
default_type text/html;
}
And a little bit of CSS to keep the line breaks if the JS is disabled: <!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;">https://news.ycombinator.com/item?id=23491587
(Make sure you're viewing in a fullscreen browser window.)
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.
Thank you for reporting this issue and especially for posting your investigation details on this issue at https://github.com/susam/texme/issues/9.
I have now added support for a special purpose environment named "md" to TeXMe. This environment protects LaTeX delimiters ($, $$, etc.) within Markdown code blocks and code spans. More details about this feature is available at the following two URLs:
- https://github.com/susam/texme/issues/9#issuecomment-6994876...
- https://github.com/susam/texme/blob/6213f86/README.md#markdo...
<!DOCTYPE html><script src="https://cdn.jsdelivr.net/npm/texme@0.7.0"></script><textarea>
# Euler's Identity
In mathematics, **Euler's identity** is the equality
$$ e^{i \pi} + 1 = 0. $$
To read more, [click here](bar.html).
The last line in the above example contains a link to a file named bar.html in the same directory.