Use Debian-style navigation header and footer instead of standard DocBook ones

In the header, drop the Prev/Next links and put:

- Debian logo
- Link to kernel team page
- "Breadcrumbs" for the handbook

all with the appropriate classes for the Debian stylesheet.

In the footer:

- Keep the Prev / Home / Next links in the footer
- Since there isn't any provision in the Debian stylesheet for navigation
  across multiple chapters, add our own rules for them
- Use flexbox instead of a table for layout
This commit is contained in:
Ben Hutchings 2023-06-26 21:58:02 +02:00
parent 88fa33d2e9
commit 96484534a4
6 changed files with 153 additions and 0 deletions

2
debian/changelog vendored
View file

@ -5,6 +5,8 @@ kernel-handbook (1.0.22) UNRELEASED; urgency=medium
* stylesheet.xsl: Use namespaced tags to allow embedding un-namespaced HTML
* Add/override some stylesheet rules to work better for DocBook-generated
HTML
* Use Debian-style navigation header and footer instead of standard DocBook
ones
-- Ben Hutchings <benh@debian.org> Mon, 26 Jun 2023 18:07:00 +0200

22
debian/copyright vendored
View file

@ -154,3 +154,25 @@ License: OPL-1+
Comment: No license options are exercised. See https://bugs.debian.org/384019
for discussions confirming DFSG-ness of this license when no options are
exercised.
Files: static/Pics/openlogo-50.png
Copyright: 1999, Software in the Public Interest, Inc.
License: LGPL-3+
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later
version.
.
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU Lesser General Public License for more
details.
.
You should have received a copy of the GNU Lesser General Public
License along with this package. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the full text of the GNU Lesser General Public
License version 3 can be found in the file
`/usr/share/common-licenses/LGPL-3'.

View file

@ -42,6 +42,15 @@ url="https://www.debian.org/opl">Open Publication License</ulink>,
Draft v1.0 or later.
</para>
<para>
The Debian Open Use logos are © 1999 Software in the Public Interest,
Inc. and are released under the terms of the <ulink
url="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public
License</ulink>, version 3 or any later version, or, at your option,
of the <ulink
url="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons
Attribution-ShareAlike 3.0 Unported License</ulink>.
</para>
<para>
This is distributed in the hope that it will be useful, but <emphasis>without
any warranty</emphasis>; without even the implied warranty of merchantability
or fitness for a particular purpose. See the license texts for more details.

BIN
static/Pics/openlogo-50.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -13,3 +13,20 @@ div.toc dl.toc {
margin: 0;
max-width: 100%;
}
/* Layout custom navigation footer */
#footer-nav {
display: flex;
flex-flow: row wrap;
}
#prev-link {
flex: 1 1 auto;
}
#home-link {
flex: 1 1 auto;
text-align: center;
}
#next-link {
flex: 1 1 auto;
text-align: right;
}

View file

@ -14,4 +14,107 @@
<xsl:param name="variablelist.term.break.after">1</xsl:param>
<xsl:param name="variablelist.term.separator"/>
<xsl:param name="html.stylesheet">kernel-handbook.css</xsl:param>
<!-- Replace standard header and footer to match Debian style -->
<xsl:param name="suppress.navigation">1</xsl:param>
<xsl:template name="user.header.navigation">
<!-- Get the title of this page -->
<xsl:variable name="doc" select="self::*"/>
<xsl:variable name="title">
<xsl:apply-templates select="$doc" mode="object.title.markup.textonly"/>
</xsl:variable>
<!-- Get the id of this book/chapter -->
<xsl:variable name="id">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:variable>
<div id="header">
<div id="logo">
<a href="https://www.debian.org" title="Debian Home"><img src="./Pics/openlogo-50.png" alt="Debian" width="50" height="61"/></a>
</div>
<div id="navbar">
<p class="hidecss">
<a>
<xsl:attribute name="href">
#<xsl:copy-of select="$id"/>
</xsl:attribute>
Skip Quicknav
</a>
</p>
<ul>
<li><a href="https://salsa.debian.org/kernel-team">Kernel team</a></li>
</ul>
</div>
<p id="breadcrumbs">
<xsl:if test="$title != 'Debian Linux Kernel Handbook'">
<a href="index.html">Debian Linux Kernel Handbook</a> /
</xsl:if>
<xsl:copy-of select="$title"/>
</p>
</div>
</xsl:template>
<xsl:template name="user.footer.navigation">
<xsl:param name="prev"/>
<xsl:param name="next"/>
<xsl:variable name="home" select="/*[1]"/>
<div id="footer">
<hr class="hidecss"/>
<div id="footer-nav">
<div id="prev-link">
<xsl:if test="$prev != ''">
<a accesskey="p">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$prev"/>
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name="navig.content">
<xsl:with-param name="direction" select="'prev'"/>
</xsl:call-template>:
<xsl:apply-templates select="$prev" mode="object.title.markup"/>
</a>
</xsl:if>
&#160;
</div>
<div id="home-link">
<xsl:if test="$home != .">
<a accesskey="h">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$home"/>
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name="navig.content">
<xsl:with-param name="direction" select="'home'"/>
</xsl:call-template>
</a>
</xsl:if>
</div>
<div id="next-link">
&#160;
<xsl:if test="$next != ''">
<a accesskey="n">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$next"/>
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name="navig.content">
<xsl:with-param name="direction" select="'next'"/>
</xsl:call-template>:
<xsl:apply-templates select="$next" mode="object.title.markup"/>
</a>
</xsl:if>
</div>
</div>
</div>
</xsl:template>
</xsl:stylesheet>