size: 352 B
| 1 | local djot = require("djot") |
| 2 | |
| 3 | function renderdjot(txt) |
| 4 | return djot.render_html(djot.parse(txt)) |
| 5 | end |
| 6 | |
| 7 | function CodeBlock(el) |
| 8 | local rendered = renderdjot(el.text) |
| 9 | return { |
| 10 | pandoc.Div( |
| 11 | { pandoc.Div({pandoc.CodeBlock(el.text)}, {class="djot"}), |
| 12 | pandoc.Div({pandoc.CodeBlock(rendered)}, {class="html"}) |
| 13 | }, {class="example"}) |
| 14 | } |
| 15 | end |