Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support broken glosslist in HTML #433

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ div.variablelist


.glossary,
.variablelist
.variablelist,
.glosslist
dt
color: $c_pine
font-weight: 600
Expand Down Expand Up @@ -103,15 +104,17 @@ div.variablelist
.list-of-examples,
.list-of-figures,
.list-of-procedures,
.list-of-tables
.list-of-tables,
.glosslist
dl
margin: 5px 0 17px 0
padding: 0 0 0 30px


.glossary,
.toc,
.variablelist
.variablelist,
.glosslist
dd > p
margin: 0

Expand Down Expand Up @@ -188,6 +191,7 @@ div.figure

.example-title,
.figure-title,
.glosslist-title,
.itemizedlist-title,
.orderedlist-title,
.procedure-title,
Expand All @@ -204,6 +208,7 @@ div.figure
.example-title,
.itemizedlist-title,
.procedure-title,
.glosslist-title,
.table-title,
.variablelist-title
padding-top: 0
Expand Down Expand Up @@ -241,6 +246,7 @@ div.figure

.example-title,
.figure-title,
.glosslist-title,
.itemizedlist-title,
.orderedlist-title,
.procedure-title,
Expand Down
23 changes: 13 additions & 10 deletions suse2013/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1742,13 +1742,13 @@ p, .simplelist td {
}

