robin/maivi

a tiny cute lua web framework

git clone https://git.robinwobin.dev/robin/maivi

robinrouter: `read_data` hook and ctx pattern matchae085a5

push-srxvuswpkqxx
188 B8 linesraw
1local md4c = require("md4c")
2
3maivi.hook("read_data", { pattern = "%.md$" }, function(ctx)
4  local ok, result = pcall(md4c.tohtml, ctx.content)
5  if ok then
6    ctx:use(result)
7  end
8end)