summaryrefslogtreecommitdiff
path: root/_extensions
diff options
context:
space:
mode:
Diffstat (limited to '_extensions')
-rw-r--r--_extensions/js/multicol-nohead/multicol-nohead.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/_extensions/js/multicol-nohead/multicol-nohead.lua b/_extensions/js/multicol-nohead/multicol-nohead.lua
index 4b753a4..85e0dd8 100644
--- a/_extensions/js/multicol-nohead/multicol-nohead.lua
+++ b/_extensions/js/multicol-nohead/multicol-nohead.lua
@@ -27,6 +27,10 @@ local function has_class(elem, class)
return false
end
+local function is_columnar_header(elem)
+ return elem.t == "Header" and elem.level == 1
+end
+
-- TODO: detect pre-quarto-filter pattern too
local function is_newpage_command(elem)
return (elem.t == "RawBlock" and elem.text == "\\newpage{}")
@@ -44,11 +48,6 @@ local function is_advertising(elem)
return false
end
--- TODO: include header level 2 and author paragraph above multicolumn
-function is_author(elem)
- return elem.t == Para and elem.content[1].text == "Forfatter:"
-end
-
-- wrap images with class .ad to span half or full page
local function ad(elem)
local amount = #elem.content
@@ -98,7 +97,7 @@ function Pandoc(doc)
local multicol_now = false
local multicol_places = {}
for i, elem in ipairs(doc.blocks) do
- if elem.t == "Header" and elem.level == 1 then
+ if is_columnar_header(elem) then
multicol_places[i] = multicol_now and "renew" or "begin"
multicol_now = true
elseif is_advertising(elem) then