News for hackers. Stuff that matters.
Re:Math on GitHub: Following Up by infogulch on Tuesday June 28, 2022 @03:40PM (#31912083)
I really don't like overloading ```X as a way to render the output of running the code, because now you have no way to display a block of raw mermaid or math code which is the whole point of ``` in the first place. I would be much happier if they introduced a syntax variation to enable this feature more generally instead of overloading the purpose of backticks, something like ```!X (```!math or ```!mermaid) for "run the contents as X and render the output in the document".
Re:Math on GitHub: Following Up by thangalin on Tuesday June 28, 2022 @05:54PM (#31913540)
KeenWrite[1] uses a "diagram-" prefix for text-based diagrams[2]. What's needed is a standards body for Markdown[3]. GitHub should not be imposing de facto standards.

[1]: https://github.com/DaveJarvis/keenwrite

[2]: https://kroki.io/

[3]: https://talk.commonmark.org/

Re:Math on GitHub: Following Up by rustyminnow on Tuesday June 28, 2022 @04:42PM (#31912749)
I was confused about your comment at first - I was sure it was already a feature where you could use ```X to render the contents with a language. E.g. you could go ```java or ```javascript and get syntax highlighting for that language.

What you're saying is since ```mermaid now renders a mermaid diagram, there isn't a way to display a block of raw mermaid code with syntax highlighting.

That's a very valid point.

Re:Math on GitHub: Following Up by whatshisface on Tuesday June 28, 2022 @04:59PM (#31912938)
They could add a ```mermaid-source tag.
Re:Math on GitHub: Following Up by infogulch on Tuesday June 28, 2022 @05:34PM (#31913307)
I agree my comment was difficult to understand, so I edited it to hopefully make it better. Thank you!
Re:Math on GitHub: Following Up by ratmice on Tuesday June 28, 2022 @06:16PM (#31913795)
The simple fix for this is that you should use "```math render" or some such, the language is specified as the first word with everything after the space up to the newline currently ignored...
Re:Math on GitHub: Following Up by infogulch on Tuesday June 28, 2022 @06:33PM (#31913957)
> everything after the space up to the newline currently ignored

Oh I didn't know that, that's perfect!

Re:Math on GitHub: Following Up by nschloe on Wednesday June 29, 2022 @05:02AM (#31917875)
The big advantage of using code blocks is that is guarantees that their sanitizer doesn't mess with the contents. This is a pretty big plus.

Also, you can of course still have mermaid code blocks; just don't put `mermaid` after the three backticks. The code block won't have any syntax highlighting, but in the case of `math`, this wouldn't make sense anyway.