summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/update_html8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/update_html b/bin/update_html
index 84bfa1cdb..8ba13778a 100755
--- a/bin/update_html
+++ b/bin/update_html
@@ -93,10 +93,18 @@ function render_md_html {
html="$2"
relroot="$( dirname $md | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )"
+ # Look for `toc: true` in metadata (first ten lines of file)
+ if head -n 10 "$md" | grep --quiet 'toc: true' ; then
+ toc='--table-of-contents'
+ else
+ toc=''
+ fi
+
pandoc \
--from=markdown \
--to=html5 \
--standalone \
+ $toc \
--template="$template" \
--variable="lang:en" \
--variable="rel-root:$relroot" \