From d82a53ebc660cf0319cd18edb4ddf9a2256bda3f Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Sun, 9 Dec 2018 20:38:02 +0100 Subject: Replace gf-refman.html with Markdown version gf-refman.md The raw HTML was invalid, and this way we use the common website template for a uniform look without any duplication. It seems gf-refman.html was once generated from txt2tags, although I have been unable to find this original .t2t file. I also tried to re-generate txt2tags from HTML but was not able to. However I was able to convert HTML to Markdown using Pandoc and I think the result is pretty good, so I think we should use this. The original gf-refman.html can be obtained from git history, e.g.: https://github.com/GrammaticalFramework/gf-core/blob/a7e43d872f5e612f93131f2d8caf811fbee9aa83/doc/gf-refman.html --- bin/update_html | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin') 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" \ -- cgit v1.2.3