summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylan Kammer <taylan.kammer@gmail.com>2026-06-03 00:06:36 +0200
committerTaylan Kammer <taylan.kammer@gmail.com>2026-06-03 00:06:36 +0200
commitc734c0d1e32748b1bac89c93d3e598b908a2224e (patch)
tree82154931beb91006a120df5b027fb77798d44cac
parentdca76cd7955573cc537933c7beb93d2d9ee2b1d2 (diff)
Improve DOC TOC situation.
-rw-r--r--doc/c1/1-parse.md2
-rw-r--r--html/style.css4
-rwxr-xr-xupdate-html.sh9
3 files changed, 11 insertions, 4 deletions
diff --git a/doc/c1/1-parse.md b/doc/c1/1-parse.md
index e396ca5..4a8c22b 100644
--- a/doc/c1/1-parse.md
+++ b/doc/c1/1-parse.md
@@ -1,5 +1,7 @@
# Parser for Code & Data
+<!--TOC-->
+
Zisp s-expressions represent an extremely minimal set of data types; only that
which is necessary to strategically construct more complex values:
diff --git a/html/style.css b/html/style.css
index d5c2610..e21a94b 100644
--- a/html/style.css
+++ b/html/style.css
@@ -10,7 +10,7 @@ body {
}
@media screen and (max-width:960px) {
- body > ul:first-of-type {
+ body > ul:first-child {
display: none;
}
}
@@ -19,7 +19,7 @@ body {
body {
margin-left: 260px;
}
- body > ul:first-of-type {
+ body > ul:first-child {
position: fixed;
margin-left: -280px;
margin-top: 82px;
diff --git a/update-html.sh b/update-html.sh
index 065a0cf..0c37ffd 100755
--- a/update-html.sh
+++ b/update-html.sh
@@ -8,7 +8,7 @@ then
exit 1
fi
-md2ext=fenced-code-blocks,highlightjs-lang,tables,toc
+md2ext=fenced-code-blocks,highlightjs-lang,tables
md2ht() {
src=$1
@@ -26,10 +26,15 @@ md2ht() {
else
nav='<a href=".">^ Up</a>'
fi
+ ext=$md2ext
+ if grep -q -- '<!--TOC-->' "$src"
+ then
+ ext=$ext,toc
+ fi
{
sed "s/__TITLE__/$title/" html/prelude.html
echo "<body>"
- sed "1 a $nav" < "$src" | markdown2 -x "$md2ext"
+ sed "1 a $nav" < "$src" | markdown2 -x "$ext"
echo "</body>"
echo "</html>"
} > "$dst"