diff options
| author | John J. Camilleri <john@digitalgrammars.com> | 2018-12-09 20:38:02 +0100 |
|---|---|---|
| committer | John J. Camilleri <john@digitalgrammars.com> | 2018-12-09 20:38:02 +0100 |
| commit | d82a53ebc660cf0319cd18edb4ddf9a2256bda3f (patch) | |
| tree | 0279bfd09ec0eaf8cba04fc405395793c2a01370 /bin | |
| parent | 5006b520d10b235d6327525f434de0b5538b38a8 (diff) | |
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
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/update_html | 8 |
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" \ |
