summaryrefslogtreecommitdiff
path: root/bin/update_html
diff options
context:
space:
mode:
authorJohn J. Camilleri <john@digitalgrammars.com>2018-12-10 14:25:44 +0100
committerJohn J. Camilleri <john@digitalgrammars.com>2018-12-10 14:25:44 +0100
commit083aa96e575554518dee32d03f579ad6cac26722 (patch)
treed89ff66de37f2d1d5c48288e106c1b6037a28314 /bin/update_html
parentd82a53ebc660cf0319cd18edb4ddf9a2256bda3f (diff)
TOC for Markdown should now work for both Pandoc < 2.0 and >= 2.0
The use of $toc$ and $table-of-contents$ flags changed, see: https://pandoc.org/releases.html#pandoc-2.0-29-oct-2017 under "Behaviour changes"
Diffstat (limited to 'bin/update_html')
-rwxr-xr-xbin/update_html10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/update_html b/bin/update_html
index 8ba13778a..587ed6179 100755
--- a/bin/update_html
+++ b/bin/update_html
@@ -93,18 +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'
+ # Look for `show-toc: true` in metadata (first ten lines of file)
+ if head -n 10 "$md" | grep --quiet 'show-toc: true' ; then
+ tocflag='--table-of-contents'
else
- toc=''
+ tocflag=''
fi
pandoc \
--from=markdown \
--to=html5 \
--standalone \
- $toc \
+ $tocflag \
--template="$template" \
--variable="lang:en" \
--variable="rel-root:$relroot" \