Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: TeXMe – Create self-rendering Markdown + LaTeX documents (github.com/susam)
75 points by susam on May 30, 2021 | hide | past | favorite | 14 comments


"...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?


Have a look at TeX4ht: https://tug.org/tex4ht/.


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?

https://github.com/susam/texme#self-hosting-texme


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?


I am not sure how close pandoc comes to your requirements?

https://pandoc.org/


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.

[1] https://github.com/joeyespo/grip


I use a CSS [0] to style the rendered output from markdown-it [1]. It works pretty well for me.

[0] https://github.com/sindresorhus/github-markdown-css

[1] https://github.com/markdown-it/markdown-it


Pandoc + a good HTML template should get you there.


An intriguing idea. Very nice. Will study further.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: