From d777e3111487712d86db6b9c76c978610f120e4e Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Tue, 31 Oct 2017 22:15:22 +0100 Subject: [PATCH] Slides in <appendix> --- Doc/Sd1/appendix.xml | 2 +- ws/Docbook/CustomLayer/slide/slideHdm.xsl | 4 +++- ws/Docbook/Extensions/Tdata/fig.xml | 22 ++++++++++++++++++++ ws/Docbook/Extensions/Xsl/docbook2slides.xsl | 5 +++-- ws/Docbook/Preprocess/Xsl/docbook2html.xsl | 2 +- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Doc/Sd1/appendix.xml b/Doc/Sd1/appendix.xml index 5062a2c8e..348704419 100644 --- a/Doc/Sd1/appendix.xml +++ b/Doc/Sd1/appendix.xml @@ -45,7 +45,7 @@ * <p>Beispiel: Im Array {3, 2, 0, 1, 4} ist der Wert »1« an der Index- * position »3« das zweite ungerade Element.</p> * -* @param werte Die zu durchsuchenden Werte. Alle Werte ungleich null. +* @param werte Die zu durchsuchenden Werte. * @param n Die gewünschte Position, Start bei 1. * * @return Den Index des n-ten ungeraden Wertes falls es mindestens n diff --git a/ws/Docbook/CustomLayer/slide/slideHdm.xsl b/ws/Docbook/CustomLayer/slide/slideHdm.xsl index e6f174581..685b31d44 100644 --- a/ws/Docbook/CustomLayer/slide/slideHdm.xsl +++ b/ws/Docbook/CustomLayer/slide/slideHdm.xsl @@ -14,6 +14,7 @@ <xsl:template match="/"> <xsl:for-each select="//d:chapter[contains(@annotations, 'slide')]| + //d:appendix[contains(@annotations, 'slide')]| //d:section[contains(@annotations, 'slide')]"> <xsl:call-template name="slideUnit"> <xsl:with-param name="rootId" select="@xml:id"/> @@ -23,6 +24,7 @@ <xsl:for-each select="//d:chapter[descendant::*[contains(@annotations, 'slide')]]| + //d:appendix[descendant::*[contains(@annotations, 'slide')]]| //d:section[descendant::*[contains(@annotations, 'slide')]]"> <xsl:call-template name="slideUnit"> <xsl:with-param name="rootId" select="@xml:id"/> @@ -102,7 +104,7 @@ </xsl:document> </xsl:template> - <xsl:template match="d:chapter|d:section" mode="slideDescendants"> + <xsl:template match="d:chapter|d:appendix|d:section" mode="slideDescendants"> <xsl:apply-templates select="d:section|d:figure" mode="slideDescendants"/> </xsl:template> diff --git a/ws/Docbook/Extensions/Tdata/fig.xml b/ws/Docbook/Extensions/Tdata/fig.xml index 04ac30037..3eb763112 100644 --- a/ws/Docbook/Extensions/Tdata/fig.xml +++ b/ws/Docbook/Extensions/Tdata/fig.xml @@ -111,4 +111,26 @@ <xi:include href="Components/exampleSlides.xml" xpointer="element(/1)"/> <xi:include href="Video/video.xml" xpointer="element(/1)"/> + + <appendix annotations="slide" xml:id="appendix"> + <title>Appendix</title> + + <section xml:id="addSlideInAppendix"> + <title>Slides in appendix.</title> + + <figure xml:id="fig_slideInAppendix"> + <title>Slides in appendix</title> + + <itemizedlist> + <listitem> + <para>Blah!</para> + </listitem> + + <listitem> + <para>snor!</para> + </listitem> + </itemizedlist> + </figure> + </section> + </appendix> </book> diff --git a/ws/Docbook/Extensions/Xsl/docbook2slides.xsl b/ws/Docbook/Extensions/Xsl/docbook2slides.xsl index 12b973f33..94b9f376b 100644 --- a/ws/Docbook/Extensions/Xsl/docbook2slides.xsl +++ b/ws/Docbook/Extensions/Xsl/docbook2slides.xsl @@ -5,10 +5,11 @@ <xsl:import href="/usr/share/xmlmind/addon/config/docbook5/xsl/html/docbook.xsl" /> <xsl:template match="/"> - <xsl:apply-templates select="//d:chapter[d:annotation[@role='slide']] | //d:section[d:annotation[@role='slide']]" mode='entry'/> + <xsl:apply-templates select="//d:chapter[d:annotation[@role='slide']] | //d:section[d:annotation[@role='slide']] | + //d:appendix[d:annotation[@role='slide']]" mode='entry'/> </xsl:template> - <xsl:template match="d:chapter | d:section" mode='entry'> + <xsl:template match="d:chapter | d:section | d:appendix" mode='entry'> <xsl:result-document method="xhtml" encoding="utf-8" href="Slides/{@xml:id}.html" indent="no"> <html lang="en"> <head> diff --git a/ws/Docbook/Preprocess/Xsl/docbook2html.xsl b/ws/Docbook/Preprocess/Xsl/docbook2html.xsl index f0e958d1f..3c6ddd5ad 100644 --- a/ws/Docbook/Preprocess/Xsl/docbook2html.xsl +++ b/ws/Docbook/Preprocess/Xsl/docbook2html.xsl @@ -16,7 +16,7 @@ </xsl:template> - <xsl:template match="db:chapter/db:title | db:section/db:title"> + <xsl:template match="db:chapter/db:title | db:section/db:title | db:appendix/db:title"> <xsl:copy-of select="."/> <xsl:for-each select="parent::*[contains(@annotations, 'slide') or descendant::*[contains(@annotations, 'slide')]]"> <para> -- GitLab