size: 622 B
| 1 | local djot = require("djot"); |
| 2 | |
| 3 | --ignore_frontmatter = { { |
| 4 | -- code_block = { |
| 5 | -- enter = function(e) |
| 6 | -- if e.lang == "frontmatter" then |
| 7 | -- e.text = "shit" |
| 8 | -- end |
| 9 | -- end |
| 10 | -- , |
| 11 | -- exit = function(e) |
| 12 | -- if e.lang == "frontmatter" then |
| 13 | -- e.attr = e.attr or djot.ast.new_attributes() |
| 14 | -- e.attr.style = "display:none" |
| 15 | -- end |
| 16 | -- end |
| 17 | -- } |
| 18 | --} } |
| 19 | |
| 20 | function djot_to_html(input) |
| 21 | local doc = djot.parse(input) |
| 22 | --djot.filter.apply_filter(doc, ignore_frontmatter) |
| 23 | return djot.render_html(doc) |
| 24 | end |