"...In practice though, it is not necessary to write verbose code like this. All browsers follow the robustness principle..."
I don't quite like this line-- pointing out that others are following the robustness principle, so we needn't bother.
That README.md is a model piece of doc. Nice work!
Out of curiosity, is there anything modern like the reverse of this project -- write LaTeX (e.g. with a `tufte` documentclass) and end up with a beautiful, similarly rendered webpage?
Not possible in general (TeX is a programming language), but there are plenty of projects that try to translate a subset of TeX/LaTeX into HTML that sort of approximates what the rendered TeX document looks like. A better approach is to write in Pandoc-flavored markdown and convert to HTML, TeX, etc.
Spoiler: No self-rendering; the rendering is by a script sourced at cdn.jsdelivr.net . Thus, for example, no rendering offline, or if that website goes away.
But it's a neat trick nonetheless...
Does the Self-Hosting heading not answer that objection?
Not exactly... it's not that your document will be self-rendering, it's an external script that renders it. It's nice that you can self-host it though.
Is there something like this that renders markdown to GitHub readme-style HTML?
Pandoc + a good HTML template should get you there.
I am not sure how close pandoc comes to your requirements?
There's an open-source project called grip [1] that can render markdown to HTML that looks almost identical to the GitHub rendering. It can do either live preview or export to HTML. I use it for previewing GitHub READMEs while I edit them, and it does an excellent job for that purpose.