From c52cd4ea39df57c7354d6d16e1c2b0c41c0f5983 Mon Sep 17 00:00:00 2001 From: urosm Date: Wed, 26 Jun 2024 16:02:58 +0200 Subject: [PATCH] update `pandoc` data dir --- pandoc/filters/current_date.lua | 12 ++++++++++++ pandoc/filters/link_headings.lua | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 pandoc/filters/current_date.lua create mode 100644 pandoc/filters/link_headings.lua diff --git a/pandoc/filters/current_date.lua b/pandoc/filters/current_date.lua new file mode 100644 index 0000000..1679302 --- /dev/null +++ b/pandoc/filters/current_date.lua @@ -0,0 +1,12 @@ +SCRIPT_NAME = "current_date.lua" +os.setlocale("C") + +return { + { Meta = function(m) + if m.date == nil then + os.setlocale(os.getenv("LANG")) + m.date = os.date("%c") + return m + end + end } +} diff --git a/pandoc/filters/link_headings.lua b/pandoc/filters/link_headings.lua new file mode 100644 index 0000000..dc0f28d --- /dev/null +++ b/pandoc/filters/link_headings.lua @@ -0,0 +1,11 @@ +SCRIPT_NAME = "link_headings.lua" +os.setlocale("C") + +local Link = pandoc.Link + +return { + { Header = function(h) + h.content = Link(h.content, ("#%s"):format(h.attr.identifier)) + return h + end } +}