Skip to content

Commit

Permalink
Add part and chapter TOC max depth
Browse files Browse the repository at this point in the history
  • Loading branch information
jelovirt committed Oct 20, 2024
1 parent 2a966d6 commit 90d8a48
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/generator/com/elovirta/pdf/toc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@

<!-- Part TOC -->

<axsl:variable name="e:partTocMaximumLevel" select="{($root ?style-part-toc-maximum-level, 6)[1] + 1}"/>

<axsl:template match="node()" mode="part-toc">
<axsl:param name="include"/>
<axsl:apply-templates mode="#current">
Expand All @@ -138,7 +140,7 @@
<axsl:variable name="topicLevel" as="xs:integer">
<axsl:apply-templates select="." mode="get-topic-level"/>
</axsl:variable>
<axsl:if test="$topicLevel &lt; $tocMaximumLevel">
<axsl:if test="$topicLevel &lt; $e:partTocMaximumLevel">
<axsl:variable name="mapTopicref" select="key('map-id', @id)[1]" as="element()?"/>
<axsl:choose>
<axsl:when test="$mapTopicref[@toc = 'yes' or not(@toc)] or
Expand Down Expand Up @@ -203,7 +205,9 @@
</axsl:if>
</axsl:template>

<!-- Chapter TOC -->
<!-- Chapter TOC -->

<axsl:variable name="e:chapterTocMaximumLevel" select="{($root ?style-chapter-toc-maximum-level, 6)[1] + 2}"/>

<axsl:template match="node()" mode="chapter-toc">
<axsl:param name="include"/>
Expand All @@ -217,7 +221,7 @@
<axsl:variable name="topicLevel" as="xs:integer">
<axsl:apply-templates select="." mode="get-topic-level"/>
</axsl:variable>
<axsl:if test="$topicLevel &lt; $tocMaximumLevel">
<axsl:if test="$topicLevel &lt; $e:chapterTocMaximumLevel">
<axsl:variable name="mapTopicref" select="key('map-id', @id)[1]" as="element()?"/>
<axsl:choose>
<axsl:when test="$mapTopicref[@toc = 'yes' or not(@toc)] or
Expand Down

0 comments on commit 90d8a48

Please sign in to comment.