Skip to content

Commit

Permalink
Merge pull request #627 from openSUSE/docteam1368-trd-series
Browse files Browse the repository at this point in the history
DOCTEAM-1368: Take TRD series from a parameter
  • Loading branch information
tomschr authored May 14, 2024
2 parents 64eed0b + 00c501f commit 875dcf6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
13 changes: 10 additions & 3 deletions trd/fo/article.titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<fo:table-column column-number="2" /><!-- column-width="75%" -->

<fo:table-body>
<fo:table-cell text-align="start">
<fo:block>
<fo:table-cell text-align="start">
<fo:block padding-top="0pt" margin-top="-10pt" margin-left="-10pt">
<fo:instream-foreign-object
content-width="{$titlepage.logo.width.article}"
width="{$titlepage.logo.width}">
Expand All @@ -39,7 +39,14 @@
</fo:table-cell>
<fo:table-cell text-align="right" color="&c_jungle;">
<fo:block font-size="&x-large;pt" hyphenate="false">
<xsl:apply-templates select="d:info/d:meta[@name='series'][1]" mode="article.titlepage.recto.auto.mode"/>
<xsl:choose>
<xsl:when test="$json-ld-seriesname != ''">
<xsl:value-of select="$json-ld-seriesname"/>
</xsl:when>
<xsl:when test="d:info/d:meta[@name='series']">
<xsl:apply-templates select="d:info/d:meta[@name='series'][1]" mode="article.titlepage.recto.auto.mode"/>
</xsl:when>
</xsl:choose>
</fo:block>
<fo:block font-size="&large;pt">
<xsl:apply-templates select="d:info/d:meta[@name='type'][1]" mode="article.titlepage.recto.auto.mode"/>
Expand Down
9 changes: 8 additions & 1 deletion trd/fo/book.titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@
</fo:table-cell>
<fo:table-cell text-align="right" color="&c_jungle;">
<fo:block font-size="&xxx-large;pt">
<xsl:apply-templates select="d:info/d:meta[@name='series'][1]" mode="book.titlepage.recto.auto.mode"/>
<xsl:choose>
<xsl:when test="$json-ld-seriesname != ''">
<xsl:value-of select="$json-ld-seriesname"/>
</xsl:when>
<xsl:when test="d:info/d:meta[@name='series']">
<xsl:apply-templates select="d:info/d:meta[@name='series'][1]" mode="book.titlepage.recto.auto.mode"/>
</xsl:when>
</xsl:choose>
</fo:block>
<fo:block font-size="&large;pt">
<xsl:apply-templates select="d:info/d:meta[@name='category'][1]" mode="book.titlepage.recto.auto.mode"/>
Expand Down
2 changes: 1 addition & 1 deletion trd/fo/param.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
exclude-result-prefixes="d">

<xsl:param name="titlepage.logo.image"><xsl:value-of select="$styleroot"/>images/trd-lightbulb-title.svg</xsl:param>

<xsl:param name="json-ld-seriesname">Technical Reference Documentation</xsl:param>

<xsl:attribute-set name="book.titlepage.recto.style">
<xsl:attribute name="font-family"><xsl:value-of select="$title.font.family"/></xsl:attribute>
Expand Down
3 changes: 2 additions & 1 deletion trd/xhtml/book.titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
</xsl:variable>
<xsl:variable name="authorgroup" select="exsl:node-set($rtf.authorgroup)"/>

<!--
<xsl:message>author[1] mode="book.titlepage.recto.auto.mode"
content of authorgroup = <xsl:value-of select="count($authorgroup/*/*)"/>
following-sibling::d:author=<xsl:value-of select="count(following-sibling::d:author)"/>
Expand All @@ -66,7 +67,7 @@
following-sibling::d:othercredit=<xsl:value-of select="count(following-sibling::d:othercredit)"/>
preceding-sibling::d:othercredit=<xsl:value-of select="count(preceding-sibling::d:othercredit)"/>
</xsl:message>

-->
<!-- Delegate all collected nodes to the authorgroup template -->
<xsl:apply-templates select="$authorgroup" mode="book.titlepage.recto.auto.mode"/>
</xsl:template>
Expand Down
1 change: 1 addition & 0 deletions trd/xhtml/param.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="json-ld-seriesname">Technical Reference Documentation</xsl:param>
</xsl:stylesheet>

0 comments on commit 875dcf6

Please sign in to comment.