Skip to content

Commit

Permalink
Process <revhistory> in book & article title pages
Browse files Browse the repository at this point in the history
* Integrate it in title page
* Introduce additional parameters:
  * $generate.revhistory=1|0
    Enable/disable revhistory processing
  * $revision.limit=''|INT
    Limit the revision list to INT entries.
    If empty, display all
  * $revision.add.div.title=1|0
    If there is no revhistory/title, should the article/book
    title be included after the default "Revision History"?
* Sort the revision entries by date
* Add CSS style
* Change link to revhistory page:
  * Add ARIA attributes for revhistory link on title page
  * Open a new tab when clicked
* Include revhistory template in titlepage.mode
* Open link in
* Add revision key to l10n context=title
  • Loading branch information
tomschr committed Oct 18, 2023
1 parent 3a9b66e commit cf55c52
Show file tree
Hide file tree
Showing 29 changed files with 296 additions and 22 deletions.
9 changes: 9 additions & 0 deletions source-assets/styles2022/sass/custom/content-title.sass
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ h6
h1:has(.title-container)
padding: 80px 0 80px

.revhistory
margin-left: 2em
margin-right: 2em

.titlepage-revhistory
margin-top: 1em
margin-bottom: 1em


// FIXME: almost everything below needs a thorough cleanup!
.article,
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/ar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ translators apparently want those. - sknorr, 2016-09-30 -->

<l:context name="title">
<l:template name="part" text="الجزء&#160;%n&#160;%t"/>
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="keycap">
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/cs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@

<l:context name="title">
<l:template name="part" text="Díl&#160;%n „%t“" />
<l:template name="revhistory" text="%t"/>
</l:context>


Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/da.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@

<l:context name="title">
<l:template name="part" text="Del&#160;%n&#160;%t"/>
<l:template name="revhistory" text="%t"/>
</l:context>


Expand Down
4 changes: 4 additions & 0 deletions suse2022-ns/common/l10n/de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@
<l:template name="toc" text="%t"/>
</l:context>

<l:context name="title">
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="keycap">
<l:template name="alt" text="Alt"/>
<l:template name="backspace" text="&lt;&#x2014;"/>
Expand Down
2 changes: 1 addition & 1 deletion suse2022-ns/common/l10n/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@

<l:context name="title">
<l:template name="part" text="Part&#160;%n&#160;%t"/>
<l:template name="revhistory" text="%t"/>
</l:context>


<l:context name="keycap">
<l:template name="alt" text="Alt"/>
<l:template name="backspace" text="&lt;&#x2014;"/><!-- mdash -->
Expand Down
4 changes: 4 additions & 0 deletions suse2022-ns/common/l10n/es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@
<l:template name="toc" text="%t"/>
</l:context>

<l:context name="title">
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="keycap">
<l:template name="alt" text="Alt"/>
<l:template name="backspace" text="&lt;&#x2014;"/>
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/fi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@

<l:context name="title">
<l:template name="part" text="Osa&#160;%n&#160;%t"/>
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="keycap">
Expand Down
4 changes: 4 additions & 0 deletions suse2022-ns/common/l10n/fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@
<l:template name="toc" text="%t"/>
</l:context>

<l:context name="title">
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="keycap">
<l:template name="alt" text="Alt"/>
<l:template name="backspace" text="&lt;&#x2014;"/>
Expand Down
2 changes: 1 addition & 1 deletion suse2022-ns/common/l10n/hu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@
<l:context name="title">
<l:template name="part" text="%n&#160;%t&#160;r&#233;sz"/>
<l:template name="part" style="title" text="%n.&#160;r&#233;sz %t"/>
<l:template name="revhistory" text="%t"/>
</l:context>


<l:context name="keycap">
<l:template name="alt" text="Alt"/>
<l:template name="backspace" text="&lt;&#x2014;"/><!-- mdash -->
Expand Down
4 changes: 4 additions & 0 deletions suse2022-ns/common/l10n/it.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@
<l:template name="format" text="d.m.Y"/>
</l:context>

<l:context name="title">
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="keycap">
<l:template name="alt" text="Alt"/>
<l:template name="backspace" text="&lt;&#x2014;"/>
Expand Down
4 changes: 4 additions & 0 deletions suse2022-ns/common/l10n/ja.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@
<l:template name="toc" text="%t"/>
</l:context>

<l:context name="title">
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="keycap"><!-- FIXME: What are the Japanese keycaps? -->
<l:template name="alt" text="Alt"/>
<l:template name="backspace" text="&lt;&#x2014;"/><!-- mdash -->
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/ko.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
<l:context name="title-numbered">
<l:template name="Part" text="%n&#48512; %t"/>
<l:template name="part" text="%n&#48512; %t"/>
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="xref-number-and-title">
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/lt_lt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@

<l:context name="title">
<l:template name="part" text="%t&#160;%n&#160;dalis"/>
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="keycap">
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/nl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@

<l:context name="title">
<l:template name="part" text="Onderdeel&#160;%n&#160;%t"/>
<l:template name="revhistory" text="%t"/>
</l:context>


Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/no.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@

<l:context name="title">
<l:template name="part" text="Del&#160;%n&#160;%t"/>
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="msgset">
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/pl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@

<l:context name="title">
<l:template name="part" text="Cz&#x119;&#x15b;&#x107;&#160;%n&#160;%t"/>
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="msgset">
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/pt_br.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@

<l:context name="title">
<l:template name="part" text="Parte&#160;%n&#160;%t"/>
<l:template name="revhistory" text="%t"/>
</l:context>