.title .xref, .subtitle .xref, .table-title .xref, .example-title .xref,
.figure-title .xref, .procedure-title .xref, .orderedlist-title .xref,
.figure-title .xref, .glosslist-title .xref, .procedure-title .xref, .orderedlist-title .xref,
.itemizedlist-title .xref, .variablelist-title .xref, .qandadiv-title .xref,
.title .link, .subtitle .link, .table-title .link, .example-title .link,
.figure-title .link, .procedure-title .link, .orderedlist-title .link,
.figure-title .link, .glosslist-title .link, .procedure-title .link, .orderedlist-title .link,
.itemizedlist-title .link, .variablelist-title .link, .qandadiv-title .link,
.title .ulink, .subtitle .ulink, .table-title .ulink, .example-title .ulink,
.figure-title .ulink, .procedure-title .ulink, .orderedlist-title .ulink,
.figure-title .ulink, .glosslist-title .ulink, .procedure-title .ulink, .orderedlist-title .ulink,
.itemizedlist-title .ulink, .variablelist-title .ulink, .qandadiv-title .ulink {
text-decoration: underline;
}
Expand Down Expand Up @@ -1782,6 +1782,7 @@ p, .simplelist td {
.table-title .xref:hover, .table-title .xref:focus, .table-title .xref:active,
.figure-title .xref:hover, .figure-title .xref:focus, .figure-title .xref:active,
.example-title .xref:hover, .example-title .xref:focus, .example-title .xref:active,
.glosslist-title .xref:hover, .glosslist-title .xref:focus, .glosslist-title .xref:active,
.procedure-title .xref:hover, .procedure-title .xref:focus, .procedure-title .xref:active,
.orderedlist-title .xref:hover, .orderedlist-title .xref:focus, .orderedlist-title .xref:active,
.itemizedlist-title .xref:hover, .itemizedlist-title .xref:focus, .itemizedlist-title .xref:active,
Expand Down Expand Up @@ -2026,7 +2027,7 @@ div.variablelist, .toc {
margin: 0;
}

.variablelist dt, .glossary dt {
.variablelist dt, .glosslist dt, .glossary dt {
font-weight: 600;
color: #000;
margin: 0;
Expand All @@ -2052,7 +2053,7 @@ div.variablelist, .toc {
}


.variablelist dd, .glossary dd, .toc dd, .indexdiv dd {
.variablelist dd, .glosslist dd, .glossary dd, .toc dd, .indexdiv dd {
margin: 0 0 17px 0;
padding: 0 0 0 30px;
}
Expand All @@ -2064,7 +2065,7 @@ div.variablelist, .toc {
padding: 0 0 0 30px;
}

.variablelist dd > p, .glossary dd > p,
.variablelist dd > p, .glosslist dd > p, .glossary dd > p,
.toc dd > p {
margin: 0;
}
Expand Down Expand Up @@ -2167,7 +2168,7 @@ a:hover .package, a:focus .package, a:active .package {
}

.procedure-title, .table-title, .example-title,
.figure-title, .orderedlist-title, .variablelist-title,
.figure-title, .glosslist-title, .orderedlist-title, .variablelist-title,
.itemizedlist-title, .qandadiv-title {
font-size: 14px;
font-weight: normal;
Expand All @@ -2176,7 +2177,7 @@ a:hover .package, a:focus .package, a:active .package {
line-height: 120%;
}

.table-title, .example-title, .procedure-title,
.glosslist-title, .table-title, .example-title, .procedure-title,
.variablelist-title, .itemizedlist-title {
position: relative;
padding-top: 0;
Expand All @@ -2199,7 +2200,7 @@ a:hover .package, a:focus .package, a:active .package {
margin: 24px 0 10px;
}

.variablelist-title {
.glosslist-title, .variablelist-title {
margin: 24px 0 10px;
}

Expand All @@ -2224,6 +2225,8 @@ a:hover .package, a:focus .package, a:active .package {
.example-title .literal, .example-title .package,
.figure-title code, .figure-title .replaceable, .figure-title .keycap,
.figure-title .literal, .figure-title .package,
.glosslist-title code, .glosslist-title .replaceable, .glosslist-title .keycap,
.glosslist-title .literal, .glosslist-title .package,
.orderedlist-title code, .orderedlist-title .replaceable, .orderedlist-title .keycap,
.orderedlist-title .literal, .orderedlist-title .package,
.variablelist-title code, .variablelist-title .replaceable, .variablelist-title .keycap,
Expand Down Expand Up @@ -3128,7 +3131,7 @@ p.ds-message {
}

.list-of-figures dl, .list-of-tables dl, .list-of-examples dl,
.list-of-procedures dl, .list-of-equations dl, .variablelist dd, .glossary dd,
.list-of-procedures dl, .list-of-equations dl, .glosslist dl, .variablelist dd, .glossary dd,
.toc dd, .indexdiv dd {
padding-left: 10px;
}
Expand Down
53 changes: 52 additions & 1 deletion suse2013/xhtml/glossary.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
xmlns="http://www.w3.org/1999/xhtml"
xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
exclude-result-prefixes="exsl l t">
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="exsl l t xlink">

<xsl:template match="glossary">
<xsl:variable name="language">
Expand Down Expand Up @@ -143,4 +144,54 @@
<xsl:apply-templates select="indexterm|revhistory|glosssee|glossdef"/>
</xsl:template>


<xsl:template match="glossseealso">
<xsl:variable name="otherterm" select="(@otherterm|@linkend)[1]"/><!-- SUSE -->
<xsl:variable name="targets" select="key('id', $otherterm)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="xlink" select="@xlink:href"/>

<xsl:choose>
<xsl:when test="$target">
<a>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target" mode="xref-to"/>
</a>
</xsl:when>
<xsl:when test="$xlink">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$otherterm != '' and not($target)">
<xsl:message>
<xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
<xsl:value-of select="$otherterm"/>
</xsl:message>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>

<xsl:choose>
<xsl:when test="position() = last()"/>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'glossary'"/>
<xsl:with-param name="name" select="'seealso-separator'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>
16 changes: 13 additions & 3 deletions suse2022-ns/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2752,7 +2752,8 @@ div.variablelist {
margin: 24px 0; }

.glossary dt,
.variablelist dt {
.variablelist dt,
.glosslist dt {
color: #0c322c;
font-weight: 600;
margin: 0;
Expand Down Expand Up @@ -2784,13 +2785,15 @@ div.variablelist {
.list-of-examples dl,
.list-of-figures dl,
.list-of-procedures dl,
.list-of-tables dl {
.list-of-tables dl,
.glosslist dl {
margin: 5px 0 17px 0;
padding: 0 0 0 30px; }

.glossary dd > p,
.toc dd > p,
.variablelist dd > p {
.variablelist dd > p,
.glosslist dd > p {
margin: 0; }

div.figure {
Expand Down Expand Up @@ -2855,6 +2858,7 @@ div.figure {

.example-title,
.figure-title,
.glosslist-title,
.itemizedlist-title,
.orderedlist-title,
.procedure-title,
Expand All @@ -2870,6 +2874,7 @@ div.figure {
.example-title,
.itemizedlist-title,
.procedure-title,
.glosslist-title,
.table-title,
.variablelist-title {
padding-top: 0;
Expand Down Expand Up @@ -2908,6 +2913,11 @@ div.figure {
.figure-title .package,
.figure-title .replaceable,
.figure-title code,
.glosslist-title .keycap,
.glosslist-title .literal,
.glosslist-title .package,
.glosslist-title .replaceable,
.glosslist-title code,
.itemizedlist-title .keycap,
.itemizedlist-title .literal,
.itemizedlist-title .package,
Expand Down
49 changes: 49 additions & 0 deletions suse2022-ns/xhtml/glossary.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,53 @@
<xsl:apply-templates select="d:indexterm|d:revhistory|d:glosssee|d:glossdef"/>
</xsl:template>


<xsl:template match="d:glossseealso">
<xsl:variable name="otherterm" select="(@otherterm|@linkend)[1]"/><!-- SUSE -->
<xsl:variable name="targets" select="key('id', $otherterm)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="xlink" select="@xlink:href"/>

<xsl:choose>
<xsl:when test="$target">
<a>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target" mode="xref-to"/>
</a>
</xsl:when>
<xsl:when test="$xlink">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$otherterm != '' and not($target)">
<xsl:message>
<xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
<xsl:value-of select="$otherterm"/>
</xsl:message>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>

<xsl:choose>
<xsl:when test="position() = last()"/>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'glossary'"/>
<xsl:with-param name="name" select="'seealso-separator'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>