Skip to content
Snippets Groups Projects
Commit 7a0e400c authored by Goik Martin's avatar Goik Martin
Browse files

Numbering exercises per lecture

parent 08127ed9
No related branches found
No related tags found
No related merge requests found
......@@ -76,8 +76,13 @@
<xsl:call-template name="id.attribute">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:variable name="parentId" select="ancestor::d:part/@xml:id"/>
<p>
<img title="Exercise" alt="exercise" style="vertical-align: middle;" width="40em" src="common/images/yoga-exercise.svg"/>
<xsl:text> No. </xsl:text>
<xsl:value-of select="count(preceding::d:qandaset[ancestor::d:part/@xml:id = $parentId]) + 1"/>
</p>
<img title="Exercise" alt="exercise" style="vertical-align: middle;" width="40em" src="common/images/yoga-exercise.svg"/>
<xsl:apply-templates select="$title"/>
<xsl:if test="not($title)">
<!-- andhor is output on title if there is one -->
......@@ -85,7 +90,7 @@
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1') and not(ancestor::d:answer and not($qanda.nested.in.toc=0))">
<xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1') and not(ancestor::d:answer and not($qanda.nested.in.toc=0))">
<xsl:call-template name="process.qanda.toc"/>
</xsl:if>
<xsl:apply-templates select="$preamble"/>
......
......@@ -43,15 +43,20 @@
<caption>
<xsl:text>Exercises in </xsl:text>
<emphasis>
<xsl:value-of select="db:info/db:title" />
<xsl:value-of select="ancestor-or-self::db:part/db:title" />
</emphasis>
</caption>
<col width="25%" />
<col width="2%" />
<col width="45%" />
<col width="30%" />
<col width="28%" />
<tr>
<th>Chapter</th>
<th>Exercise title / page</th>
<th rowspan="2">Chapter</th>
<th colspan="3">Exercise</th>
</tr>
<tr>
<th>No.</th>
<th>Title</th>
<th>Status of completion</th>
</tr>
......@@ -63,6 +68,9 @@
<xref linkend="{current-grouping-key()}"/>
</td>
</xsl:if>
<td style="text-align: right;">
<xsl:apply-templates select="." mode="qandaNumber"/>
</td>
<td>
<xsl:apply-templates select="." mode="selectOwnOrInheritedTitle"/>
</td>
......@@ -72,12 +80,20 @@
</xsl:for-each-group>
</table>
<!-- Not really useful:
<xsl:apply-templates select="db:chapter[descendant::db:qandaset]" mode="genQuandaset"/>
-->
</appendix>
</xsl:if>
</xsl:copy>
</xsl:template>
<xsl:template match="db:qandaset" mode="qandaNumber">
<xsl:variable name="parentId" select="ancestor::db:part/@xml:id"/>
<xsl:value-of select="count(preceding::db:qandaset[ancestor::db:part/@xml:id = $parentId]) + 1"/>
</xsl:template>
<xsl:template match="db:chapter" mode="genQuandaset">
<section xml:id="{@xml:id}_qanda">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment