-- Pandoc filter which strips "solution" blocks when the environment variable -- "STRIP_SOLUTIONS" is set, or wrap them in a block quote otherwise. -- Useful to generate public and private handouts from the same source. -- -- Author: Pacien TRAN-GIRARD -- Licence: EUPL-1.2 strip_solutions = os.getenv('STRIP_SOLUTIONS') return { { Div = function(elem) if elem.classes[1] == 'solution' then if strip_solutions then return pandoc.Null() else return pandoc.BlockQuote(elem.content) end else return elem end end, } }