diff --git a/pandoc-filters/titlecase_titles.lua b/pandoc-filters/titlecase_titles.lua index 829202a5..82f4f334 100644 --- a/pandoc-filters/titlecase_titles.lua +++ b/pandoc-filters/titlecase_titles.lua @@ -2,13 +2,15 @@ local decasify = require("decasify") local locale = os.getenv("LANGUAGE") or "en" +local style = os.getenv("STYLEGUIDE") or "gruber" Pandoc = function (doc) - local language = pandoc.utils.stringify(doc.meta.language or locale) + locale = pandoc.utils.stringify(doc.meta.language or locale) + style = pandoc.utils.stringify(doc.meta.styleguide or style) return doc:walk { Header = function (element) local title = pandoc.utils.stringify(element.content) - local cased = decasify.titlecase(title, language) + local cased = decasify.titlecase(title, locale, style) element.content = cased return element end