cmark

My personal build of CMark ✏️

Commit
76df41816c4e57a6c8ada845a2ead90d4d3b5b97
Parent
ee570cab6af160bd50262f81f0e1f17e988b6e45
Author
John MacFarlane <jgm@berkeley.edu>
Date

Have index.html on web page redirect to latest version.

Diffstat

2 files changed, 17 insertions, 8 deletions

Status File Name N° Changes Insertions Deletions
Modified Makefile 14 6 8
Added spec.redirect.in 11 11 0
diff --git a/Makefile b/Makefile
@@ -89,27 +89,25 @@ fuzztest:
 	for i in `seq 1 10`; do \
 	  time cat /dev/urandom | head -c 100000 | iconv -f latin1 -t utf-8 | $(PROG) >/dev/null; done
 
-index.md: _site/$(SPECVERSION)/index.html
-	echo "% CommonMark Spec\n" > $@
-	for vers in $(shell cd _site; ls -d -t 0.*) ; do \
-	  echo "- [Version $$vers](/$$vers/)" >> $@ ; done
+_site/spec.html: spec.redirect.in
+	perl -pe 's/VERSION/$(SPECVERSION)/g' $< > $@
 
-_site/index.html: index.md
-	pandoc --template template.html -S -s -t html5 -o $@ $<
+_site/index.html: _site/spec.html
+	cp $< $@
 
 _site/$(SPECVERSION)/index.html: spec.html
 	mkdir -p _site/$(SPECVERSION)
 	cp $< $@
 	cd _site; git add $(SPECVERSION)/index.html; git commit -a -m "Added version $(SPECVERSION) of spec"; cd ..
 
-update-site: spec.html js/commonmark.js _site/index.html _site/$(SPECVERSION)/index.html
+update-site: spec.html js/commonmark.js _site/index.html _site/$(SPECVERSION)/index.html _site/spec.html
 	cp js/index.html _site/js/
 	cp js/commonmark.js _site/js/
 	cp js/LICENSE _site/js/
 	(cd _site ; git pull ; git commit -a -m "Updated site for latest spec, js" ; git push; cd ..)
 
 clean:
-	-rm -f test $(SRCDIR)/*.o $(SRCDIR)/scanners.c $(SRCDIR)/html/*.o libcmark.so index.md
+	-rm -f test $(SRCDIR)/*.o $(SRCDIR)/scanners.c $(SRCDIR)/html/*.o libcmark.so
 	-rm js/commonmark.js
 	-rm -rf *.dSYM
 	-rm -f README.html
diff --git a/spec.redirect.in b/spec.redirect.in
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>CommonMark Spec</title>
+    <meta http-equiv="refresh" content="0;URL='http://spec.commonmark.org/VERSION/" >
+  </head>
+  <body>
+    <p>The most recent version of the CommonMark Spec can be found
+at <a href="http://spec.commonmark.org/VERSION/">http://spec.commonmark.org/VERSION/</a>.</p>
+  </body>
+</html>