7 ms·
Does anybody know if a similar thing exists that renders out markdown without LaTeX? That'd be a neat way to quickly create documentation websites for open sou
by mxstbr 8y ago
Does anybody know if a similar thing exists that renders out markdown without LaTeX?
That'd be a neat way to quickly create documentation websites for open source projects!
- enriquto 8y agofor simple documents, you can write html directly, is is not a hassle at all.
- dspillett 8y agoOften one use case for markdown is reuse. The same text with markdown might go in code comments or a readme file (staying as plain text with markdown), presented with HTML markup in a browser, converted to a page description format (for instance PDF) for read-only distribution, etc. If you write the document with HTML markup you then lose this flexibility.
- enriquto 8y ago> If you write the document with HTML markup you then lose this flexibility. How so? HTML can be always embedded inside markdown
- dspillett 8y agoBut then you don't have the simplicity of markdown. If you are going to write HTML then I'd use a subset of that and convert to everything else (including markdown if desired).
- acqq 8y agoThe same project has this option, read the readme.
- dspillett 8y agoThe documentation suggests this library has the option to skip the extra mathematical rendering if that is all you need: > Render Markdown Without MathJax > To render Markdown-only content without any mathematical content at all ...
- susam 8y agoYes, TeXMe does it. Here is a minimal example: <!DOCTYPE html> <script>window.texme = { useMathJax: false, protectMath: false }</script> <script src="https://cdn.jsdelivr.net/npm/texme"></script><textarea> ### Atomic Theory Atomic theory is a scientific theory of the nature of matter, which states that matter is composed of discrete units called atoms. It began as a philosophical concept in ancient Greece and entered the scientific mainstream in the early 19th century when discoveries in the field of chemistry showed that matter did indeed behave as if it were made up of atoms. Right now, it requires a few more lines of HTML code to disable MathJax related processing. I am planning to add a simpler mechanism later, so that something like merely appending "?markme" to the TeXMe URL in the <script> tag is enough to set it to Markdown-only mode. If anyone has a better idea regarding this, please let me know or send a pull request.
- tomer_shalev 8y agoDoesn't this solution also loads all the code for rendering math? Maybe a separate, smaller, library would be a better solution.
- susam 8y agoThanks to your suggestion, I have now created a separate, smaller, library named MdMe: https://github.com/susam/mdme https://github.com/susam/mdme. This is a stripped down fork of TeXMe that does not contain any code for MathJax related processing. Here is a minimal example: <!DOCTYPE html><script src="https://cdn.jsdelivr.net/npm/mdme@0.1.0"></script><textarea> # Atomic Theory **Atomic theory** is a scientific theory of the nature of matter, which states that matter is composed of discrete units called *atoms*. This is absolutely fresh--published only a few minutes ago. If you find any issues, please report it. I hope you like this.
- akavel 8y agoMaybe you could do it the other way round now? Adding a ?withmath to url would add math rendering :)
- mrec 8y agoMaybe take a look at Strapdown.js, discussed here 4 months ago. I'm sure there are others too. https://news.ycombinator.com/item?id=17321599 https://news.ycombinator.com/item?id=17321599
- susam 8y agoNow we have https://github.com/susam/mdme https://github.com/susam/mdme too (a stripped down fork of TeXMe), thanks to a suggestion on this thread.
- mrec 8y agoThis looks nice; I'll have a play when I have some time. One thing that's not immediate clear from the examples: how (if at all) are you avoiding Flash-Of-Unstyled-Content on initial load? Might it be better to put the markdown in a <noscript> block rather than (or as well as) a <textarea> when editing isn't required?
- wahern 8y agoMarkdeep - https://casual-effects.com/markdeep/ https://casual-effects.com/markdeep/