html5/spec-author-view .cvsignore,NONE,1.1 Makefile,1.3,1.4

Update of /sources/public/html5/spec-author-view
In directory hutz:/tmp/cvs-serv24604

Modified Files:
	Makefile 
Added Files:
	.cvsignore 
Log Message:
tweaked build so that each page now shows revision number and title on each page is "HTML 5 (Author Edition)"


--- NEW FILE: .cvsignore ---
anolis
html5-tools
CHANGEDESC
SPLITTERLOG
MANIFEST

Index: Makefile
===================================================================
RCS file: /sources/public/html5/spec-author-view/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile	25 Aug 2009 22:09:20 -0000	1.3
+++ Makefile	27 Aug 2009 07:43:02 -0000	1.4
@@ -1,16 +1,25 @@
 SVN=svn
 CURL=curl
 PYTHON=python
+CVS=cvs
+CVSFLAGS=
+GREP=egrep
+GREPFLAGS=
+TEE=tee
+TEEFLAGS=
+PERL=perl
+PERLFLAGS=
 
 HTML5=../spec
+SPLITTER=html5-tools/spec-splitter/spec-splitter.py
+SPLITTERFLAGS=--w3c
 
 # http://mercurial.selenic.com/wiki/
 HG=hg
 
-multipage/Overview.html: multipage/spec.html splitter
-	mkdir -p multipage
-	$(PYTHON) html5-tools/spec-splitter/spec-splitter.py --w3c \
-		multipage/spec.html multipage
+REVISION=$(shell $(GREP) $(GREPFLAGS) 'This is .+Revision: ' $(HTML5)/Overview.html | $(PERL) $(PERLFLAGS) -pe 's/.*This is .+Revision: (1\.[0-9]+) \$$\./$$1/')
+
+multipage/Overview.html: multipage/spec.html $(SPLITTER) MANIFEST
 
 # was:
 #	$(CURL) -o $@ http://dev.w3.org/html5/spec/Overview.html
@@ -18,18 +27,42 @@
 	mkdir -p multipage
 	$(PYTHON) anolis/anolis --parser=lxml.html --filter=.impl \
 		 $(HTML5)/Overview.html $@
+	$(PERL) $(PERLFLAGS) -pi -e 's/^.*This is .+Revision: ([^ ]+) \$$.*$$/This is revision $(REVISION)\./' $@
+	$(PERL) $(PERLFLAGS) -pi -e 's/<a href=Overview.html>/<a href=CHANGEMETOSPEC>/' $@
+	$(PERL) $(PERLFLAGS) -pi -e 's/<a href=spec.html>/<a href=Overview.html>/' $@
+	$(PERL) $(PERLFLAGS) -pi -e 's/<a href=CHANGEMETOSPEC>/<a href=spec.html>/' $@
+
+MANIFEST: multipage/spec.html
+	$(PYTHON) $(PYTHONFLAGS) $(SPLITTER) $(SPLITTERFLAGS) $< multipage \
+	  | $(TEE) $(TEEFLAGS) SPLITTERLOG \
+	  | $(GREP) $(GREPFLAGS) '<h2>|<h3>|<h4>|<h5>|<h6>' \
+	  | cut -c8- \
+	  | cut -d " " -f1 \
+	  | $(PERL) $(PERLFLAGS) -pe "s/(^[^ ]+)\s*\n/multipage\/\1.html\n/" > $@
+	  $(PERL) $(PERLFLAGS) -pi -e 's/^.*This is .+Revision: ([^ ]+) \$$.*$$/This is revision $(REVISION)\./' $<
+	  for file in $$(cat MANIFEST); \
+	    do $(PERL) $(PERLFLAGS) -pi -e 's|<h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2>|<h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2>\n<p>This is revision $(REVISION)\.</p>|' $$file; done
+	 $(PERL) $(PERLFLAGS) -pi -e 's|<h1>HTML 5</h1>|<h1>HTML 5 (Author Edition)</h1>|' multipage/*.html
 
 clean:
-	$(RM) -rf multipage
+	$(RM) multipage/spec.html
+	$(RM) CHANGEDESC
+	$(RM) SPLITTERLOG
 
 distclean: clean
 	$(RM) -rf html5-tools anolis
 
-splitter: html5-tools/spec-splitter/spec-splitter.py
-
-html5-tools/spec-splitter/spec-splitter.py:
+$(SPLITTER):
 	$(SVN) checkout http://html5.googlecode.com/svn/trunk/ html5-tools
 
+CHANGEDESC: $(HTML5)/Overview.html
+	$(CVS) $(CVSFLAGS) log -r$(REVISION) $< \
+	  | $(GREP) $(GREPFLAGS) -v \
+	  "^$$|^RCS file: |^Working file: |^head:|^branch:|^locks:|^access list:|^symbolic names:|^keyword substitution:|^total revisions:|^description:|^revision |^-----|^date: |^=====" \
+	  > $@
+	@echo >> $@
+	@echo "[updated by splitter]" >> $@
+
 
 # This was my 1st approach; hixie suggested the above technique instead
 html5-author2.html: webapps/source anolis/anolis

Received on Thursday, 27 August 2009 07:43:13 UTC