3 ms·
There are tools to do exactly that, like a simple bash scripts lit.sh: https://github.com/vijithassar/lit https://github.com/vijithassar/lit Pandoc is a nice s
by qbasic_forever 3y ago
There are tools to do exactly that, like a simple bash scripts lit.sh: https://github.com/vijithassar/lit https://github.com/vijithassar/lit
Pandoc is a nice swiss army knife that can do a similar conversion with some custom lua filters. It could even do wackier stuff like convert word or odt files to code if you were really diving into prose-first coding.
I've also heard it referred to as 'semi-literate programming' because it skips the reorganization functionality and just gives you nice prose to code conversion.
- mjw1007 3y agoAs long as these are external tools, IDEs and things like github's default file renderer aren't going to understand what's going on.
- qbasic_forever 3y agoYeah that's why lit.sh and most similar tools have a mode to output a version of the file with the markdown commented out except for code blocks. This lets you pipe it into any tool and get output with proper line numbers, analysis, etc. VS code is getting pretty smart about code notebooks too, it has native support for a few different formats of markdown + code blocks (hydrogen, jupyter, etc) and applies all the right syntax highlighting, analysis, etc. to each block automatically.