Expand Down
3 changes: 3 additions & 0 deletions suse2022-ns/common/l10n/ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@
<l:template name="toc" text="%t"/>
</l:context>

<l:context name="title">
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="msgset">
<l:template name="alt" text="Alt"/>
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/sv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@

<l:context name="title">
<l:template name="part" text="Del&#160;%n&#160;%t"/>
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="msgset">
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/zh_cn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@

<l:context name="title">
<l:template name="chapter" text="&#31532;&#160;%n&#160;&#31456; %t"/>
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="xref-number-and-title">
Expand Down
1 change: 1 addition & 0 deletions suse2022-ns/common/l10n/zh_tw.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@

<l:context name="title">
<l:template name="part" text="%n. %t"/>
<l:template name="revhistory" text="%t"/>
</l:context>

<l:context name="title-numbered">
Expand Down
13 changes: 13 additions & 0 deletions suse2022-ns/common/titles.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@
</xsl:template>


<xsl:template match="d:revhistory" mode="title.markup">
<xsl:choose>
<xsl:when test="d:title | d:info/d:title">
<xsl:apply-templates mode="title.markup"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RevHistory'" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<!--
Temporary fix for version 1.78.1:
See upstream revision 9820. Remove this snippet, if there is a newer
Expand Down
8 changes: 8 additions & 0 deletions suse2022-ns/static/css/style-new.css
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,14 @@ h6 {
h1:has(.title-container) {
padding: 80px 0 80px; }

.revhistory {
margin-left: 2em;
margin-right: 2em; }

.titlepage-revhistory {
margin-top: 1em;
margin-bottom: 1em; }

.article .title,
.book .title,
.set .title {
Expand Down
8 changes: 8 additions & 0 deletions suse2022-ns/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,14 @@ h6 {
h1:has(.title-container) {
padding: 80px 0 80px; }

.revhistory {
margin-left: 2em;
margin-right: 2em; }

.titlepage-revhistory {
margin-top: 1em;
margin-bottom: 1em; }

.article .title,
.book .title,
.set .title {
Expand Down
30 changes: 15 additions & 15 deletions suse2022-ns/xhtml/docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -719,25 +719,25 @@
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="candidate.lang">
<xsl:choose>
<xsl:when test="$rootid">
<xsl:call-template name="l10n.language">
<xsl:with-param name="target" select="key('id', $rootid)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="l10n.language">
<xsl:with-param name="target" select="/*[1]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:call-template name="user.preroot"/>
<xsl:call-template name="root.messages"/>

<html>
<xsl:attribute name="lang">
<xsl:choose>
<xsl:when test="$rootid">
<xsl:call-template name="l10n.language">
<xsl:with-param name="target" select="key('id', $rootid)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="l10n.language">
<xsl:with-param name="target" select="/*[1]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<html lang="{$candidate.lang}" xml:lang="{$candidate.lang}">
<xsl:call-template name="root.attributes"/>
<head>
<xsl:call-template name="system.head.content">
Expand Down
18 changes: 18 additions & 0 deletions suse2022-ns/xhtml/param.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -489,4 +489,22 @@ task before
-->
<xsl:param name="qualtrics-feedback.js">static/js/qualtrics-feedback.js</xsl:param>

<!-- Limit the revhistory list to X entries
If it's empty, display all
-->
<xsl:param name="revision.limit"/>

<!-- In case there is not revhistory/title, should the article/book title be included
after the default "Revision History" string?
-->
<xsl:param name="revision.add.div.title" select="1"/>

<!--
$generate.revhistory = enable or disable revhistory generation
valid values: 0 or 1
-->
<xsl:param name="generate.revhistory" select="1"/>

<!-- Generates a separate file -->
<xsl:param name="generate.revhistory.link" select="1"/>
</xsl:stylesheet>
16 changes: 14 additions & 2 deletions suse2022-ns/xhtml/titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@

<!-- ===================================================== -->
<!-- article titlepage templates -->


<xsl:template match="d:authorgroup" mode="article.titlepage.recto.auto.mode">
<xsl:call-template name="add.authorgroup"/>
</xsl:template>
Expand Down Expand Up @@ -326,6 +328,10 @@
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:articleinfo/d:copyright"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:artheader/d:copyright"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:info/d:copyright"/>

<xsl:if test="number($generate.revhistory) = 1">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:info/d:revhistory"/>
</xsl:if>
</xsl:template>

<xsl:template name="article.titlepage.separator">
Expand Down Expand Up @@ -387,10 +393,12 @@
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="d:info/d:pubdate"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="d:setinfo/d:revision"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="d:info/d:revision"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="d:setinfo/d:revhistory"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="d:info/d:revhistory"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="d:setinfo/d:abstract"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="d:info/d:abstract"/>

<xsl:if test="number($generate.revhistory) = 1">
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="d:info/d:revhistory"/>
</xsl:if>
</xsl:template>
<!-- ===================================================== -->
<!-- book titlepage templates -->
Expand Down Expand Up @@ -432,6 +440,10 @@
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="d:bookinfo/d:abstract"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="d:info/d:abstract"/>

<xsl:if test="number($generate.revhistory) = 1">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="d:info/d:revhistory"/>
</xsl:if>

<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="d:bookinfo/d:corpauthor"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="d:info/d:corpauthor"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="d:bookinfo/d:authorgroup"/>
Expand Down
Loading

0 comments on commit cf55c52

Please sign in to comment.