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

Prepare structural tabs support presentation of variablelist #606

Merged
merged 1 commit into from
Feb 16, 2024
Merged
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
111 changes: 111 additions & 0 deletions suse2022-ns/xhtml/lists.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,117 @@
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="exsl d">

<xsl:template match="d:variablelist">
<xsl:variable name="pi-presentation">
<xsl:call-template name="pi.dbhtml_list-presentation" />
</xsl:variable>
<!-- Handle spacing="compact" as multiple class attribute instead
of the deprecated HTML compact attribute -->

<xsl:variable name="presentation">
<xsl:choose>
<xsl:when test="$pi-presentation != ''">
<xsl:value-of select="$pi-presentation" />
</xsl:when>
<xsl:when test="$variablelist.as.table != 0">
<xsl:value-of select="'table'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'list'" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="default.class">
<xsl:value-of select="local-name()" />
<xsl:if test="@spacing = 'compact'">
<xsl:text> compact</xsl:text>
</xsl:if>
<!-- Added to support tabs -->
<xsl:if test="@role = 'tabs' or $presentation = 'tabs'">
<xsl:text> tabs</xsl:text>
</xsl:if>
</xsl:variable>

<xsl:variable name="list-width">
<xsl:call-template name="pi.dbhtml_list-width" />
</xsl:variable>

<xsl:variable name="term-width">
<xsl:call-template name="pi.dbhtml_term-width" />
</xsl:variable>

<xsl:variable name="table-summary">
<xsl:call-template name="pi.dbhtml_table-summary" />
</xsl:variable>

<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:if test="d:title|d:info/d:title">
<xsl:call-template name="formal.object.heading"/>
</xsl:if>

<xsl:choose>
<xsl:when test="$presentation = 'table'">
<!-- Preserve order of PIs and comments -->
<xsl:apply-templates
select="*[not(self::d:varlistentry or self::d:title or self::d:titleabbrev)]
| comment()[not(preceding-sibling::d:varlistentry)]
| processing-instruction()[not(preceding-sibling::d:varlistentry)]" />
<table border="{$table.border.off}">
<xsl:call-template name="generate.class.attribute">
<xsl:with-param name="class" select="$default.class" />
</xsl:call-template>
<xsl:if test="$list-width != ''">
<xsl:attribute name="width">
<xsl:value-of select="$list-width" />
</xsl:attribute>
</xsl:if>
<xsl:if test="$table-summary != ''">
<xsl:attribute name="summary">
<xsl:value-of select="$table-summary" />
</xsl:attribute>
</xsl:if>
<colgroup>
<col align="{$direction.align.start}" valign="top">
<xsl:if test="$term-width != ''">
<xsl:attribute name="width">
<xsl:value-of select="$term-width" />
</xsl:attribute>
</xsl:if>
</col>
<col />
</colgroup>
<tbody>
<xsl:apply-templates mode="varlist-table"
select="d:varlistentry | comment()[preceding-sibling::d:varlistentry]
| processing-instruction()[preceding-sibling::d:varlistentry]"
/>
</tbody>
</table>
</xsl:when>
<xsl:otherwise>
<!-- Preserve order of PIs and comments -->
<xsl:apply-templates
select="*[not(self::d:varlistentry or self::d:title or self::d:titleabbrev)]
| comment()[not(preceding-sibling::d:varlistentry)]
| processing-instruction()[not(preceding-sibling::d:varlistentry)]" />
<dl>
<xsl:call-template name="generate.class.attribute">
<xsl:with-param name="class" select="$default.class" />
</xsl:call-template>
<xsl:apply-templates
select="d:varlistentry | comment()[preceding-sibling::d:varlistentry]
| processing-instruction()[preceding-sibling::d:varlistentry]"
/>
</dl>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>


<xsl:template match="d:varlistentry">
<dt>
Expand Down
Loading