diff --git a/ws/Docbook/CustomLayer/slide/slideHdm.xsl b/ws/Docbook/CustomLayer/slide/slideHdm.xsl index cb2803e6da90351a7072877f7a821b629e3b69ae..fe79732b1760e62d678d66b49b60feef6be6da5c 100644 --- a/ws/Docbook/CustomLayer/slide/slideHdm.xsl +++ b/ws/Docbook/CustomLayer/slide/slideHdm.xsl @@ -108,26 +108,76 @@ <xsl:template match="d:title" mode="slideDescendants"/> - <xsl:template match="*" mode="slideDescendants"> - <section> - <xsl:attribute name="id"> - <xsl:choose> - <xsl:when test="@xml:id"><xsl:value-of select="@xml:id"/></xsl:when> - <xsl:otherwise><xsl:value-of select="generate-id(.)"/></xsl:otherwise> - </xsl:choose> - </xsl:attribute> - + <xsl:template match="d:figure" mode="slideDescendants"> + + <xsl:variable name="primarySectionId"> + <xsl:choose> + <xsl:when test="@xml:id"><xsl:value-of select="@xml:id"/></xsl:when> + <xsl:otherwise><xsl:value-of select="generate-id(.)"/></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <section id="{$primarySectionId}"> + <xsl:apply-templates select="."/> - <a style="font-size: 50%"> + <a style="font-size: 50%" target="_blank"> <xsl:attribute name="href"> <xsl:call-template name="href.target.uri"/> </xsl:attribute> - <xsl:text>Back</xsl:text> + <xsl:text>Lecture notes</xsl:text> </a> </section> + + <xsl:variable name="currentFigureId" select="generate-id()"/> + + <xsl:variable name="followupQandasets" + select="following-sibling::d:qandaset[generate-id(preceding-sibling::d:figure[1]) = $currentFigureId]"/> + + <xsl:if test="$followupQandasets"> + <section id="{$primarySectionId}_followupExercise"> + <xsl:choose> + <xsl:when test="1 = count($followupQandasets)"> + <h3>Followup exercise</h3> + <xsl:for-each select="$followupQandasets"> + <a target="_blank"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target.uri"/> + </xsl:attribute> + <xsl:value-of select="d:title"/> + </a> + </xsl:for-each> + + </xsl:when> + <xsl:otherwise> + <h3>Followup exercises</h3> + <ul> + <xsl:for-each select="$followupQandasets"> + <li> + <a target="_blank"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target.uri"/> + </xsl:attribute> + <xsl:value-of select="d:title"/> + </a> + </li> + </xsl:for-each> + </ul> + </xsl:otherwise> + </xsl:choose> + + </section> + + </xsl:if> </xsl:template> - + <xsl:template match="*" mode="slideDescendants"> + <p> + <xsl:text>No template for element '</xsl:text> + <xsl:value-of select="name(.)"/> + <xsl:text>' defined in mode 'slideDescendants'.</xsl:text> + </p> + </xsl:template> + <!-- Get rid of block object names e.g. "Figure 3.1" --> <xsl:template match="d:figure"> <xsl:apply-templates/> diff --git a/ws/Docbook/CustomLayer/webhelp/positioning.css.patch b/ws/Docbook/CustomLayer/webhelp/positioning.css.patch index d5a6831e5715a09c5fa1c77958849dd9b1031e15..51d81af45bd9f3416c18861dbacf998fcc128586 100644 --- a/ws/Docbook/CustomLayer/webhelp/positioning.css.patch +++ b/ws/Docbook/CustomLayer/webhelp/positioning.css.patch @@ -1,5 +1,5 @@ ---- positioning.css.orig 2017-08-06 00:10:35.262273697 +0200 -+++ positioning.css 2017-08-06 00:17:46.727555505 +0200 +--- positioning.css.orig 2017-09-14 12:35:06.398188646 +0200 ++++ positioning.css 2017-09-14 12:36:28.397038671 +0200 @@ -1,3 +1,8 @@ +/* + * patched by: /usr/share/hdm-docbook-xsl/CustomLayer/webhelp/positioning.css.patch @@ -44,7 +44,7 @@ #content .qandaset>table, #content .qandaset>table td, #content .calloutlist table, #content .calloutlist table td, #content .navfooter table, #content .navfooter table td { border: 0px solid; } -@@ -375,3 +394,109 @@ +@@ -375,3 +394,117 @@ } @@ -154,3 +154,11 @@ + height: 20px; + content:""; +} ++ ++/* Highlight link target, credits to ++ https://stackoverflow.com/questions/11142125/css-highlight-a-div-when-the-id-is-linked-to-using-an-anchor ++*/ ++ ++:target { ++ background-color: #ffa; ++} diff --git a/ws/Docbook/Extensions/Tdata/Components/exampleSlides.xml b/ws/Docbook/Extensions/Tdata/Components/exampleSlides.xml index 4ffb25428477a249a0c015f9a033743e2d94c15b..87bf5bcf080a52e489544749820645686e618bf2 100644 --- a/ws/Docbook/Extensions/Tdata/Components/exampleSlides.xml +++ b/ws/Docbook/Extensions/Tdata/Components/exampleSlides.xml @@ -37,6 +37,38 @@ </imageobject> </mediaobject> </figure> + + <qandaset defaultlabel="qanda" xml:id="qandaHumanRelated"> + <title>Class <classname>Human</classname> related exercise 1</title> + + <qandadiv> + <qandaentry> + <question> + <para>A human related first question</para> + </question> + + <answer> + <para>A human related first answer</para> + </answer> + </qandaentry> + </qandadiv> + </qandaset> + + <qandaset defaultlabel="qanda" xml:id="qandaHumanRelated2"> + <title>Class <classname>Human</classname> related exercise 2</title> + + <qandadiv> + <qandaentry> + <question> + <para>A human related second question</para> + </question> + + <answer> + <para>A human related second answer</para> + </answer> + </qandaentry> + </qandadiv> + </qandaset> </section> <section xml:id="slideCallouts"> @@ -61,7 +93,7 @@ </callout> <callout arearefs="javaExample-2-co" xml:id="javaExample-2"> - <para>Javadoc header.</para> + <para><acronym>Javadoc</acronym> header.</para> </callout> <callout arearefs="javaExample-3-co" xml:id="javaExample-3"> @@ -73,6 +105,22 @@ <tip> <para>You may require a <code>return</code> statement as well.</para> </tip> + + <qandaset defaultlabel="qanda" xml:id="qandaCalloutRelated"> + <title>General class syntax related exercise</title> + + <qandadiv> + <qandaentry> + <question> + <para>General class syntax related question</para> + </question> + + <answer> + <para>General class syntax related answer</para> + </answer> + </qandaentry> + </qandadiv> + </qandaset> </section> <section xml:id="exampleScreen"> diff --git a/ws/Docbook/Preprocess/make.rules b/ws/Docbook/Preprocess/make.rules index 6222ac4286e088de73c41538a479f78fceeb7a34..8b759a92061e8ae71ff6d969ca4095d6ac1189d8 100644 --- a/ws/Docbook/Preprocess/make.rules +++ b/ws/Docbook/Preprocess/make.rules @@ -27,6 +27,7 @@ callout.graphics=0 \ callout.unicode=1 \ graphicsize.use.img.src.path=1 \ highlight.source=1 \ +generate.id.attributes=1 \ use.id.as.filename=1 \ id.warnings=1 \ ulink.target=_blank \