summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2019-05-27 09:06:11 +0200
committerkrangelov <kr.angelov@gmail.com>2019-05-27 09:06:11 +0200
commit8df212165028242458795b1f943c7975eb434e2a (patch)
tree49d0d8b3b195daa74cd61ec0988bbf06f58cbad2 /bin
parent8b9719bd2d85ee16f89453c79c40d9e00f5057ad (diff)
parentb7249adf63acf717210af2fa2e552bd50473b960 (diff)
Merge branch 'master' of https://github.com/GrammaticalFramework/gf-core
Diffstat (limited to 'bin')
-rw-r--r--bin/template.html6
-rwxr-xr-xbin/update_html10
2 files changed, 13 insertions, 3 deletions
diff --git a/bin/template.html b/bin/template.html
index 881f3f2e3..15306e1d9 100644
--- a/bin/template.html
+++ b/bin/template.html
@@ -80,7 +80,11 @@ $body$
<ul class="list-unstyled">
<li><a href="https://www.youtube.com/watch?v=x1LFbDQhbso">Google Tech Talk</a></li>
<li><a href="http://cloud.grammaticalframework.org/">GF Cloud</a></li>
- <li><a href="$rel-root$/doc/tutorial/gf-tutorial.html">Tutorial</a></li>
+ <li>
+ <a href="$rel-root$/doc/tutorial/gf-tutorial.html">Tutorial</a>
+ /
+ <a href="$rel-root$/lib/doc/rgl-tutorial/index.html">RGL Tutorial</a>
+ </li>
<li><a href="$rel-root$/download"><strong>Download GF</strong></a></li>
</ul>
</div>
diff --git a/bin/update_html b/bin/update_html
index 587ed6179..912ff1fa0 100755
--- a/bin/update_html
+++ b/bin/update_html
@@ -87,7 +87,7 @@ function render_t2t_html {
# Render markdown into html file
# Arguments:
# 1. markdown source file, e.g. download/index.md
-# 2. html target filen, e.g. download/index.html
+# 2. html target file, e.g. download/index.html
function render_md_html {
md="$1"
html="$2"
@@ -113,11 +113,17 @@ function render_md_html {
# Final post-processing
if [ -f "$html" ] ; then
- sed -i.bak "s/<table/<table class=\"table\"/" "$html" && rm "$html.bak"
+ # add "table" class to tables
+ sed -i.bak "s/<table/<table class=\"table\"/" "$html"
+ # rewrite anchors that Pandoc 1.16 ignores: [content]{#anchor} -> <span id="anchor">content</span>
+ sed -i.bak -E "s/\[(.*)\]\{#(.+)\}/<span id=\"\2\">\1<\/span>/" "$html"
+ rm -f "$html.bak"
echo "$html"
fi
}
+# Main entry point
+# Script can be run in one of two modes:
if [ $# -gt 0 ] ; then
# Render specific file(s) from args, ignoring dates
for file in "$@" ; do