diff options
author | John MacFarlane <[email protected]> | 2014-10-31 22:10:45 -0700 |
---|---|---|
committer | John MacFarlane <[email protected]> | 2014-10-31 22:10:45 -0700 |
commit | 601908591b553b87901bb1122ff4e29d1decd6b1 (patch) | |
tree | a69ad063e0e5d0db8b5d99b6389a202188a8f3de /make_site_index.sh | |
parent | b14ece9e725175f98011dda8749d046d25b2f2bb (diff) | |
parent | 45ca1bc3867a48c75a6c464cf2420e25a8ef74c6 (diff) |
Merge branch 'master' into cmake
Diffstat (limited to 'make_site_index.sh')
-rwxr-xr-x | make_site_index.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/make_site_index.sh b/make_site_index.sh new file mode 100755 index 0000000..d11dbe0 --- /dev/null +++ b/make_site_index.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +SPECVERSION=$1 +SITE=_site +VERSIONS=`cd $SITE; ls -d -1 0.* | sort -r -g` + +echo "% CommonMark Spec\n" +date=`grep '<div class="version">' $SITE/$SPECVERSION/index.html | perl -pe 's/^.*(\d\d\d\d-\d\d-\d\d).*$/\1/'` +echo "[**Latest version ($SPECVERSION)**](/$SPECVERSION/) ($date)\n" +echo "[discussion forum](http://talk.commonmark.org/) | " +echo "[interactive dingus](/dingus.html) | " +echo "[repository](https://github.com/jgm/CommonMark/)\n" +echo "Older versions:\n" +for vers in $VERSIONS + do + date=`grep '<div class="version">' $SITE/$vers/index.html | perl -pe 's/^.*(\d\d\d\d-\d\d-\d\d).*$/\1/'` + if [ "$vers" != "$SPECVERSION" ]; then + perl -p -i -e 's/<div id="watermark">.*?<\/div>/<div id="watermark" style="background-color:black">This is an older version of the spec. For the most recent version, see <a href="http:\/\/spec.commonmark.org">http:\/\/spec.commonmark.org<\/a>.<\/div>/' $SITE/$vers/index.html + echo "- [$vers](/$vers/) ($date)" + fi + done |