jevstrudel.git / docs / iclc2023-paper / bin / code-filter.py
1#!/usr/bin/env python3
2import sys
3
4from pandocfilters import toJSONFilter, RawBlock
5
6def toMiniREPL(key, value, format, meta):
7    # print(value, file=sys.stderr)
8    if key == 'CodeBlock':
9        return RawBlock("markdown", "<MiniRepl tune={`" + value[1] + "`} />")
10
11if __name__ == "__main__":
12    toJSONFilter(toMiniREPL)