Skip to content

Commit cd153b5

Browse files
committed
doc: Don't hide the "Up" link when it is the same as "Home"
The original stylesheets seemed to think this was a good idea, but our users find it confusing and unhelpful, so undo that logic. Reported-by: Fabien COELHO <coelho@cri.ensmp.fr> Discussion: https://www.postgresql.org/message-id/flat/alpine.DEB.2.22.394.2006210914370.859381%40pseudo
1 parent 76af974 commit cd153b5

File tree

1 file changed

+159
-4
lines changed

1 file changed

+159
-4
lines changed

doc/src/sgml/stylesheet.xsl

Lines changed: 159 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Customization of header
5757
<xsl:variable name="row1" select="$navig.showtitles != 0"/>
5858
<xsl:variable name="row2" select="count($prev) &gt; 0
5959
or (count($up) &gt; 0
60-
and generate-id($up) != generate-id($home)
6160
and $navig.showtitles != 0)
6261
or count($next) &gt; 0"/>
6362

@@ -95,8 +94,7 @@ Customization of header
9594
</td>
9695
<td width="10%" align="{$direction.align.start}">
9796
<xsl:choose>
98-
<xsl:when test="count($up)&gt;0
99-
and generate-id($up) != generate-id($home)">
97+
<xsl:when test="count($up)&gt;0">
10098
<a accesskey="u">
10199
<xsl:attribute name="href">
102100
<xsl:call-template name="href.target">
@@ -117,7 +115,6 @@ Customization of header
117115
<th width="60%" align="center">
118116
<xsl:choose>
119117
<xsl:when test="count($up) > 0
120-
and generate-id($up) != generate-id($home)
121118
and $navig.showtitles != 0">
122119
<xsl:apply-templates select="$up" mode="object.title.markup"/>
123120
</xsl:when>
@@ -176,4 +173,162 @@ Customization of header
176173
</xsl:if>
177174
</xsl:template>
178175

