Today's work.
[thenextsample.git] / generate.sh
blobc40343626e4d55292842e030f7edf89f7c66e705
1 withIncludesResolved="`tempfile`"
2 sourceFile="sources.xml"
3 tempFiles="$sourceFile $withIncludesResolved"
5 xmllint --xinclude --output $withIncludesResolved --schema pottery.xsd pottery.xml || exit 1
7 echo '<?xml version="1.0" encoding="UTF-8"?>' > $sourceFile
8 echo '<sources xmlns="tag:fenglich.fastmail.fm,2007:Pottery">' >> $sourceFile
9 sources=" \
10 glazes.xml \
11 pieces.xml \
12 pottery.xml \
13 pottery.xsd \
14 pottery2docbook.xsl \
15 samples.xml \
16 $0"
17 for source in $sources; do
18 # Yes, the last hash outputted is the latest one.
19 echo "<source href=\"$source\" \
20 gitSHA1=\"`git log --pretty=format:'%h" date="%cd"' $source | tail -n1` \
21 />" >> $sourceFile
22 done
23 echo '</sources>' >> $sourceFile
25 # Let's just check it is ok
26 xmllint --noout $sourceFile || exit 2
28 xsltproc -o pottery.docbook pottery2docbook.xsl $withIncludesResolved || exit 3
30 xmllint --xinclude --noout --schema docbook.xsd pottery.docbook || exit 4
32 cd xhtml/
33 xsltproc --stringparam use.id.as.filename 1 \
34 ../../docbook-xsl-1.73.2/xhtml/chunk.xsl \
35 ../pottery.docbook || exit 5
37 # vim: et:ts=4:sw=4:sts=4