2 ms·
I wrote a script which preprocesses the .md file, passes certain sections to shell scripts, and inserts the result of the script back into the .md file. It's v
by chubot 8y ago
I wrote a script which preprocesses the .md file, passes certain sections to shell scripts, and inserts the result of the script back into the .md file.
It's very much a Unix stdin-stdout thing. My whole blog [1] uses this, especially the code examples highlighted with pygments, and also links to the glossary, etc.
I dumped a snapshot here [2] awhile ago. It may or may not be of use if asciidoc already works for you.
The bad thing about this format is that it's not pure markdown anymore, so Vim syntax highlighting gets messed up sometimes. If I had to do it again, I would probably try to hook into a CommonMark [3] library to parse HTML blocks. So basically certain <div></div> blocks would get transformed into others.
How does asciidoc do it?
[1] http://www.oilshell.org/blog/ http://www.oilshell.org/blog/
[2] https://github.com/oilshell/blog-code/tree/master/tools-snapshot https://github.com/oilshell/blog-code/tree/master/tools-snap...
[3] http://www.oilshell.org/blog/2018/02/14.htm http://www.oilshell.org/blog/2018/02/14.htm