News for hackers. Stuff that matters.
Re:TeXMe Self-rendering Markdown and LaTeX documents by Cyykratahk on Sunday September 20, 2020 @08:59AM (#24533747)
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.

    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/[email protected]"></script>
    <style>body > main { white-space: normal; }</style>
    <body style="white-space: pre-line;">

There are no comments on this comment yet.