7 ms·
Pandoc filters let you do a lot of things provided you stick to the defined types. If you want to add new types of element, like this does, then the only practi
by aaren 12y ago
Pandoc filters let you do a lot of things provided you stick to the defined types. If you want to add new types of element, like this does, then the only practical way is a fork.
(except for really simple cases)
- zzleeper 12y agoHowever, in most cases you could just RawBlock (or was it BlockQuote?) with specific attributes, and then intercept those in a filter and convert to Latex.
- timtylin 12y agoThis was basically my original approach. However, after working out the math syntax I realized that some things, like the double-backtick inline math, just can't be accomplished without a pre-filter. At that point I decided to just start playing with the parser code. I also became super-convinced that some level of AST change was necessary to keep things sane, and since I wasn't able to use the existing Math and Image types anyways (they're not attributed), I ultimately just started a new AST type package namespace called "Scholdoc". Everything just evolved from there.
- aaren 12y agoYes, BlockQuote can be used as a generic block container. It doesn't have attributes itself but you can put them on a header at the start. For generic inline elements you can use Code. Markdown syntax for generic containers (Div and Span) hasn't been implemented yet but the discussion is fairly mature now: https://github.com/jgm/pandoc/issues/168 https://github.com/jgm/pandoc/issues/168 https://github.com/jgm/pandoc/pull/1791 https://github.com/jgm/pandoc/pull/1791