3 ms·
This reminds me of “Pastek”, a markdown-inspired language created by a friend of mine which supports the inclusion of the output of some code run through an ext
by hk__2 12y ago
This reminds me of “Pastek”, a markdown-inspired language created by a friend of mine which supports the inclusion of the output of some code run through an external command, with a similar syntax: https://pastek-project.github.io/cheatsheet.html https://pastek-project.github.io/cheatsheet.html
- chriswarbo 12y agoInteresting, although I specifically avoided defining a new language. The source to these pages is all written in Pandoc's version of Markdown, detailed at http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markd... If the PanPipe and PanHandle filters aren't used, the code blocks will just appear in the output verbatim. The `pipe="abc"` attribute and `unwrap` class will become regular HTML attributes and classes, just like any other. Pandoc also supports more formats than just Markdown. These filters operate on the parsed AST, so will work for any format where Pandoc can parse a 'Code' or 'CodeBlock' element, with the ability to attach 'attributes' or 'classes'. The "native" and "json" formats can do this, since they're just Pandoc's intermediate datastructures. I just tried it on HTML and it works there too! $ echo '<pre pipe="sh"><code>ls /</code></pre>' | pandoc -f html -t html --filter panpipe <pre><code>bin boot dev etc home lost+found media nix proc root run sys tmp usr var </code></pre>
- hk__2 12y agoReally interesting, thanks for the explanation!