[build-path-prefix-map-spec] 44/50: Do a second XSLT transform to move the footnotes above the appendix
Ximin Luo
infinity0 at debian.org
Fri Mar 10 15:17:23 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository build-path-prefix-map-spec.
commit f3c20ee0a10a7989765817989f8aee28f55ade3d
Author: Ximin Luo <infinity0 at debian.org>
Date: Fri Feb 24 21:29:09 2017 +0100
Do a second XSLT transform to move the footnotes above the appendix
---
Makefile | 5 +++--
fixup-footnotes.xsl | 20 ++++++++++++++++++++
spec-main.rst | 2 +-
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 9d0c991..e9893e8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,12 @@
all: spec.html
-%.xml: %.rst %.t.xml
+%.xml: %.rst %.t.xml Makefile
# ain't nobody got time to manually type XML tags
pandoc --template "$*.t.xml" -s "$<" -t docbook > "$@"
-%.html: %.xml %.xsl
+%.html: %.xml %.xsl fixup-footnotes.xsl
xmlto -x "$*.xsl" html-nochunks "$<"
+ xsltproc --html -o "$@" fixup-footnotes.xsl "$@"
spec.rst: spec-main.rst spec-testcases.rst
cat $^ > "$@"
diff --git a/fixup-footnotes.xsl b/fixup-footnotes.xsl
new file mode 100644
index 0000000..15deded
--- /dev/null
+++ b/fixup-footnotes.xsl
@@ -0,0 +1,20 @@
+<?xml version='1.0'?>
+<!-- https://stackoverflow.com/questions/5665616/move-an-xml-element-into-another-element-with-xslt -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output/>
+
+ <xsl:template match="node()|@*" name="identity">
+ <xsl:copy>
+ <xsl:apply-templates select="node()|@*"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="//div[@class='sect1' and .//a[@name='notes-and-links']]/*[1]">
+ <xsl:call-template name="identity"/>
+ <div class="footnotes">
+ <xsl:copy-of select="//div[@class='footnotes']/*[not(self::hr) and not(self::br)]"/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="//div[@class='footnotes']"/>
+</xsl:stylesheet>
diff --git a/spec-main.rst b/spec-main.rst
index 3e1bb86..7c69b3d 100644
--- a/spec-main.rst
+++ b/spec-main.rst
@@ -239,7 +239,7 @@ an executable test suite in `our git repository
In the prescriptions below, statements of the form "E maps I to O" mean that
when E is set as the value of ``BUILD_PATH_PREFIX_MAP``, then a compliant
-consumer, when implementing either algorithm 1 or 2 from *Applying the decoded
+consumer implementing either algorithm 1 or 2 from *Applying the decoded
structure*, maps line-separated input paths I to line-separated output paths O.
Where E is wrapped by ``b'`` and ``'``, it is to be interpreted as a sequence
of bytes, represented in the same way as Python byte literals.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/build-path-prefix-map-spec.git
More information about the Reproducible-commits
mailing list