Skip to content

Commit

Permalink
Fix topic titles
Browse files Browse the repository at this point in the history
  • Loading branch information
jelovirt committed Dec 22, 2024
1 parent 7391778 commit 944d773
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
6 changes: 4 additions & 2 deletions src/generator/com/elovirta/pdf/commons.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@
</axsl:call-template>
<axsl:text><xsl:text> </xsl:text></axsl:text>

<axsl:apply-templates select="*[contains(@class,' topic/title ')]" mode="getTitle"/>
<!-- <axsl:apply-templates select="*[contains(@class,' topic/title ')]" mode="getTitle"/>-->
<axsl:apply-templates select="*[contains(@class,' topic/title ')]/node()"/>
</fo:block>

<!-- <axsl:apply-templates select="* except(*[contains(@class, ' topic/title ') or-->
Expand Down Expand Up @@ -416,7 +417,8 @@
</axsl:call-template>
<axsl:text><xsl:text> </xsl:text></axsl:text>

<axsl:apply-templates select="*[contains(@class,' topic/title ')]" mode="getTitle"/>
<!-- <axsl:apply-templates select="*[contains(@class,' topic/title ')]" mode="getTitle"/>-->
<axsl:apply-templates select="*[contains(@class,' topic/title ')]/node()"/>
</fo:block>

<axsl:choose>
Expand Down
24 changes: 12 additions & 12 deletions src/generator/com/elovirta/pdf/topic.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
</xsl:attribute>
</axsl:variable>

<!-- <axsl:template match="*[contains(@class, ' topic/topic ')]/*[contains(@class, ' topic/title ')]" mode="getTitle">-->
<!-- <axsl:variable name="topic" select="ancestor-or-self::*[contains(@class, ' topic/topic ')][1]"/>-->
<!-- <axsl:variable name="contents" as="node()*" select="e:get-title-number($topic)"/>-->
<!-- <axsl:if test="exists($contents)">-->
<!-- <axsl:copy-of select="$contents"/>-->
<!--&lt;!&ndash; <fo:leader leader-pattern="space" leader-length="from-nearest-specified-value(font-size)"/>&ndash;&gt;-->
<!-- <axsl:text>-->
<!-- <xsl:text> </xsl:text>-->
<!-- </axsl:text>-->
<!-- </axsl:if>-->
<!-- <axsl:apply-templates/>-->
<!-- </axsl:template>-->
<axsl:template match="*[contains(@class, ' topic/topic ')]/*[contains(@class, ' topic/title ')]" mode="getTitle">
<axsl:variable name="topic" select="ancestor-or-self::*[contains(@class, ' topic/topic ')][1]"/>
<axsl:variable name="contents" as="node()*" select="e:get-title-number($topic)"/>
<axsl:if test="exists($contents)">
<axsl:copy-of select="$contents"/>
<!-- <fo:leader leader-pattern="space" leader-length="from-nearest-specified-value(font-size)"/>-->
<axsl:text>
<xsl:text> </xsl:text>
</axsl:text>
</axsl:if>
<axsl:apply-templates/>
</axsl:template>

<xsl:choose>
<xsl:when test="$root ?style-chapter-numbering = 'document'">
Expand Down
9 changes: 7 additions & 2 deletions src/main/resources/com/elovirta/pdf/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@
"maximum-level": 6
},
"style": {
"body": {
"start-indent": "0pt"
},
"h1": {
"font-weight": "bold"
"title-numbering": true,
"border-style": "none"
},
"h2": {
"title-numbering": true
"title-numbering": true,
"border-style": "none"
},
"h3": {
"title-numbering": true
Expand Down

0 comments on commit 944d773

Please sign in to comment.