about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2024-10-28 12:15:35 +0100
committerRobert Günzler <r@gnzler.io>2024-11-02 14:33:14 +0100
commit24460c250816e9b1dc06c5348f4c470bc98f7153 (patch)
treecc4a58df59b4c114a00ced6e4a86543148a19220
parent5e48e1de8ba3caf684709fa519f8b94970d4de44 (diff)
downloadsite-24460c250816e9b1dc06c5348f4c470bc98f7153.tar.gz
renmae front.lua to preproc.lua
Signed-off-by: Robert Günzler <r@gnzler.io>
-rw-r--r--makefile5
-rw-r--r--preproc.lua (renamed from front.lua)4
2 files changed, 4 insertions, 5 deletions
diff --git a/makefile b/makefile
index 6d448b0..838a275 100644
--- a/makefile
+++ b/makefile
@@ -2,15 +2,16 @@ all: run
 
 # content
 PANDOC  ?= pandoc
+PANDOC_PREPROC ?= preproc.lua
 htm_SRC := $(shell find src/inc/ -name '*.htm' -print)
 md_SRC  := $(shell find src/inc/ -name '*.md' -print)
 SRC     := $(htm_SRC) $(md_SRC:%.md=%.htm)
 DST     := site
 
 # see https://pandoc.org/MANUAL.html#pandocs-markdown
-%.htm: %.md front.lua
+%.htm: %.md $(PANDOC_PREPROC)
 	@ echo "<!-- Generated file, you may edit and discard $< :) -->" >$@
-	$(PANDOC) -fmarkdown -thtml5 --lua-filter=front.lua $< >>$@
+	$(PANDOC) -fmarkdown -thtml5 --lua-filter=$(PANDOC_PREPROC) $< >>$@
 
 # generator
 ZIG     ?= zig
diff --git a/front.lua b/preproc.lua
index a6046b1..6bfa8c5 100644
--- a/front.lua
+++ b/preproc.lua
@@ -6,8 +6,7 @@ return {
 
         local toc = pandoc.structure.table_of_contents(doc)
         if doc.meta.toc and toc then
-            table.insert(front, pandoc.RawBlock("html5", '<section class="table-of-contents">'))
-            table.insert(front, pandoc.RawBlock("html5", '<nav class="capital">'))
+            table.insert(front, pandoc.RawBlock("html5", '<nav class="table-of-contents capital">'))
             table.insert(front, pandoc.RawBlock("html5", "<ol>"))
             -- insert jump to top
             table.insert(front, pandoc.Link("back to top", "#top"))
@@ -21,7 +20,6 @@ return {
             })
             table.insert(front, pandoc.RawBlock("html5", "</ol>"))
             table.insert(front, pandoc.RawBlock("html5", "</nav>"))
-            table.insert(front, pandoc.RawBlock("html5", "</section>"))
         end
 
         -- insert date blocks