html5 validation

This commit is contained in:
Astro 2010-11-09 22:15:46 +01:00
parent f92bed5dbb
commit 51f07b8e90
2 changed files with 21 additions and 7 deletions

View File

@ -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) $@

12
scripts/validate_xhtml5.sh Executable file
View File

@ -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