Interesting. I was thinking about something similar. I thought we can extract doc-strings and function source from any namespace and put them together in a string in MD format. Export in to a markdown file to read at leisure.
Do not break the syntax of any programming language, you can compile directly.
you only need a single line of regular replacement preprocessing, then you can use any Markdown parse or converter.
Support any code editor that supports Markdwon Live preview, allowing the source code of any programming language to become rich text in real time. In the code’s comment area, You can use the markdown to draw flowcharts, tables, task lists, and display images on the live preview panel, enhance the readability of your code.
If you extend the Markdwon tag, you can implement the eval code, print result, display data visualization and other instruction tags, to achieve live programming, live test.
You could probably set this up with inotify and marginalia - so that each time you save your file it would regenerate the HTML and then it’d autorefresh in your browser window?
I’ve found running marginalia slow, so you’d need to find a way to speed things up by maybe having it run as some daemon
I do really like it’s side-by-side layout though and I use it in shorter programs where orgmode is overkill. And I do feel the layout is better than the traditional literate/org-mode vertical layout.
That all being said - I’ve never used live-preview while writing literate programs. I find that with the right highlighting it’s basically just as nice to stick to the raw text-form. Some emacs themes seem to extend org-mode’s highlighting so that it’s all visually easier to parse
So I feel the most pragmatic solution would just be a syntax highlighting layer on top of the existing Clojure one that would highlight the comment areas appropriately (which would be still written in a markdown/marginalia style). Something so it’s not all just light grey, but similar to the way text is highlighted in org, and then visually separate the code section with like a separate background or something to that effect. I think that’d get you 80% to where you want.
But the way things are right now, it’s a bit of an eyesore writing big grey code comment blocks