cmark

My personal build of CMark ✏️

Commit
2e27dc3c3fef3ff826dd5406d18e31bccc7d6d1f
Parent
4e4e5fa464de6c4057abc677ae316f6f1146909d
Author
John MacFarlane <jgm@berkeley.edu>
Date

Add date to index of versions.

Diffstat

1 file changed, 4 insertions, 2 deletions

Status File Name N° Changes Insertions Deletions
Modified make_site_index.sh 6 4 2
diff --git a/make_site_index.sh b/make_site_index.sh
@@ -5,12 +5,14 @@ SITE=_site
 VERSIONS=`cd $SITE; ls -d -1 0.* | sort -r -g`
 
 echo "% CommonMark Spec\n"
-echo "[**Latest version ($SPECVERSION)**](/$SPECVERSION/)\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)** ($date)](/$SPECVERSION/)\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/)"
+        echo "- [$vers ($date)](/$vers/)"
     fi
   done