]> pere.pagekite.me Git - text-madewithcc.git/commitdiff
Add new target check-urls to visit all URLs in the manuscript.
authorPetter Reinholdtsen <pere@hungry.com>
Sun, 11 Feb 2018 07:20:58 +0000 (08:20 +0100)
committerPetter Reinholdtsen <pere@hungry.com>
Sat, 17 Feb 2018 21:28:41 +0000 (21:28 +0000)
Makefile

index 15294f9e96c9b0f281cd2760449a5078bc88b2d6..b0a37a408758b14f6b12d7ab6dd7c575f33071da 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -118,6 +118,11 @@ lint-es: $(SOURCE).nb.xml
 lint-nb: $(SOURCE).nb.xml
        xmllint $(XMLLINTOPTS) $^
 
+check-urls:
+       retval=0; for u in $$(perl -n -e'/<ulink url="(.+)"\/>/ && print "$$1\n"' MadewithCreativeCommonsmostup-to-dateversion.xml | sort -u); do \
+         HEAD -H "User-Agent: Docbook XML URL checker" "$$u" > /dev/null || echo "error fetching $$u"; retval=1; \
+       done; exit $$retval
+
 # Experimental build rule to test Docbook XSL + FOP processor 
 xsl-fo-%.pdf: %.xml
        xsltproc --output $(subst .pdf,.fo,$@) \