From 51f07b8e902e98a8d3beb5217b2de50b7143c326 Mon Sep 17 00:00:00 2001 From: Astro Date: Tue, 9 Nov 2010 22:15:46 +0100 Subject: [PATCH] html5 validation --- Makefile | 16 +++++++++------- scripts/validate_xhtml5.sh | 12 ++++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100755 scripts/validate_xhtml5.sh diff --git a/Makefile b/Makefile index 734c72853..c2f2f7d15 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ DESTDIR?=www-export ### Ressourcen ### # XSLT-Stylesheets: STYLE=xsl/html5.xsl -DS_STYLE=xsl/datenspuren/html5.xsl +DS_STYLE=xsl/datenspuren/xhtml.xsl # Document-Type-Definition: DTD:=dtd/c3d2web.dtd # XML-Katalog (Pfad zu den DTDs) - wird benötigt vom Validator @@ -95,12 +95,6 @@ $(DATESTAMP): $(RM) $(wildcard build/.stamp-*) touch $@ -.PHONY: html5-validate -html5-validate: www - for file in `find $< -name *.html`; do \ - curl -d @$file< -H "Content-Type: text/html; charset=UTF-8" 'http://validator.nu/?out=text&preset=http://s.validator.nu/xhtml5-aria-rdf-svg-mathml.rnc+http://s.validator.nu/html5/assertions.sch+http://c.validator.nu/all/' \ - done - ### Regeln für den XSLT-Prozess ### build/%.html : NOVALID:=true @@ -207,6 +201,14 @@ build/datenspuren/news-atom.xml : NOVALID:=true build/datenspuren/news-atom.xml : PFLAGS+=--stringparam prefix ds09- build/datenspuren/news-atom.xml : VFLAGS_OUT=$(VFLAGS) --relaxng xsd/atom.rng +.PHONY: html5-validate +html5-validate: $(patsubst build/%.html, build/%.html.html5-validate, $(CONTENT)) +.PHONY: build/%.html.html5-validate +build/%.html.html5-validate: build/%.html + ./scripts/validate_xhtml5.sh $< + + + ### Die neuesten Chaosupdates holen ### $(WWW_CCC_DE_UPDATES).orig: $(DATESTAMP) $(RM) $@ diff --git a/scripts/validate_xhtml5.sh b/scripts/validate_xhtml5.sh new file mode 100755 index 000000000..1a2cb265b --- /dev/null +++ b/scripts/validate_xhtml5.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +text=$(curl -s -d @$1 -H "Content-Type: application/xhtml+xml; charset=UTF-8" 'http://validator.nu/?out=text&preset=http://s.validator.nu/xhtml5-aria-rdf-svg-mathml.rnc+http://s.validator.nu/html5/assertions.sch+http://c.validator.nu/all/') + +if [ -n "$(echo "$text"|grep "The document validates according to the specified schema(s).")" ]; then + exit 0 +else + echo "=== $1 ===" + echo "$text" + exit 0 #1 +fi +