implement mkdocs, remove pandoc

This commit is contained in:
2026-01-20 12:57:26 -06:00
parent fabb2c69fd
commit 376369f49b
9 changed files with 69 additions and 91 deletions

15
tools/build.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail
MKDOCS_STRICT="${MKDOCS_STRICT:-true}"
TMPDIR="${RUNNER_TEMP:-$TMPDIR}"
OUTPUT_DIR="${OUTPUT_DIR:-${TMPDIR}/dist/}"
# OFFLINE="${OFFLINE:-false}" # This doesn't seem to do anything, set by mkdocs.yml
MKDOCS_CONFIG="${MKDOCS_CONFIG:-mkdocs/mkdocs.yml}"
STRICT_FLAG=""
if [ "${MKDOCS_STRICT}" = "true" ]; then
STRICT_FLAG="--strict"
fi
mkdocs build ${STRICT_FLAG} -f $MKDOCS_CONFIG -d $OUTPUT_DIR

View File

@@ -1,20 +0,0 @@
-- Based on https://github.com/jgm/pandoc/issues/5071#issuecomment-856918980
-- For LaTeX documents, shift all headings down by one.
-- Make Level 1 unnumbered, or remove it if it contains the "hidden" class. (`# Title {.hidden}`)
function Header(el)
if el.level == 1 then
--check for hidden class. (Why didn't pandoc make this a set? `{class_name = true}`)
for i, v in ipairs(el.classes) do
if v == "hidden" then
--The empty list means remove the element
return {}
end
end
-- this may mean that there are two unnumbered classes, but that doesn't matter.
el.classes[#el.classes + 1] = "unnumbered"
else
-- all headings > 1 are shifted down so that you don't end up with 0.x.y headings.
el.level = el.level - 1
end
return el
end