Skip to content

Commit 1a7c5b6

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 ac695b8 commit 1a7c5b6

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
@@ -46,7 +46,6 @@ Customization of header
4646
<xsl:variable name="row1" select="$navig.showtitles != 0"/>
4747
<xsl:variable name="row2" select="count($prev) &gt; 0
4848
or (count($up) &gt; 0
49-
and generate-id($up) != generate-id($home)
5049
and $navig.showtitles != 0)
5150
or count($next) &gt; 0"/>
5251

@@ -84,8 +83,7 @@ Customization of header
8483
</td>
8584
<td width="10%" align="{$direction.align.start}">
8685
<xsl:choose>
87-
<xsl:when test="count($up)&gt;0
88-
and generate-id($up) != generate-id($home)">
86+
<xsl:when test="count($up)&gt;0">
8987
<a accesskey="u">
9088
<xsl:attribute name="href">
9189
<xsl:call-template name="href.target">
@@ -106,7 +104,6 @@ Customization of header
106104
<th width="60%" align="center">
107105
<xsl:choose>
108106
<xsl:when test="count($up) > 0
109-
and generate-id($up) != generate-id($home)
110107
and $navig.showtitles != 0">
111108
<xsl:apply-templates select="$up" mode="object.title.markup"/>
112109
</xsl:when>
@@ -165,4 +162,162 @@ Customization of header
165162
</xsl:if>
166163
</xsl:template>
167164

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

0 commit comments

Comments
 (0)