diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-02-24 17:05:50 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-02-24 17:05:50 +0100 |
commit | b3555241f00230e1055133ef85adca105c5a3ded (patch) | |
tree | 61e77b25fe2ec804498f14d0a76368b2c8194d42 | |
parent | 55670e667f95c115c06dce484914df717f3d174a (diff) |
Fix tidy html rendering to validate and not rely on server charset hinting.
-rw-r--r-- | Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -27,7 +27,14 @@ $(rdfxmlfiles): %.rdf : %.ttl $(eval base = $(call getbase, $<)) rapper $(base:%=-I "%") -i turtle -o rdfxml-abbrev "$<" > "$@" +# Fetch and tidy programme rendering +# * add doctype and title to validate +# * add charset to not rely on server hinting +# * refer to plaintext serialization (not self) of dataset $(htmlprogrammefiles): %.html : %.ttl $(eval base = $(call getbase, $<)) wget -O"$@" "http://programme.ecs.soton.ac.uk/tool.php?src=$(base)" - perl -pi -e 's,$(base)\K,/index.txt,' "$@" + perl -pi -0 \ + -e 's,^(.*?<h1[^>]*>)(.*?)(?=</h1>),<!DOCTYPE html>\n<meta charset="utf-8">\n<title>$$2$$1$$2,ms;' \ + -e 's,$(base)\K,/index.txt,;' \ + "$@" |