cmark

My personal build of CMark ✏️

Commit
dc31167e9d4053fa000f52163afe74ea9d6fc751
Parent
af75d8303c459594df0884204d20b8d8cb443c11
Author
John MacFarlane <jgm@berkeley.edu>
Date

Moved site building targets to _site/Makefile.

Diffstat

2 files changed, 4 insertions, 41 deletions

Status File Name N° Changes Insertions Deletions
Modified Makefile 20 4 16
Deleted make_site_index.sh 25 0 25
diff --git a/Makefile b/Makefile
@@ -4,7 +4,6 @@ BENCHINP?=README.md
 JSMODULES=$(wildcard js/lib/*.js)
 SPEC=spec.txt
 SITE=_site
-SPECVERSION=$(shell grep version: $(SPEC) | sed -e 's/version: *//')
 BUILDDIR=build
 PROG?=$(BUILDDIR)/src/cmark
 
@@ -75,22 +74,11 @@ fuzztest:
 	for i in `seq 1 10`; do \
 	  time cat /dev/urandom | head -c 500000 | iconv -f latin1 -t utf-8 | tee fuzz-$$i.txt | $(PROG) > /dev/null && rm fuzz-$$i.txt ; done
 
-$(SITE)/index.html: spec.txt
-	./make_site_index.sh $(SPECVERSION) | \
-	  pandoc --template template.html -S -s -t html5 -o $@
+update-site: spec.html
+	make -C $(SITE) update
 
-$(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 ..
-
-$(SITE)/%: %
-	cp $< $@
-
-update-site: $(SITE)/dingus.html $(SITE)/js/commonmark.js $(SITE)/index.html $(SITE)/$(SPECVERSION)/index.html $(SITE)/js/LICENSE
-
-upload-site:
-	cd $(SITE) ; git pull; git commit -a -m "Updated site for latest spec, js" ; git push; cd ..
+upload-site: spec.html
+	make -C $(SITE) upload
 
 distclean: clean
 	-rm -f js/commonmark.js
diff --git a/make_site_index.sh b/make_site_index.sh
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-SPECVERSION=$1
-SITE=_site
-VERSIONS=`cd $SITE; ls -d -1 0.* | sort -r -g`
-
-echo "% CommonMark Spec"
-echo ""
-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)"
-echo ""
-echo "[discussion forum](http://talk.commonmark.org/) | "
-echo "[interactive dingus](/dingus.html) | "
-echo "[repository](https://github.com/jgm/CommonMark/)"
-echo ""
-echo "Older versions:"
-echo ""
-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