diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/testdocs/Makefile | 27 | ||||
-rw-r--r-- | test/testdocs/db2html.xsl | 10 |
2 files changed, 30 insertions, 7 deletions
diff --git a/test/testdocs/Makefile b/test/testdocs/Makefile index c1e2a08e..9eee46f8 100644 --- a/test/testdocs/Makefile +++ b/test/testdocs/Makefile @@ -4,17 +4,36 @@ tests = $(filter-out template.xml,$(wildcard *.xml)) htmls = $(patsubst %.xml,html/%,$(tests)) htmlargs = \ - -o $@/$(patsubst html/%,%.html,$1) \ --stringparam db.chunk.max_depth 0 \ + --stringparam theme.icons.base_url \ + ../../../../icons/hicolor/48x48/status/ \ + --stringparam theme.icons.watermark.code \ + ../../../../icons/hicolor/watermarks/watermark-code.png \ --param db.chunk.chunk_top 'false()' \ - --stringparam db.chunk.basename $(patsubst html/%,%,$1) \ $(db2html) -test: $(htmls) +test: $(htmls) html/index.html $(htmls) : html/% : %.xml @mkdir -p $@ - xsltproc $(call htmlargs,$@) $< + xsltproc \ + -o $@/$(patsubst html/%,%.html,$@) \ + --param annotate 'false()' \ + --stringparam db.chunk.basename $(patsubst html/%,%,$@) \ + $(call htmlargs,$@) $< + xsltproc \ + -o $@/$(patsubst html/%,%-a.html,$@) \ + --param annotate 'true()' \ + --stringparam db.chunk.basename $(patsubst html/%,%-a,$@) \ + $(call htmlargs,$@) $< + +html/index.html: + (echo '<html><body><ul>' && \ + for html in $(htmls); do \ + base=`basename $$html`; \ + echo "<li><a href='$$base/$${base}.html'>$$base</a>"; \ + echo "(<a href='$$base/$${base}-a.html'>annotated</a>)</li>"; \ + done && echo '</ul></body></html>') > $@ clean: rm -rf html/* diff --git a/test/testdocs/db2html.xsl b/test/testdocs/db2html.xsl index a83a72d8..53bfe218 100644 --- a/test/testdocs/db2html.xsl +++ b/test/testdocs/db2html.xsl @@ -5,10 +5,14 @@ <xsl:import href="../../xslt/docbook/html/db2html.xsl"/> +<xsl:param name="annotate" select="true()"/> + <xsl:template match="/*/*[preceding-sibling::*][name(.) != 'title']"> - <pre style="margin: 16px; padding: 0.8em; background-color: #9EB6D1; -moz-border-radius: 8px;"> - <xsl:apply-templates mode="source.mode" select="."/> - </pre> + <xsl:if test="$annotate"> + <pre style="margin: 16px; padding: 0.8em; background-color: #9EB6D1; -moz-border-radius: 8px;"> + <xsl:apply-templates mode="source.mode" select="."/> + </pre> + </xsl:if> <xsl:apply-imports/> </xsl:template> |