function CodeBlock(el) if el.classes[1] == "plain" then el = pandoc.Div({ el }, { class = 's-code' }) elseif el.classes[1] then local formatted = pandoc.pipe('pygmentize', { '-l', el.classes[1], '-f', 'html', '-O', 'cssclass=s-code s-code--highlight', }, el.text) if formatted then el = pandoc.RawBlock('html', formatted) end end return el end function Header(el) if el.level == 1 then local newchildren = pandoc.List() newchildren:insert(pandoc.Span(el.content, { class = 's-headlines__title-inner' })) el.content = newchildren end if el.level <= 3 and el.identifier ~= '' then el.content:insert(pandoc.Space()) el.content:insert(pandoc.Link(pandoc.RawInline('html', ''), '#' .. el.identifier, nil, { class = 's-headlines__link' })) 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', '