News for hackers. Stuff that matters.
Re:Markdown, Asciidoc, or reStructuredText – a tale of docs-... by benatkin on Friday November 04, 2022 @01:20PM (#33470340)
Markdown can literally be code. RMarkdown is this. Before I learned of RMarkdown I had written something to extract code blocks with filenames that are visible in the rendered page (since hiding it at the end of the first triple backquote codefence isn't great for visibility). I'm currently working on a notebook tool. https://github.com/ResourcesCo/macchiato/blob/main/scripts/m... https://github.com/ResourcesCo/notebook
Re:Markdown, Asciidoc, or reStructuredText – a tale of docs-... by euroderf on Friday November 04, 2022 @02:54PM (#33471876)
> Markdown can simply be code - the fenced code blocks are quite enjoyable to work with.

Hmm, if a Markdown file can have code interspersed, then can't a code file have Markdown interspersed, and the two interpretations of the file could in some sense be symmetric - and equally valid ?

Obv such "interspersions" exist in certain implementations, but I don't think such symmetries do, nor is there anything like a "standard" for it.

Literate programming using Markdown - who'da thunk it ?

Someone pls correct me if I'm OTL.

Re:Markdown, Asciidoc, or reStructuredText – a tale of docs-... by cratermoon on Friday November 04, 2022 @04:16PM (#33473145)
Isn't that essentially what Jupyter does?
Re:Markdown, Asciidoc, or reStructuredText – a tale of docs-... by benatkin on Friday November 04, 2022 @04:27PM (#33473320)
It's in JSON at least by default. Here's an example: https://github.com/tensorflow/examples/blob/master/courses/u...
Re:Markdown, Asciidoc, or reStructuredText – a tale of docs-... by cratermoon on Friday November 04, 2022 @07:32PM (#33475608)
Ah yes, it's stored as JSON, but look at all those "cell_type": "markdown", interspersed with the code cells. From the standpoint of a user, a Jupyter notebook code and markdown interspersed.
Re:Markdown, Asciidoc, or reStructuredText – a tale of docs-... by benatkin on Friday November 04, 2022 @04:24PM (#33473280)
Yes, but support for showing the Markdown version is much more widespread.

observablehq puts Markdown in JavaScript code.

I think it works better with Markdown even if it wasn't supported in multiple places, but since it does, I think having Markdown be the container format is a clear winner.

There is also MDX but I prefer stuff that displays in the rendered view as well as in the source. Of course the renderers can change, but that's slow.

As for inverting them without losing the data, that seems possible and would be interesting to see.