function CodeBlock(el) if next(el.classes) == nil then el.classes = el.classes .. {'c-page__pre'} elseif el.classes[1] == "plain" then el = pandoc.Div({el}, {class = 's-code'}) else local formatted = pandoc.pipe('pygmentize', { '-l', el.classes[1], '-f', 'html', '-O', 'cssclass=s-code s-code--highlight' }, el.text) el = pandoc.RawBlock('html', formatted) end return el end function Header(el) if el.level == 1 then el.classes = el.classes .. {'c-page__h1'} elseif el.level == 2 then el.classes = el.classes .. {'c-page__h2'} elseif el.level == 3 then el.classes = el.classes .. {'c-page__h3'} end return el end function Div(el) if el.attributes.macro == nil then return el end if el.attributes.macro == 'refs' and el.content[1].tag == 'BulletList' then local newchildren = pandoc.List() newchildren:insert(pandoc.RawBlock('html', '