3 ms·
Interesting, 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
by chriswarbo 12y ago
Interesting, 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!