From c734c0d1e32748b1bac89c93d3e598b908a2224e Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Wed, 3 Jun 2026 00:06:36 +0200 Subject: Improve DOC TOC situation. --- doc/c1/1-parse.md | 2 ++ html/style.css | 4 ++-- update-html.sh | 9 +++++++-- 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 + + 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='^ Up' fi + ext=$md2ext + if grep -q -- '' "$src" + then + ext=$ext,toc + fi { sed "s/__TITLE__/$title/" html/prelude.html echo "" - sed "1 a $nav" < "$src" | markdown2 -x "$md2ext" + sed "1 a $nav" < "$src" | markdown2 -x "$ext" echo "" echo "" } > "$dst" -- cgit v1.2.3