176+
177+
<!--
178+
Customization of footer
179+
- don't hide redundant Up link
180+
- add tool tips to links
181+
182+
(overrides html/chunk-common.xsl)
183+
-->
184+
<xsl:template name="footer.navigation">
185+
<xsl:param name="prev" select="/foo"/>
186+
<xsl:param name="next" select="/foo"/>
187+
<xsl:param name="nav.context"/>
188+
189+
<xsl:variable name="home" select="/*[1]"/>
190+
<xsl:variable name="up" select="parent::*"/>
191+
192+
<xsl:variable name="row1" select="count($prev) &gt; 0
193+
or count($up) &gt; 0
194+
or count($next) &gt; 0"/>
195+
196+
<xsl:variable name="row2" select="($prev and $navig.showtitles != 0)
197+
or (generate-id($home) != generate-id(.)
198+
or $nav.context = 'toc')
199+
or ($chunk.tocs.and.lots != 0
200+
and $nav.context != 'toc')
201+
or ($next and $navig.showtitles != 0)"/>
202+
203+
<xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
204+
<div class="navfooter">
205+
<xsl:if test="$footer.rule != 0">
206+
<hr/>
207+
</xsl:if>
208+
209+
<xsl:if test="$row1 or $row2">
210+
<table width="100%" summary="Navigation footer">
211+
<xsl:if test="$row1">
212+
<tr>
213+
<td width="40%" align="{$direction.align.start}">
214+
<xsl:if test="count($prev)>0">
215+
<a accesskey="p">
216+
<xsl:attribute name="href">
217+
<xsl:call-template name="href.target">
218+
<xsl:with-param name="object" select="$prev"/>
219+
</xsl:call-template>
220+
</xsl:attribute>
221+
<xsl:attribute name="title">
222+
<xsl:apply-templates select="$prev" mode="object.title.markup"/>
223+
</xsl:attribute>
224+
<xsl:call-template name="navig.content">
225+
<xsl:with-param name="direction" select="'prev'"/>
226+
</xsl:call-template>
227+
</a>
228+
</xsl:if>
229+
<xsl:text>&#160;</xsl:text>
230+
</td>
231+
<td width="20%" align="center">
232+
<xsl:choose>
233+
<xsl:when test="count($up)&gt;0">
234+
<a accesskey="u">
235+
<xsl:attribute name="href">
236+
<xsl:call-template name="href.target">
237+
<xsl:with-param name="object" select="$up"/>
238+
</xsl:call-template>
239+
</xsl:attribute>
240+
<xsl:attribute name="title">
241+
<xsl:apply-templates select="$up" mode="object.title.markup"/>
242+
</xsl:attribute>
243+
<xsl:call-template name="navig.content">
244+
<xsl:with-param name="direction" select="'up'"/>
245+
</xsl:call-template>
246+
</a>
247+
</xsl:when>
248+
<xsl:otherwise>&#160;</xsl:otherwise>
249+
</xsl:choose>
250+
</td>
251+
<td width="40%" align="{$direction.align.end}">
252+
<xsl:text>&#160;</xsl:text>
253+
<xsl:if test="count($next)>0">
254+
<a accesskey="n">
255+
<xsl:attribute name="href">
256+
<xsl:call-template name="href.target">
257+
<xsl:with-param name="object" select="$next"/>
258+
</xsl:call-template>
259+
</xsl:attribute>
260+
<xsl:attribute name="title">
261+
<xsl:apply-templates select="$next" mode="object.title.markup"/>
262+
</xsl:attribute>
263+
<xsl:call-template name="navig.content">
264+
<xsl:with-param name="direction" select="'next'"/>
265+
</xsl:call-template>
266+
</a>
267+
</xsl:if>
268+
</td>
269+
</tr>
270+
</xsl:if>
271+
272+
<xsl:if test="$row2">
273+
<tr>
274+
<td width="40%" align="{$direction.align.start}" valign="top">
275+
<xsl:if test="$navig.showtitles != 0">
276+
<xsl:apply-templates select="$prev" mode="object.title.markup"/>
277+
</xsl:if>
278+
<xsl:text>&#160;</xsl:text>
279+
</td>
280+
<td width="20%" align="center">
281+
<xsl:choose>
282+
<xsl:when test="$home != . or $nav.context = 'toc'">
283+
<a accesskey="h">
284+
<xsl:attribute name="href">
285+
<xsl:call-template name="href.target">
286+
<xsl:with-param name="object" select="$home"/>
287+
</xsl:call-template>
288+
</xsl:attribute>
289+
<xsl:attribute name="title">
290+
<xsl:apply-templates select="$home" mode="object.title.markup"/>
291+
</xsl:attribute>
292+
<xsl:call-template name="navig.content">
293+
<xsl:with-param name="direction" select="'home'"/>
294+
</xsl:call-template>
295+
</a>
296+
<xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
297+
<xsl:text>&#160;|&#160;</xsl:text>
298+
</xsl:if>
299+
</xsl:when>
300+
<xsl:otherwise>&#160;</xsl:otherwise>
301+
</xsl:choose>
302+
303+
<xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
304+
<a accesskey="t">
305+
<xsl:attribute name="href">
306+
<xsl:value-of select="$chunked.filename.prefix"/>
307+
<xsl:apply-templates select="/*[1]"
308+
mode="recursive-chunk-filename">
309+
<xsl:with-param name="recursive" select="true()"/>
310+
</xsl:apply-templates>
311+
<xsl:text>-toc</xsl:text>
312+
<xsl:value-of select="$html.ext"/>
313+
</xsl:attribute>
314+
<xsl:call-template name="gentext">
315+
<xsl:with-param name="key" select="'nav-toc'"/>
316+
</xsl:call-template>
317+
</a>
318+
</xsl:if>
319+
</td>
320+
<td width="40%" align="{$direction.align.end}" valign="top">
321+
<xsl:text>&#160;</xsl:text>
322+
<xsl:if test="$navig.showtitles != 0">
323+
<xsl:apply-templates select="$next" mode="object.title.markup"/>
324+
</xsl:if>
325+
</td>
326+
</tr>
327+
</xsl:if>
328+
</table>
329+
</xsl:if>
330+
</div>
331+
</xsl:if>
332+
</xsl:template>
333+
179334
</xsl:stylesheet>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy