summaryrefslogtreecommitdiff
path: root/xslt/docbook
diff options
context:
space:
mode:
authorShaun McCance <shaunm@src.gnome.org>2007-04-20 15:06:02 +0000
committerShaun McCance <shaunm@src.gnome.org>2007-04-20 15:06:02 +0000
commite9612afde90255d16cce887946a4472342d56826 (patch)
tree491d90c82906e9ee67cfa2befdb0dfb6af4c24b9 /xslt/docbook
parent4879aee77c51f76289e2624ce00f9a162f4866dd (diff)
downloadgnome-doc-utils-e9612afde90255d16cce887946a4472342d56826.tar.gz
- Adding a simple test book
* test/testbook/Makefile: * test/testbook/testbook.xml: - Adding a simple test book * xslt/common/theme.xsl: * xslt/docbook/common/db-chunk.xsl: * xslt/docbook/html/db2html-admon.xsl: * xslt/docbook/html/db2html-autotoc.xsl: * xslt/docbook/html/db2html-block.xsl: * xslt/docbook/html/db2html-css.xsl: * xslt/docbook/html/db2html-division.xsl: * xslt/docbook/html/db2html-media.xsl: * xslt/docbook/html/db2html-title.xsl: * xslt/docbook/html/db2html.xsl: - Changes to how blocks and titles work - Changes to CSS interfaces - Brand new theme.xsl module - Implemented a TOC sidebar - Various other things svn path=/trunk/; revision=918
Diffstat (limited to 'xslt/docbook')
-rw-r--r--xslt/docbook/common/db-chunk.xsl10
-rw-r--r--xslt/docbook/html/db2html-admon.xsl197
-rw-r--r--xslt/docbook/html/db2html-autotoc.xsl108
-rw-r--r--xslt/docbook/html/db2html-block.xsl320
-rw-r--r--xslt/docbook/html/db2html-css.xsl312
-rw-r--r--xslt/docbook/html/db2html-division.xsl706
-rw-r--r--xslt/docbook/html/db2html-media.xsl7
-rw-r--r--xslt/docbook/html/db2html-title.xsl350
-rw-r--r--xslt/docbook/html/db2html.xsl3
9 files changed, 1091 insertions, 922 deletions
diff --git a/xslt/docbook/common/db-chunk.xsl b/xslt/docbook/common/db-chunk.xsl
index 9ade551..b142a49 100644
--- a/xslt/docbook/common/db-chunk.xsl
+++ b/xslt/docbook/common/db-chunk.xsl
@@ -506,6 +506,16 @@ REMARK: Explain how this works, and what the axes are
</xsl:template>
+<!--%%==========================================================================
+db.chunk.content.mode
+Renders entire contents of the chunk
+$depth_of_chunk: The depth of the containing chunk in the document
+
+When processed in this mode, a division element should output the top-level
+markup for the output page.
+-->
+
+
<!-- == Matched Templates == -->
<xsl:template match="/">
diff --git a/xslt/docbook/html/db2html-admon.xsl b/xslt/docbook/html/db2html-admon.xsl
deleted file mode 100644
index a0b50fa..0000000
--- a/xslt/docbook/html/db2html-admon.xsl
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
-<!--
-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 2 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 program; see the file COPYING.LGPL. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
--->
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns="http://www.w3.org/1999/xhtml"
- version="1.0">
-
-<!--!!==========================================================================
-DocBook to HTML - Admonitions
-
-This module handles DocBook's admonition elements. Admonitions are used to set
-off small blocks of text which provide auxiliary information to the reader.
-DocBook's admonitions come in five flavors: #{caution}, #{important}, #{note},
-#{tip}, and #{warning}.
-
-Admontions are wrapped in colored blocks with leading icons. Each admonition
-has its own icon, the base name of which is exactly the name of the admonition
-element. You can control where these icons are located and what their file
-extensions are.
--->
-
-
-<!--@@==========================================================================
-db2html.admon.border_color
-The color of the border around admonition elements
-
-REMARK: Describe this parameter
--->
-<xsl:param name="db2html.admon.border_color" select="'#D1940C'"/>
-
-
-<!--@@==========================================================================
-db2html.admon.graphics_path
-The path to admonition graphics
-
-This path is inserted into the HTML output, so it may be a fully-qualified URL.
--->
-<xsl:param name="db2html.admon.graphics_path"/>
-
-
-<!--@@==========================================================================
-db2html.admon.graphics_size
-The size of admonition graphics in pixels
-
-As well as allowing the width and height to be specified in the HTML, various
-offsets are also computed from the size of the admonition icons. Admonition
-icons are assumed to be square, so the size refers to the lenght in one
-dimension.
--->
-<xsl:param name="db2html.admon.graphics_size" select="48"/>
-
-
-<!--@@==========================================================================
-db2html.admon.graphics_extension
-The file extension for admonition icons
-
-This is appended to the name of the admonition (one of #{caution}, #{important},
-#{note}, #{tip}, or #{warning}) to produce the file name of the icon.
--->
-<xsl:param name="db2html.admon.graphics_extension" select="'.png'"/>
-
-
-<!--**==========================================================================
-db2html.admon
-Renders an admonition element into HTML
-$node: The element to render
-
-REMARK: Describe this template.
--->
-<xsl:template name="db2html.admon">
- <xsl:param name="node" select="."/>
- <div class="admonition block-indent {local-name(.)}">
- <xsl:apply-templates select="$node/node()"/>
- </div>
-</xsl:template>
-
-
-<!--**==========================================================================
-db2html.admon.css
-Outputs CSS that controls the appearance of admonition elements
-
-REMARK: Describe this template.
--->
-<xsl:template name="db2html.admon.css">
-<xsl:text>
-div.admonition {
- padding: 4px 8px 4px </xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_size + 8"/><xsl:text>px;
- min-height: </xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_size + 4"/><xsl:text>px;
- border: solid 1px </xsl:text>
- <xsl:value-of select="$db2html.admon.border_color"/><xsl:text>;
- background-position: 4px 4px;
- background-repeat: no-repeat;
-}
-div.caution {
- background-image: url("</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_path"/>
- <xsl:text>caution</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_extension"/><xsl:text>");
-}
-div.important {
- background-image: url("</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_path"/>
- <xsl:text>important</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_extension"/><xsl:text>");
-}
-div.note {
- background-image: url("</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_path"/>
- <xsl:text>note</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_extension"/><xsl:text>");
-}
-div.tip {
- background-image: url("</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_path"/>
- <xsl:text>tip</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_extension"/><xsl:text>");
-}
-div.warning {
- background-image: url("</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_path"/>
- <xsl:text>warning</xsl:text>
- <xsl:value-of select="$db2html.admon.graphics_extension"/><xsl:text>");
-}
-</xsl:text>
-</xsl:template>
-
-
-<!-- == Matched Templates == -->
-
-<!-- = caution = -->
-<xsl:template match="caution">
- <xsl:call-template name="db2html.admon"/>
-</xsl:template>
-
-<!-- = caution/title = -->
-<xsl:template match="caution/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = important = -->
-<xsl:template match="important">
- <xsl:call-template name="db2html.admon"/>
-</xsl:template>
-
-<!-- = important/title = -->
-<xsl:template match="important/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = note = -->
-<xsl:template match="note">
- <xsl:call-template name="db2html.admon"/>
-</xsl:template>
-
-<!-- = note/title = -->
-<xsl:template match="note/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = tip = -->
-<xsl:template match="tip">
- <xsl:call-template name="db2html.admon"/>
-</xsl:template>
-
-<!-- = tip/title = -->
-<xsl:template match="tip/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = warning = -->
-<xsl:template match="warning">
- <xsl:call-template name="db2html.admon"/>
-</xsl:template>
-
-<!-- = warning/title = -->
-<xsl:template match="warning/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/xslt/docbook/html/db2html-autotoc.xsl b/xslt/docbook/html/db2html-autotoc.xsl
index 9473c4a..9abc626 100644
--- a/xslt/docbook/html/db2html-autotoc.xsl
+++ b/xslt/docbook/html/db2html-autotoc.xsl
@@ -22,6 +22,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
<!--!!==========================================================================
DocBook to HTML - Tables of Contents
+:Requires: db-label db-xref db2html-xref
REMARK: Write some intro material here
-->
@@ -31,76 +32,92 @@ REMARK: Write some intro material here
db2html.autotoc
Creates a table of contents for a given element
$node: The element to create a table of contents for
-$info: The info child element of ${node}
+$selected: A currently-selected page
$divisions: The division-level child elements of ${node}
-$toc_depth: How deep to create entries in the table of contents
-$depth_of_chunk: The depth of the containing chunk in the document
+$labels: Whether to generate labels
+$titleabbrev: Whether to use #{titleabbrev} instead of #{title}
REMARK: Extra explanation of the parameters would be good
-->
<xsl:template name="db2html.autotoc">
<xsl:param name="node" select="."/>
- <xsl:param name="info"/>
+ <xsl:param name="selected" select="false()"/>
<xsl:param name="divisions"/>
<xsl:param name="toc_depth" select="1"/>
- <xsl:param name="depth_of_chunk">
- <xsl:call-template name="db.chunk.depth-of-chunk">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:param>
- <!-- FIXME: fix up, do stuff with $info, etc. -->
+ <xsl:param name="labels" select="true()"/>
+ <xsl:param name="titleabbrev" select="false()"/>
<div class="autotoc">
<ul>
- <xsl:apply-templates mode="db2html.autotoc.mode" select="$divisions">
- <xsl:with-param name="toc_depth" select="$toc_depth - 1"/>
- </xsl:apply-templates>
+ <xsl:for-each select="$divisions">
+ <xsl:if test="($selected = false()) or ($node = $selected/ancestor-or-self::*)">
+ <xsl:apply-templates mode="db2html.autotoc.mode" select=".">
+ <xsl:with-param name="selected" select="$selected"/>
+ <xsl:with-param name="toc_depth" select="$toc_depth - 1"/>
+ <xsl:with-param name="labels" select="$labels"/>
+ <xsl:with-param name="titleabbrev" select="$titleabbrev"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:for-each>
</ul>
</div>
</xsl:template>
-<!--**==========================================================================
-db2html.autotoc.css
-Outputs CSS that controls the appearance of tables of contents
--->
-<xsl:template name="db2html.autotoc.css">
-<xsl:text>
-div.autotoc { margin-left: 2em; padding: 0em; }
-div.autotoc ul { margin-left: 0em; padding-left: 0em; }
-div.autotoc ul li {
- margin-right: 0em; padding: 0em;
- list-style-type: none;
-}
-</xsl:text>
-</xsl:template>
-
<!--%%==========================================================================
db2html.autotoc.mode
-FIXME
+Renders a TOC entry for an element and its children
+$selected: A currently-selected page
$toc_depth: How deep to create entries in the table of contents
+$labels: Whether to generate labels
+$titleabbrev: Whether to use #{titleabbrev} instead of #{title}
REMARK: Describe this mode
-->
<xsl:template mode="db2html.autotoc.mode" match="*">
+ <xsl:param name="selected" select="false()"/>
<xsl:param name="toc_depth" select="0"/>
+ <xsl:param name="labels" select="true()"/>
+ <xsl:param name="titleabbrev" select="false()"/>
+ <xsl:variable name="xrefstyle">
+ <xsl:text>role:title</xsl:text>
+ <xsl:if test="$titleabbrev">
+ <xsl:text>abbrev</xsl:text>
+ </xsl:if>
+ </xsl:variable>
<li>
- <span class="label">
- <xsl:call-template name="db.label">
- <xsl:with-param name="node" select="."/>
- <xsl:with-param name="role" select="'li'"/>
- </xsl:call-template>
- </span>
- <xsl:call-template name="db2html.xref">
- <xsl:with-param name="linkend" select="@id"/>
- <xsl:with-param name="target" select="."/>
- <xsl:with-param name="xrefstyle" select="'role:title'"/>
- </xsl:call-template>
+ <xsl:if test="$labels">
+ <span class="label">
+ <xsl:call-template name="db.label">
+ <xsl:with-param name="node" select="."/>
+ <xsl:with-param name="role" select="'li'"/>
+ </xsl:call-template>
+ </span>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test=". = $selected">
+ <xsl:call-template name="db.xref.content">
+ <xsl:with-param name="linkend" select="@id"/>
+ <xsl:with-param name="target" select="."/>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="db2html.xref">
+ <xsl:with-param name="linkend" select="@id"/>
+ <xsl:with-param name="target" select="."/>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:if test="$toc_depth &gt; 0">
<xsl:call-template name="db2html.autotoc">
+ <xsl:with-param name="selected" select="$selected"/>
<xsl:with-param name="toc_depth" select="$toc_depth"/>
<xsl:with-param name="divisions"
select="*[contains($db.chunk.chunks_,
concat(' ', local-name(.), ' '))]"/>
+ <xsl:with-param name="labels" select="$labels"/>
+ <xsl:with-param name="titleabbrev" select="$titleabbrev"/>
</xsl:call-template>
</xsl:if>
</li>
@@ -108,12 +125,21 @@ REMARK: Describe this mode
<!-- = refentry % db2html.autotoc.mode = -->
<xsl:template mode="db2html.autotoc.mode" match="refentry">
+ <xsl:param name="selected" select="false()"/>
<xsl:param name="toc_depth" select="0"/>
+ <xsl:param name="labels" select="true()"/>
+ <xsl:param name="titleabbrev" select="false()"/>
+ <xsl:variable name="xrefstyle">
+ <xsl:text>role:title</xsl:text>
+ <xsl:if test="$titleabbrev">
+ <xsl:text>abbrev</xsl:text>
+ </xsl:if>
+ </xsl:variable>
<li>
<xsl:call-template name="db2html.xref">
<xsl:with-param name="linkend" select="@id"/>
<xsl:with-param name="target" select="."/>
- <xsl:with-param name="xrefstyle" select="'role:title'"/>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
</xsl:call-template>
<xsl:if test="refnamediv/refpurpose">
<!-- FIXME: I18N -->
diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl
index c24efe0..eaba5f5 100644
--- a/xslt/docbook/html/db2html-block.xsl
+++ b/xslt/docbook/html/db2html-block.xsl
@@ -24,61 +24,48 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
<!--!!==========================================================================
DocBook to HTML - Block Elements
+:Requires: db-common db-xref db2html-title db2html-xref l10n
-REMARK: Describe this module
+This module handles most simple block-level elements, turning them into the
+appropriate HTML tags. It does not handle tables, lists, and various other
+complex block-level elements.
-->
-<!--@@==========================================================================
-db2html.programlisting.background_color
-The background color for #{programlisting} elements
-
-REMARK: Describe this param
--->
-<xsl:param name="db2html.programlisting.background_color" select="'#EEEEEE'"/>
-
-
-<!--@@==========================================================================
-db2html.programlisting.border_color
-The border color for #{programlisting} elements
-
-REMARK: Describe this param
--->
-<xsl:param name="db2html.programlisting.border_color" select="'#DDDDDD'"/>
-
-
-<!--@@==========================================================================
-db2html.screen.background_color
-The background color for #{screen} elements
-
-REMARK: Describe this param
--->
-<xsl:param name="db2html.screen.background_color" select="'#EEEEEE'"/>
-
-
-<!--@@==========================================================================
-db2html.screen.border_color
-The border color for #{screen} elements
-
-REMARK: Describe this param
--->
-<xsl:param name="db2html.screen.border_color" select="'#DDDDDD'"/>
-
-
<!--**==========================================================================
db2html.block
-FIXME
+Renders a block-level element to an HTML #{div} tag
+$node: The block-level element to render
+$class: An extra string to insert in the #{class} attribute
+$first: Whether this is the first child block in the parent
$indent: Whether this block should be indented
$verbatim: Whether to maintain whitespace as written
+$formal: Whether this is a formal block element
+$title: When ${formal} is true, an element to use for the title
+$caption: When ${formal is true, an element to use for the caption
-REMARK: Describe this template
+This template creates an HTML #{div} element for the given DocBook element.
+This template uses the parameters to construct the #{class} attribute, which
+is then used by the CSS for styling.
-->
<xsl:template name="db2html.block">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="class" select="''"/>
+ <xsl:param name="first"
+ select="not($node/preceding-sibling::*
+ [not(self::blockinfo) and not(self::title) and
+ not(self::titleabbrev) and not(self::attribution) ])"/>
<xsl:param name="indent" select="false()"/>
<xsl:param name="verbatim" select="false()"/>
+ <xsl:param name="formal" select="false()"/>
+ <xsl:param name="title" select="$node/title"/>
+ <xsl:param name="caption" select="$node/caption"/>
<div>
<xsl:attribute name="class">
- <xsl:value-of select="local-name(.)"/>
+ <xsl:value-of select="concat($class, ' block ', local-name($node))"/>
+ <xsl:if test="$first">
+ <xsl:text> block-first</xsl:text>
+ </xsl:if>
<xsl:if test="$indent">
<xsl:text> block-indent</xsl:text>
</xsl:if>
@@ -86,52 +73,121 @@ REMARK: Describe this template
<xsl:text> block-verbatim</xsl:text>
</xsl:if>
</xsl:attribute>
- <xsl:call-template name="db2html.anchor"/>
- <xsl:apply-templates/>
+ <xsl:call-template name="db2html.anchor">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="$formal">
+ <xsl:if test="$title">
+ <div class="block block-first title title-formal">
+ <xsl:call-template name="db2html.anchor">
+ <xsl:with-param name="node" select="$title"/>
+ </xsl:call-template>
+ <span class="label">
+ <xsl:call-template name="db.label">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="role" select="'header'"/>
+ </xsl:call-template>
+ </span>
+ <xsl:apply-templates select="$title/node()"/>
+ </div>
+ </xsl:if>
+ <div class="{local-name($node)}-inner">
+ <xsl:apply-templates select="$node/node()[not(. = $title) and not(. = $caption)]"/>
+ </div>
+ <xsl:apply-templates select="$caption"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$node/node()"/>
+ </xsl:otherwise>
+ </xsl:choose>
</div>
</xsl:template>
<!--**==========================================================================
db2html.blockquote
-FIXME
+Renders a #{blockquote} element to HTML
+$node: The #{blockquote} element to render
+$first: Whether this is the first child block in the parent
-REMARK: Describe this template.
+This template creates an HTML #{blockquote} element for the given DocBook
+element.
-->
<xsl:template name="db2html.blockquote">
- <div class="{local-name(.)} block-indent">
- <xsl:apply-templates select="title"/>
- <blockquote class="{local-name(.)}">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="first"
+ select="not($node/preceding-sibling::*
+ [not(self::blockinfo) and not(self::title) and
+ not(self::titleabbrev) and not(self::attribution) ])"/>
+ <div>
+ <xsl:attribute name="class">
+ <xsl:value-of select="local-name($node)"/>
+ <xsl:text> block block-indent</xsl:text>
+ <xsl:if test="$first">
+ <xsl:text> block-first</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:call-template name="db2html.anchor">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="$node/title"/>
+ <blockquote class="{local-name($node)}">
<xsl:apply-templates
- select="*[name(.) != 'title' and name(.) != 'attribution']"/>
+ select="$node/node()[name(.) != 'title' and name(.) != 'attribution']"/>
</blockquote>
- <xsl:apply-templates select="attribution"/>
+ <xsl:apply-templates select="$node/attribution"/>
</div>
</xsl:template>
<!--**==========================================================================
db2html.para
-FIXME
+Renders a block-level element as an HTML #{p} element
+$node: The block-level element to render
+$first: Whether this is the first child block in the parent
-REMARK: Describe this template
+This template creates an HTML #{p} element for the given DocBook element.
-->
<xsl:template name="db2html.para">
- <p class="{local-name(.)}">
- <xsl:call-template name="db2html.anchor"/>
- <xsl:apply-templates/>
+ <xsl:param name="node" select="."/>
+ <xsl:param name="first"
+ select="not($node/preceding-sibling::*
+ [not(self::blockinfo) and not(self::title) and
+ not(self::titleabbrev) and not(self::attribution) ])"/>
+ <p>
+ <xsl:attribute name="class">
+ <xsl:value-of select="local-name($node)"/>
+ <xsl:text> block</xsl:text>
+ <xsl:if test="$first">
+ <xsl:text> block-first</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:call-template name="db2html.anchor">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="$node/node()"/>
</p>
</xsl:template>
<!--**==========================================================================
db2html.pre
-FIXME
+Renders a block-level element as an HTML #{pre} element
+$node: The block-level element to render
+$first: Whether this is the first child block in the parent
$indent: Whether this block should be indented
-REMARK: Describe this template
+This template creates an HTML #{pre} element for the given DocBook element.
+This template uses the parameters to construct the #{class} attribute, which
+is then used by the CSS for styling.
-->
<xsl:template name="db2html.pre">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="first"
+ select="not($node/preceding-sibling::*
+ [not(self::blockinfo) and not(self::title) and
+ not(self::titleabbrev) and not(self::attribution) ])"/>
<xsl:param name="indent" select="false()"/>
<!-- FIXME:
@width
@@ -142,41 +198,49 @@ REMARK: Describe this template
-->
<div>
<xsl:attribute name="class">
- <xsl:value-of select="local-name(.)"/>
+ <xsl:value-of select="local-name($node)"/>
+ <xsl:text> block</xsl:text>
<xsl:if test="$indent">
<xsl:text> block-indent</xsl:text>
</xsl:if>
+ <xsl:if test="$first">
+ <xsl:text> block-first</xsl:text>
+ </xsl:if>
</xsl:attribute>
- <xsl:call-template name="db2html.anchor"/>
- <xsl:if test="@linenumbering = 'numbered'">
- <pre class="linenumbering"><xsl:call-template name="db.linenumbering"/></pre>
+ <xsl:call-template name="db2html.anchor">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ <xsl:if test="$node/@linenumbering = 'numbered'">
+ <pre class="linenumbering"><xsl:call-template name="db.linenumbering">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template></pre>
</xsl:if>
- <pre class="{local-name(.)}">
+ <pre class="{local-name($node)}">
<!-- Strip off a leading newline -->
- <xsl:if test="node()[1]/self::text()">
+ <xsl:if test="$node/node()[1]/self::text()">
<xsl:choose>
<!-- CR LF -->
- <xsl:when test="starts-with(text()[1], '&#x000D;&#x000A;')">
- <xsl:value-of select="substring-after(text()[1], '&#x000D;&#x000A;')"/>
+ <xsl:when test="starts-with($node/text()[1], '&#x000D;&#x000A;')">
+ <xsl:value-of select="substring-after($node/text()[1], '&#x000D;&#x000A;')"/>
</xsl:when>
<!-- CR -->
- <xsl:when test="starts-with(text()[1], '&#x000D;')">
- <xsl:value-of select="substring-after(text()[1], '&#x000D;')"/>
+ <xsl:when test="starts-with($node/text()[1], '&#x000D;')">
+ <xsl:value-of select="substring-after($node/text()[1], '&#x000D;')"/>
</xsl:when>
<!-- LF -->
- <xsl:when test="starts-with(text()[1], '&#x000A;')">
- <xsl:value-of select="substring-after(text()[1], '&#x000A;')"/>
+ <xsl:when test="starts-with($node/text()[1], '&#x000A;')">
+ <xsl:value-of select="substring-after($node/text()[1], '&#x000A;')"/>
</xsl:when>
<!-- NEL -->
- <xsl:when test="starts-with(text()[1], '&#x0085;')">
- <xsl:value-of select="substring-after(text()[1], '&#x0085;')"/>
+ <xsl:when test="starts-with($node/text()[1], '&#x0085;')">
+ <xsl:value-of select="substring-after($node/text()[1], '&#x0085;')"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="text()[1]"/>
+ <xsl:value-of select="$node/text()[1]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
- <xsl:apply-templates select="node()[not(position() = 1 and self::text())]"/>
+ <xsl:apply-templates select="$node/node()[not(position() = 1 and self::text())]"/>
</pre>
</div>
</xsl:template>
@@ -190,58 +254,6 @@ REMARK: Describe this template
-->
<xsl:template name="db2html.block.css">
<xsl:text>
-.block-indent { margin-left: 1.72em; margin-right: 1em; }
-.block-indent .block-indent { margin-left: 0em; margin-right: 0em; }
-.block-verbatim { white-space: pre; }
-pre.programlisting {
- padding: 6px;
- -moz-border-radius: 8px;
- overflow: auto;
- </xsl:text>
- <xsl:if test="string($db2html.programlisting.background_color) != ''">
- <xsl:text>background-color: </xsl:text>
- <xsl:value-of select="$db2html.programlisting.background_color"/>
- </xsl:if>
- <xsl:text>;
- </xsl:text>
- <xsl:if test="string($db2html.programlisting.border_color) != ''">
- <xsl:text>border: solid 1px </xsl:text>
- <xsl:value-of select="$db2html.programlisting.border_color"/>
- </xsl:if>
- <xsl:text>;
-}
-pre.screen {
- padding: 6px;
- -moz-border-radius: 8px;
- overflow: auto;
- </xsl:text>
- <xsl:if test="string($db2html.screen.background_color) != ''">
- <xsl:text>background-color: </xsl:text>
- <xsl:value-of select="$db2html.screen.background_color"/>
- </xsl:if>
- <xsl:text>;
- </xsl:text>
- <xsl:if test="string($db2html.screen.border_color) != ''">
- <xsl:text>border: solid 1px </xsl:text>
- <xsl:value-of select="$db2html.screen.border_color"/>
- </xsl:if>
- <xsl:text>;
-}
-pre.synopsis { overflow: auto; }
-pre.linenumbering {
- <!-- The margin is important to get the line numbering
- to line up vertically with the content. -->
- margin-top: 0px;
- margin-left: 0.83em;
- padding: 6px 0.4em 6px 0.4em;
- border: solid 1px black;
- -moz-border-radius: 8px;
- background-color: black;
- color: white;
- -moz-opacity: .3;
- float: left;
- text-align: right;
-}
dt.glossterm { margin-left: 0em; }
dd + dt.glossterm { margin-top: 2em; }
dd.glossdef, dd.glosssee, dd.glossseealso
@@ -271,7 +283,9 @@ dd.glossdef, dd.glosssee, dd.glossseealso
<!-- = attribution = -->
<xsl:template match="attribution">
- <xsl:call-template name="db2html.block"/>
+ <xsl:call-template name="db2html.block">
+ <xsl:with-param name="first" select="false()"/>
+ </xsl:call-template>
</xsl:template>
<!-- = blockquote = -->
@@ -284,6 +298,14 @@ dd.glossdef, dd.glosssee, dd.glossseealso
<xsl:call-template name="db2html.block"/>
</xsl:template>
+<!-- = caution = -->
+<xsl:template match="caution">
+ <xsl:call-template name="db2html.block">
+ <xsl:with-param name="class" select="'admonition'"/>
+ <xsl:with-param name="indent" select="true()"/>
+ </xsl:call-template>
+</xsl:template>
+
<!-- = epigraph = -->
<xsl:template match="epigraph">
<xsl:call-template name="db2html.blockquote"/>
@@ -298,6 +320,7 @@ dd.glossdef, dd.glosssee, dd.glossseealso
<xsl:template match="example">
<xsl:call-template name="db2html.block">
<xsl:with-param name="indent" select="true()"/>
+ <xsl:with-param name="formal" select="true()"/>
</xsl:call-template>
</xsl:template>
@@ -305,6 +328,11 @@ dd.glossdef, dd.glosssee, dd.glossseealso
<xsl:template match="figure">
<xsl:call-template name="db2html.block">
<xsl:with-param name="indent" select="true()"/>
+ <xsl:with-param name="formal" select="true()"/>
+ <!-- When a figure contains only a single mediaobject, it eats the caption -->
+ <xsl:with-param name="caption"
+ select="*[not(self::blockinfo) and not(self::title) and not(self::titleabbrev)]
+ [last() = 1]/self::mediaobject/caption"/>
</xsl:call-template>
</xsl:template>
@@ -390,6 +418,14 @@ dd.glossdef, dd.glosssee, dd.glossseealso
<xsl:call-template name="db2html.block"/>
</xsl:template>
+<!-- = important = -->
+<xsl:template match="important">
+ <xsl:call-template name="db2html.block">
+ <xsl:with-param name="class" select="'admonition'"/>
+ <xsl:with-param name="indent" select="true()"/>
+ </xsl:call-template>
+</xsl:template>
+
<!-- = informalequation = -->
<xsl:template match="informalequation">
<xsl:call-template name="db2html.block"/>
@@ -414,6 +450,19 @@ dd.glossdef, dd.glosssee, dd.glossseealso
</xsl:call-template>
</xsl:template>
+<!-- = note = -->
+<xsl:template match="note">
+ <xsl:call-template name="db2html.block">
+ <xsl:with-param name="class">
+ <xsl:text>admonition</xsl:text>
+ <xsl:if test="@role = 'bug'">
+ <xsl:text> note-bug</xsl:text>
+ </xsl:if>
+ </xsl:with-param>
+ <xsl:with-param name="indent" select="true()"/>
+ </xsl:call-template>
+</xsl:template>
+
<!-- = para = -->
<xsl:template match="para">
<xsl:call-template name="db2html.para"/>
@@ -445,4 +494,25 @@ dd.glossdef, dd.glosssee, dd.glossseealso
</xsl:call-template>
</xsl:template>
+<!-- = tip = -->
+<xsl:template match="tip">
+ <xsl:call-template name="db2html.block">
+ <xsl:with-param name="class" select="'admonition'"/>
+ <xsl:with-param name="indent" select="true()"/>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- = title = -->
+<xsl:template match="title">
+ <xsl:call-template name="db2html.block"/>
+</xsl:template>
+
+<!-- = warning = -->
+<xsl:template match="warning">
+ <xsl:call-template name="db2html.block">
+ <xsl:with-param name="class" select="'admonition'"/>
+ <xsl:with-param name="indent" select="true()"/>
+ </xsl:call-template>
+</xsl:template>
+
</xsl:stylesheet>
diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl
index 8781ce1..532b79b 100644
--- a/xslt/docbook/html/db2html-css.xsl
+++ b/xslt/docbook/html/db2html-css.xsl
@@ -24,6 +24,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
<!--!!==========================================================================
DocBook to HTML - CSS
+:Requires: l10n theme
REMARK: Describe this module
-->
@@ -69,6 +70,7 @@ avoid creating the same file multiple times.
</xsl:choose>
</xsl:template>
+
<!--**==========================================================================
db2html.css.content
Outputs the actual CSS directives
@@ -80,10 +82,284 @@ those modules.
This template calls *{db2html.css.custom} at the end. That template may be used
by extension stylesheets to extend or override the CSS.
-->
-<xsl:template name="db2html.css.content">
+<xsl:template name="db2html.css.content"><xsl:text>
+html { height: 100%; }
+body {
+ margin: 0px;
+ padding: 12px;
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+ min-height: 100%;
+ direction: </xsl:text>
+ <xsl:call-template name="l10n.direction"/><xsl:text>;
+}
+div, p, pre, blockquote { margin: 0; }
+
+.block { margin-top: 1em; }
+.block .block-first { margin-top: 0; }
+<!-- FIXME: rtl -->
+.block-indent {
+ margin-left: 1.72em;
+ margin-right: 1em;
+}
+.block-indent .block-indent {
+ margin-left: 0em;
+ margin-right: 0em;
+}
+.block-verbatim { white-space: pre; }
+
+div.body {
+ padding: 1em;
+ max-width: 60em;
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.background"/><xsl:text>;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+div.body-sidebar {
+ <!-- FIXME: rtl -->
+ margin-right: 13em;
+}
+
+div.division div.division { margin-top: 1.72em; }
+div.division div.division div.division { margin-top: 1.44em; }
+
+div.header {
+ margin: 0;
+ color: </xsl:text>
+ <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+ border-bottom: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+h1, h2, h3, h4, h5, h6, h7 { margin: 0; padding: 0; }
+h1.title { font-size: 1.72em; }
+h2.title { font-size: 1.44em; }
+h3.title { font-size: 1.2em; }
+h4.title { font-size: 1em; }
+h5.title { font-size: 1em; }
+h6.title { font-size: 1em; }
+h7.title { font-size: 1em; }
+div.title {
+ margin-bottom: 0.2em;
+ font-weight: bold;
+ color: </xsl:text>
+ <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+div.title-formal .label {
+ font-weight: normal;
+}
+
+a {
+ color: </xsl:text>
+ <xsl:value-of select="$theme.color.link"/><xsl:text>;
+ text-decoration: none;
+}
+a:hover { text-decoration: underline; }
+a:visited {
+ color: </xsl:text>
+ <xsl:value-of select="$theme.color.link_visited"/><xsl:text>;
+}
+
+
+ul.linktrail {
+ display: block;
+ margin: 0.2em 0 0 0;
+ text-align: right;
+}
+li.linktrail { display: inline; }
+li.linktrail::before {
+ content: '&#x00A0; /&#x00A0;&#x00A0;';
+ color: </xsl:text>
+ <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+li.linktrail-first::before, li.linktrail-only::before { content: ''; }
+
+div.navbar {
+ padding: 0.5em 1em 0.5em 1em;
+ max-width: 60em;
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.background"/><xsl:text>;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+div.navbar-top { margin-bottom: 1em; }
+div.navbar-bottom { margin-top: 1em; clear: both; }
+div.navbar img {
+ border: 0;
+ vertical-align: -0.4em;
+}
+table.navbar {
+ width: 100%;
+ margin: 0;
+ border: none;
+}
+table.navbar td {
+ padding: 0;
+ border: none;
+}
+td.navbar-next {
+ <!-- FIXME: rtl -->
+ text-align: right;
+}
+
+div.autotoc {
+ <!-- FIXME: rtl -->
+ margin-left: 1.72em;
+ padding: 0;
+}
+div.autotoc ul { margin: 0; padding: 0; }
+div.autotoc li { list-style-type: none; }
+
+div.sidebar {
+ <!-- FIXME: rtl -->
+ float: right;
+ padding: 0;
+ margin: 0;
+ width: 12em;
+}
+div.sidenav {
+ padding: 0.5em 1em 0.5em 1em;
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.background"/><xsl:text>;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+div.sidenav div.autotoc { margin: 0; }
+div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; }
+div.sidenav div.autotoc div.autotoc li { margin-bottom: 0.5em; }
+div.sidenav div.autotoc div.autotoc div.autotoc {
+ <!-- FIXME: rtl -->
+ margin-left: 1em;
+ margin-top: 0;
+}
+div.sidenav div.autotoc div.autotoc div.autotoc li { margin-bottom: 0; }
+
+div.blockquote {
+ background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png');
+ background-repeat: no-repeat;
+ <!-- FIXME: rtl -->
+ background-position: top left;
+ padding: 0.5em;
+ <!-- FIXME: rtl -->
+ padding-left: 4em;
+}
+div.attribution {
+ margin-top: 0.5em;
+ color: </xsl:text>
+ <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+div.attribution::before {
+ content: '&#x2015; ';
+}
+div.epigraph {
+ <!-- FIXME: rtl -->
+ text-align: right;
+ <!-- FIXME: rtl -->
+ margin-left: 20%;
+ <!-- FIXME: rtl -->
+ margin-right: 0;
+ color: </xsl:text>
+ <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+div.figure {
+ padding: 0.5em;
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.blue_background"/><xsl:text>;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.blue_border"/><xsl:text>;
+}
+div.figure-inner {
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.background"/><xsl:text>;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+div.caption {
+ margin-top: 0.5em;
+}
+pre.programlisting {
+ padding: 0.5em;
+ overflow: auto;
+ <!-- FIXME: watermark -->
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+pre.screen {
+ padding: 0.5em;
+ overflow: auto;
+ <!-- FIXME: watermark -->
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+pre.synopsis { overflow: auto; }
+pre.linenumbering {
+ <!-- The margin is important to get the line numbering
+ to line up vertically with the content. -->
+ margin-top: 0;
+ <!-- FIXME: rtl -->
+ margin-left: 0.83em;
+ padding: 1em 0.4em 1em 0.4em;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+ color: </xsl:text>
+ <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+ <!-- FIXME: rtl -->
+ float: left;
+ <!-- FIXME: rtl -->
+ text-align: right;
+}
+
+div.admonition {
+ padding: 0.5em 1em 0.5em 1em;
+ <!-- FIXME: rtl -->
+ padding-left: </xsl:text>
+ <xsl:value-of select="$theme.icon.admon.size + 12"/><xsl:text>px;
+ min-height: </xsl:text>
+ <xsl:value-of select="$theme.icon.admon.size"/><xsl:text>px;
+ border: solid 1px </xsl:text>
+ <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+ background-color: </xsl:text>
+ <xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
+ <!-- FIXME: rtl -->
+ background-position: 6px 0.5em;
+ background-repeat: no-repeat;
+}
+div.caution {
+ background-image: url("</xsl:text>
+ <xsl:value-of select="$theme.icon.admon.caution"/><xsl:text>");
+}
+div.important {
+ background-image: url("</xsl:text>
+ <xsl:value-of select="$theme.icon.admon.important"/><xsl:text>");
+}
+div.note {
+ background-image: url("</xsl:text>
+ <xsl:value-of select="$theme.icon.admon.note"/><xsl:text>");
+}
+div.note-bug {
+ background-image: url("</xsl:text>
+ <xsl:value-of select="$theme.icon.admon.bug"/><xsl:text>");
+}
+div.tip {
+ background-image: url("</xsl:text>
+ <xsl:value-of select="$theme.icon.admon.tip"/><xsl:text>");
+}
+div.warning {
+ background-image: url("</xsl:text>
+ <xsl:value-of select="$theme.icon.admon.warning"/><xsl:text>");
+}
+
+
+<!-- FIXME below -->
+
+</xsl:text>
<xsl:call-template name="db2html.footnote.css"/>
- <xsl:call-template name="db2html.admon.css"/>
- <xsl:call-template name="db2html.autotoc.css"/>
<xsl:call-template name="db2html.bibliography.css"/>
<xsl:call-template name="db2html.block.css"/>
<xsl:call-template name="db2html.callout.css"/>
@@ -92,38 +368,10 @@ by extension stylesheets to extend or override the CSS.
<xsl:call-template name="db2html.qanda.css"/>
<xsl:call-template name="db2html.refentry.css"/>
<xsl:call-template name="db2html.table.css"/>
- <xsl:call-template name="db2html.title.css"/>
-<xsl:text>
-body {
- margin: 0px;
- direction: </xsl:text><xsl:call-template name="l10n.direction"/><xsl:text>;
-}
-div.body { padding: 12px; }
-div.navbar {
- margin-left: 12px; margin-right: 12px; margin-bottom: 12px;
- padding: 6px;
- border: solid 1px;
-}
-div.navbar-prev { margin: 0px; padding: 0px; float: left; }
-div.navbar-prev-sans-next { float: none; }
-div.navbar-next { margin: 0px; padding: 0px; text-align: right; }
-div {
- margin-top: 0em; margin-bottom: 0em;
- padding-top: 0em; padding-bottom: 0em;
-}
-p {
- margin-top: 0em; margin-bottom: 0em;
- padding-top: 0em; padding-bottom: 0em;
-}
-div + * { margin-top: 1em; }
-p + * { margin-top: 1em; }
-p &gt; div { margin-top: 1em; margin-bottom: 1em; }
-p &gt; div + div { margin-top: 0em; }
-p { text-align: justify; }
-</xsl:text>
<xsl:call-template name="db2html.css.custom"/>
</xsl:template>
+
<!--**==========================================================================
db2html.css.custom
Allows extension stylesheets to extend or override CSS
diff --git a/xslt/docbook/html/db2html-division.xsl b/xslt/docbook/html/db2html-division.xsl
index 8c77a36..e450c99 100644
--- a/xslt/docbook/html/db2html-division.xsl
+++ b/xslt/docbook/html/db2html-division.xsl
@@ -22,11 +22,54 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
<!--!!==========================================================================
DocBook to HTML - Division Elements
+:Requires: db-chunk db-label db-title db-xref db2html-autotoc db2html-css db2html-footnote db2html-xref l10n theme
REMARK: Describe this module
-->
+<!--@@==========================================================================
+db2html.linktrail
+Whether to place a link trail under the header
+
+This boolean parameter specifies whether a block containing links to
+ancestor elements should be included under the header.
+-->
+<xsl:param name="db2html.linktrail" select="true()"/>
+
+<!--@@==========================================================================
+db2html.navbar.top
+Whether to place a navigation bar at the top of the page
+
+This boolean parameter specifies whether a block containing navigation
+links should be placed at the top of the page. The top navigation bar
+is inserted by *{db2html.division.top}, so this parameter may have no
+effect if that template has been overridden.
+-->
+<xsl:param name="db2html.navbar.top" select="true()"/>
+
+<!--@@==========================================================================
+db2html.navbar.bottom
+Whether to place a navigation bar at the bottom of the page
+
+This boolean parameter specifies whether a block containing navigation
+links should be placed at the bottom of the page. The bottom navigation
+bar is inserted by *{db2html.division.bottom}, so this parameter may have
+no effect if that template has been overridden.
+-->
+<xsl:param name="db2html.navbar.bottom" select="true()"/>
+
+<!--@@==========================================================================
+db2html.sidenav
+Whether to create a navigation sidebar
+
+This boolean parameter specifies whether a full navigation tree in a sidebar.
+The navigation sidebar is inserted by *{db2html.division.sidebar}, so this
+parameter may have no effect if that template has been overridden.
+-->
+<xsl:param name="db2html.sidenav" select="true()"/>
+
+
<!--**==========================================================================
db2html.division.html
Renders a complete HTML page for a division element
@@ -47,7 +90,7 @@ REMARK: Put in a word about the chunk flow; talk about what templates get called
<xsl:variable name="prev_id">
<xsl:choose>
<xsl:when test="$depth_of_chunk = 0">
- <xsl:if test="$info">
+ <xsl:if test="$info and $db.chunk.info_chunk">
<xsl:value-of select="$db.chunk.info_basename"/>
</xsl:if>
</xsl:when>
@@ -145,7 +188,25 @@ REMARK: Put in a word about the chunk flow; talk about what templates get called
<xsl:with-param name="prev_node" select="$prev_node"/>
<xsl:with-param name="next_node" select="$next_node"/>
</xsl:call-template>
- <div class="body">
+ <xsl:variable name="sidebar">
+ <xsl:call-template name="db2html.division.sidebar">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="info" select="$info"/>
+ <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
+ <xsl:with-param name="prev_id" select="$prev_id"/>
+ <xsl:with-param name="next_id" select="$next_id"/>
+ <xsl:with-param name="prev_node" select="$prev_node"/>
+ <xsl:with-param name="next_node" select="$next_node"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:copy-of select="$sidebar"/>
+ <div>
+ <xsl:attribute name="class">
+ <xsl:text>body</xsl:text>
+ <xsl:if test="$sidebar != ''">
+ <xsl:text> body-sidebar</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
<xsl:apply-templates select="$node">
<xsl:with-param name="depth_in_chunk" select="0"/>
<xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
@@ -166,118 +227,14 @@ REMARK: Put in a word about the chunk flow; talk about what templates get called
<!--**==========================================================================
-db2html.division.head.extra
-FIXME
-:Stub: true
-
-REMARK: Describe this stub template.
--->
-<xsl:template name="db2html.division.head.extra"/>
-
-
-<!--**==========================================================================
-db2html.division.top
-FIXME
-
-REMARK: Describe this template
--->
-<xsl:template name="db2html.division.top">
- <xsl:param name="node"/>
- <xsl:param name="info"/>
- <xsl:param name="depth_of_chunk">
- <xsl:call-template name="db.chunk.depth-of-chunk">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:param>
- <xsl:param name="prev_id">
- <xsl:choose>
- <xsl:when test="$depth_of_chunk = 0 and $info">
- <xsl:if test="$info">
- <xsl:value-of select="$db.chunk.info_basename"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="db.chunk.chunk-id.axis">
- <xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="axis" select="'previous'"/>
- <xsl:with-param name="depth_in_chunk" select="0"/>
- <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:param name="next_id">
- <xsl:call-template name="db.chunk.chunk-id.axis">
- <xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="axis" select="'next'"/>
- <xsl:with-param name="depth_in_chunk" select="0"/>
- <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
- </xsl:call-template>
- </xsl:param>
- <xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
- <xsl:param name="next_node" select="key('idkey', $next_id)"/>
-</xsl:template>
-
-
-<!--**==========================================================================
-db2html.division.bottom
-FIXME
-
-REMARK: Describe this template
--->
-<xsl:template name="db2html.division.bottom">
- <xsl:param name="node"/>
- <xsl:param name="info"/>
- <xsl:param name="depth_of_chunk">
- <xsl:call-template name="db.chunk.depth-of-chunk">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:param>
- <xsl:param name="prev_id">
- <xsl:choose>
- <xsl:when test="$depth_of_chunk = 0 and $info">
- <xsl:if test="$info">
- <xsl:value-of select="$db.chunk.info_basename"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="db.chunk.chunk-id.axis">
- <xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="axis" select="'previous'"/>
- <xsl:with-param name="depth_in_chunk" select="0"/>
- <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:param name="next_id">
- <xsl:call-template name="db.chunk.chunk-id.axis">
- <xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="axis" select="'next'"/>
- <xsl:with-param name="depth_in_chunk" select="0"/>
- <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
- </xsl:call-template>
- </xsl:param>
- <xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
- <xsl:param name="next_node" select="key('idkey', $next_id)"/>
- <xsl:call-template name="db2html.division.navbar">
- <xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="info" select="$info"/>
- <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
- <xsl:with-param name="prev_id" select="$prev_id"/>
- <xsl:with-param name="next_id" select="$next_id"/>
- <xsl:with-param name="prev_node" select="$prev_node"/>
- <xsl:with-param name="next_node" select="$next_node"/>
- </xsl:call-template>
-</xsl:template>
-
-
-<!--**==========================================================================
db2html.division.div
Renders the content of a division element, chunking children if necessary
$node: The element to render the content of
$info: The info child element of ${node}
+$title_node: The element containing the title of ${node}
+$subtitle_node: The element containing the subtitle of ${node}
$title_content: The title for divisions lacking a #{title} tag
+$subtitle_content: The subtitle for divisions lacking a #{subtitle} tag
$entries: The entry-style child elements
$divisions: The division-level child elements
$depth_in_chunk: The depth of ${node} in the containing chunk
@@ -290,8 +247,13 @@ REMARK: Talk about some of the parameters
-->
<xsl:template name="db2html.division.div">
<xsl:param name="node" select="."/>
- <xsl:param name="title_content"/>
<xsl:param name="info"/>
+ <xsl:param name="title_node"
+ select="($node/title | $info/title)[last()]"/>
+ <xsl:param name="subtitle_node"
+ select="($node/subtitle | $info/subtitle)[last()]"/>
+ <xsl:param name="title_content"/>
+ <xsl:param name="subtitle_content"/>
<xsl:param name="entries" select="/false"/>
<xsl:param name="divisions" select="/false"/>
<xsl:param name="depth_in_chunk">
@@ -313,50 +275,33 @@ REMARK: Talk about some of the parameters
($depth_in_chunk = 0 and $info)"/>
<xsl:param name="autotoc_depth" select="number(boolean($chunk_divisions))"/>
- <div class="{local-name($node)}">
+ <div class="division {local-name($node)}">
<xsl:call-template name="db2html.anchor">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
- <xsl:variable name="titles" select="$node/title | $node/subtitle"/>
- <xsl:choose>
- <xsl:when test="$titles">
- <xsl:apply-templates select="$titles">
- <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk + 1"/>
- <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="$info and $info/title">
- <xsl:apply-templates select="$info/title">
- <xsl:with-param name="referent" select="$node"/>
- <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk + 1"/>
- <xsl:with-param name="referent_depth_in_chunk" select="$depth_in_chunk"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="$info/subtitle">
- <xsl:with-param name="referent" select="$node"/>
- <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk + 1"/>
- <xsl:with-param name="referent_depth_in_chunk" select="$depth_in_chunk"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="$title_content">
- <xsl:call-template name="db2html.title.header">
- <xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="referent" select="$node"/>
- <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk + 1"/>
- <xsl:with-param name="referent_depth_in_chunk" select="$depth_in_chunk"/>
- <xsl:with-param name="title_content" select="$title_content"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
+ <xsl:call-template name="db2html.header">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="title_node" select="$title_node"/>
+ <xsl:with-param name="subtitle_node" select="$subtitle_node"/>
+ <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
+ <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
+ <xsl:with-param name="generate_label" select="$depth_in_chunk != 0"/>
+ <xsl:with-param name="title_content" select="$title_content"/>
+ <xsl:with-param name="subtitle_content" select="$subtitle_content"/>
+ </xsl:call-template>
+ <xsl:if test="$db2html.linktrail and $depth_in_chunk = 0">
+ <xsl:call-template name="db2html.linktrail">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:if>
<xsl:if test="$autotoc_depth != 0">
<xsl:call-template name="db2html.autotoc">
<xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="info" select="$info"/>
<xsl:with-param name="divisions" select="$divisions"/>
- <xsl:with-param name="toc_depth" select="number($autotoc_depth)"/>
<xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
</xsl:call-template>
</xsl:if>
- <xsl:variable name="nots" select="$divisions | $entries | $titles"/>
+ <xsl:variable name="nots" select="$divisions | $entries | $title_node | $subtitle_node"/>
<xsl:apply-templates select="*[not(. = $nots)]">
<xsl:with-param name="depth_in_chunk" select="$depth_in_chunk + 1"/>
<xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
@@ -386,23 +331,178 @@ REMARK: Talk about some of the parameters
<!--**==========================================================================
-db2html.division.navbar
-FIXME
+db2html.header
+Generates a header with a title and optional subtitle
+$node: The element containing the title
+$title_node: The #{title} element to render
+$subtitle_node: The #{subtitle} element to render
+$depth_in_chunk: The depth of ${node} in the containing chunk
+$depth_of_chunk: The depth of the containing chunk in the document
+$generate_label: Whether to generate a label in the title
+$title_content: An optional string containing the title
+$subtitle_content: An optional string containing the subtitle
-REMARK: Document this template
+REMARK: Talk about the different kinds of title blocks
-->
-<xsl:template name="db2html.division.navbar">
- <xsl:param name="node"/>
- <xsl:param name="info"/>
+<xsl:template name="db2html.header">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="title_node" select="$node/title"/>
+ <xsl:param name="subtitle_node" select="$node/subtitle"/>
+ <xsl:param name="depth_in_chunk">
+ <xsl:call-template name="db.chunk.depth-in-chunk">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:param>
<xsl:param name="depth_of_chunk">
<xsl:call-template name="db.chunk.depth-of-chunk">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</xsl:param>
+ <xsl:param name="generate_label" select="true()"/>
+ <xsl:param name="title_content"/>
+ <xsl:param name="subtitle_content"/>
+
+ <xsl:variable name="title_h">
+ <xsl:choose>
+ <xsl:when test="$depth_in_chunk &lt; 7">
+ <xsl:value-of select="concat('h', $depth_in_chunk + 1)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>h7</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="subtitle_h">
+ <xsl:choose>
+ <xsl:when test="$depth_in_chunk &lt; 6">
+ <xsl:value-of select="concat('h', $depth_in_chunk + 2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>h7</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <div class="header">
+ <xsl:element name="{$title_h}"
+ namespace="http://www.w3.org/1999/xhtml">
+ <xsl:attribute name="class">
+ <xsl:value-of select="concat(local-name($node), ' ', local-name($title_node))"/>
+ </xsl:attribute>
+ <span class="title">
+ <xsl:if test="$title_node">
+ <xsl:call-template name="db2html.anchor">
+ <xsl:with-param name="node" select="$title_node"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$generate_label">
+ <span class="label">
+ <xsl:call-template name="db.label">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="role" select="'header'"/>
+ <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
+ </xsl:call-template>
+ </span>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$title_content">
+ <xsl:value-of select="$title_content"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$title_node/node()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </span>
+ </xsl:element>
+ <xsl:if test="$subtitle_node or $subtitle_content">
+ <xsl:element name="{$subtitle_h}"
+ namespace="http://www.w3.org/1999/xhtml">
+ <xsl:attribute name="class">
+ <xsl:value-of select="concat(local-name($node), ' ', local-name($subtitle_node))"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$subtitle_content">
+ <xsl:value-of select="$subtitle_content"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$subtitle_node/node()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ </div>
+</xsl:template>
+
+
+<!--**==========================================================================
+db2html.linktrail
+Generates links to pages from ancestor elements
+$node: The element to generate links for
+
+REMARK: Describe this
+-->
+<xsl:template name="db2html.linktrail">
+ <xsl:param name="node"/>
+ <ul class="linktrail">
+ <!-- The parens put the nodes back in document order -->
+ <xsl:for-each select="($node/ancestor::*)">
+ <li>
+ <xsl:attribute name="class">
+ <xsl:text>linktrail</xsl:text>
+ <xsl:choose>
+ <xsl:when test="last() = 1">
+ <xsl:text> linktrail-only</xsl:text>
+ </xsl:when>
+ <xsl:when test="position() = 1">
+ <xsl:text> linktrail-first</xsl:text>
+ </xsl:when>
+ <xsl:when test="position() = last()">
+ <xsl:text> linktrail-last</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <a class="linktrail">
+ <xsl:attribute name="href">
+ <xsl:call-template name="db.xref.target">
+ <xsl:with-param name="linkend" select="@id"/>
+ <xsl:with-param name="target" select="."/>
+ <xsl:with-param name="is_chunk" select="true()"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="title">
+ <xsl:call-template name="db.xref.tooltip">
+ <xsl:with-param name="linkend" select="@id"/>
+ <xsl:with-param name="target" select="."/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:call-template name="db.titleabbrev">
+ <xsl:with-param name="node" select="."/>
+ </xsl:call-template>
+ </a>
+ </li>
+ </xsl:for-each>
+ </ul>
+</xsl:template>
+
+
+<!--**==========================================================================
+db2html.navbar
+Generates navigation links for a page
+$node: The element to generate links for
+$prev_id: The id of the previous page
+$next_id: The id of the next page
+$prev_node: The element of the previous page
+$next_node: The element of the next page
+$position: Where the block is positioned on the pages, either 'top' or 'bottom'
+
+REMARK: Document this template
+-->
+<xsl:template name="db2html.navbar">
+ <xsl:param name="node"/>
<xsl:param name="prev_id">
<xsl:choose>
- <xsl:when test="$depth_of_chunk = 0 and $info">
- <xsl:if test="$info">
+ <xsl:when test="$depth_of_chunk = 0">
+ <xsl:if test="$info and $db.chunk.info_chunk">
<xsl:value-of select="$db.chunk.info_basename"/>
</xsl:if>
</xsl:when>
@@ -426,62 +526,54 @@ REMARK: Document this template
</xsl:param>
<xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
<xsl:param name="next_node" select="key('idkey', $next_id)"/>
- <div class="navbar">
- <xsl:if test="($info and $depth_of_chunk = 0) or $prev_node">
- <xsl:variable name="class">
- <xsl:text>navbar-prev</xsl:text>
- <xsl:if test="not($next_node)">
- <xsl:text> navbar-prev-sans-next</xsl:text>
- </xsl:if>
- </xsl:variable>
- <div class="{$class}">
- <span class="{$class}">
- <a class="navbar {$class}">
+ <xsl:param name="position" select="'top'"/>
+ <div class="navbar navbar-{$position}">
+ <!-- FIXME: rtl -->
+ <table class="navbar"><tr>
+ <td class="navbar-prev">
+ <xsl:if test="$prev_id != ''">
+ <a class="navbar-prev">
<xsl:attribute name="href">
<xsl:call-template name="db.xref.target">
<xsl:with-param name="linkend" select="$prev_id"/>
+ <xsl:with-param name="target" select="$prev_node"/>
<xsl:with-param name="is_chunk" select="true()"/>
</xsl:call-template>
</xsl:attribute>
<xsl:choose>
- <xsl:when test="$depth_of_chunk = 0">
- <!-- FIXME: don't use db.label for this -->
- <xsl:variable name="label">
- <xsl:call-template name="db.label">
- <xsl:with-param name="node" select="$info"/>
+ <xsl:when test="$prev_id = $db.chunk.info_basename">
+ <xsl:variable name="text">
+ <xsl:call-template name="l10n.gettext">
+ <xsl:with-param name="msgid" select="'About This Document'"/>
</xsl:call-template>
</xsl:variable>
<xsl:attribute name="title">
- <xsl:value-of select="normalize-space($label)"/>
+ <xsl:value-of select="$text"/>
</xsl:attribute>
- <xsl:value-of select="$label"/>
+ <xsl:copy-of select="$navbar.icon.previous"/>
+ <xsl:text>&#x00A0;&#x00A0;</xsl:text>
+ <xsl:value-of select="$text"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="title">
<xsl:call-template name="db.xref.tooltip">
<xsl:with-param name="linkend" select="$prev_id"/>
- <xsl:with-param name="target" select="$prev_node"/>
+ <xsl:with-param name="target" select="$prev_node"/>
</xsl:call-template>
</xsl:attribute>
+ <xsl:copy-of select="$navbar.icon.previous"/>
+ <xsl:text>&#x00A0;&#x00A0;</xsl:text>
<xsl:call-template name="db.titleabbrev">
<xsl:with-param name="node" select="$prev_node"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</a>
- </span>
- </div>
- </xsl:if>
- <xsl:if test="$next_node">
- <xsl:variable name="class">
- <xsl:text>navbar-next</xsl:text>
- <xsl:if test="not($prev_node)">
- <xsl:text> navbar-next-sans-prev</xsl:text>
</xsl:if>
- </xsl:variable>
- <div class="{$class}">
- <span class="{$class}">
- <a class="navbar {$class}">
+ </td>
+ <td class="navbar-next">
+ <xsl:if test="$next_id != ''">
+ <a class="navbar-prev">
<xsl:attribute name="href">
<xsl:call-template name="db.xref.target">
<xsl:with-param name="linkend" select="$next_id"/>
@@ -497,21 +589,257 @@ REMARK: Document this template
<xsl:call-template name="db.titleabbrev">
<xsl:with-param name="node" select="$next_node"/>
</xsl:call-template>
+ <xsl:text>&#x00A0;&#x00A0;</xsl:text>
+ <xsl:copy-of select="$navbar.icon.next"/>
</a>
- </span>
- </div>
- </xsl:if>
+ </xsl:if>
+ </td>
+ </tr></table>
</div>
</xsl:template>
+<xsl:variable name="navbar.icon.previous">
+ <img>
+ <xsl:attribute name="src">
+ <xsl:value-of select="$theme.icon.nav.previous"/>
+ </xsl:attribute>
+ <xsl:attribute name="height">
+ <xsl:value-of select="$theme.icon.nav.size"/>
+ </xsl:attribute>
+ <xsl:attribute name="width">
+ <xsl:value-of select="$theme.icon.nav.size"/>
+ </xsl:attribute>
+ </img>
+</xsl:variable>
+<xsl:variable name="navbar.icon.next">
+ <img>
+ <xsl:attribute name="src">
+ <xsl:value-of select="$theme.icon.nav.next"/>
+ </xsl:attribute>
+ <xsl:attribute name="height">
+ <xsl:value-of select="$theme.icon.nav.size"/>
+ </xsl:attribute>
+ <xsl:attribute name="width">
+ <xsl:value-of select="$theme.icon.nav.size"/>
+ </xsl:attribute>
+ </img>
+</xsl:variable>
-<!--%%==========================================================================
-db.chunk.content.mode
+<!--**==========================================================================
+db2html.sidenav
+Generates a navigation sidebar
+$node: The currently-selected division element
+
+REMARK: Document this template
+-->
+<xsl:template name="db2html.sidenav">
+ <xsl:param name="node" select="."/>
+ <div class="sidenav">
+ <xsl:call-template name="db2html.autotoc">
+ <xsl:with-param name="node" select="/"/>
+ <xsl:with-param name="selected" select="$node"/>
+ <xsl:with-param name="divisions" select="/*"/>
+ <xsl:with-param name="toc_depth" select="$db.chunk.max_depth + 1"/>
+ <xsl:with-param name="labels" select="false()"/>
+ <xsl:with-param name="titleabbrev" select="true()"/>
+ </xsl:call-template>
+ </div>
+</xsl:template>
+
+
+<!--**==========================================================================
+db2html.division.head.extra
+FIXME
+:Stub: true
+
+REMARK: Describe this stub template.
+-->
+<xsl:template name="db2html.division.head.extra"/>
+
+
+<!--**==========================================================================
+db2html.division.top
FIXME
+$node: The division element being rendered
+$info: The info child element of ${node}
$depth_of_chunk: The depth of the containing chunk in the document
+$prev_id: The id of the previous page
+$next_id: The id of the next page
+$prev_node: The element of the previous page
+$next_node: The element of the next page
-REMARK: Document this mode
+REMARK: Describe this template
-->
+<xsl:template name="db2html.division.top">
+ <xsl:param name="node"/>
+ <xsl:param name="info"/>
+ <xsl:param name="depth_of_chunk">
+ <xsl:call-template name="db.chunk.depth-of-chunk">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:param>
+ <xsl:param name="prev_id">
+ <xsl:choose>
+ <xsl:when test="$depth_of_chunk = 0">
+ <xsl:if test="$info and $db.chunk.info_chunk">
+ <xsl:value-of select="$db.chunk.info_basename"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="db.chunk.chunk-id.axis">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="axis" select="'previous'"/>
+ <xsl:with-param name="depth_in_chunk" select="0"/>
+ <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:param>
+ <xsl:param name="next_id">
+ <xsl:call-template name="db.chunk.chunk-id.axis">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="axis" select="'next'"/>
+ <xsl:with-param name="depth_in_chunk" select="0"/>
+ <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
+ </xsl:call-template>
+ </xsl:param>
+ <xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
+ <xsl:param name="next_node" select="key('idkey', $next_id)"/>
+ <xsl:if test="$db2html.navbar.top">
+ <xsl:call-template name="db2html.navbar">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="prev_id" select="$prev_id"/>
+ <xsl:with-param name="next_id" select="$next_id"/>
+ <xsl:with-param name="prev_node" select="$prev_node"/>
+ <xsl:with-param name="next_node" select="$next_node"/>
+ <xsl:with-param name="position" select="'top'"/>
+ </xsl:call-template>
+ </xsl:if>
+</xsl:template>
+
+
+<!--**==========================================================================
+db2html.division.sidebar
+FIXME
+$node: The division element being rendered
+$info: The info child element of ${node}
+$depth_of_chunk: The depth of the containing chunk in the document
+$prev_id: The id of the previous page
+$next_id: The id of the next page
+$prev_node: The element of the previous page
+$next_node: The element of the next page
+
+REMARK: Describe this template
+-->
+<xsl:template name="db2html.division.sidebar">
+ <xsl:param name="node"/>
+ <xsl:param name="info"/>
+ <xsl:param name="depth_of_chunk">
+ <xsl:call-template name="db.chunk.depth-of-chunk">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:param>
+ <xsl:param name="prev_id">
+ <xsl:choose>
+ <xsl:when test="$depth_of_chunk = 0">
+ <xsl:if test="$info and $db.chunk.info_chunk">
+ <xsl:value-of select="$db.chunk.info_basename"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="db.chunk.chunk-id.axis">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="axis" select="'previous'"/>
+ <xsl:with-param name="depth_in_chunk" select="0"/>
+ <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:param>
+ <xsl:param name="next_id">
+ <xsl:call-template name="db.chunk.chunk-id.axis">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="axis" select="'next'"/>
+ <xsl:with-param name="depth_in_chunk" select="0"/>
+ <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
+ </xsl:call-template>
+ </xsl:param>
+ <xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
+ <xsl:param name="next_node" select="key('idkey', $next_id)"/>
+ <xsl:if test="$db2html.sidenav">
+ <div class="sidebar">
+ <xsl:call-template name="db2html.sidenav">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </div>
+ </xsl:if>
+</xsl:template>
+
+
+<!--**==========================================================================
+db2html.division.bottom
+FIXME
+$node: The division element being rendered
+$info: The info child element of ${node}
+$depth_of_chunk: The depth of the containing chunk in the document
+$prev_id: The id of the previous page
+$next_id: The id of the next page
+$prev_node: The element of the previous page
+$next_node: The element of the next page
+
+REMARK: Describe this template
+-->
+<xsl:template name="db2html.division.bottom">
+ <xsl:param name="node"/>
+ <xsl:param name="info"/>
+ <xsl:param name="depth_of_chunk">
+ <xsl:call-template name="db.chunk.depth-of-chunk">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:param>
+ <xsl:param name="prev_id">
+ <xsl:choose>
+ <xsl:when test="$depth_of_chunk = 0">
+ <xsl:if test="$info and $db.chunk.info_chunk">
+ <xsl:value-of select="$db.chunk.info_basename"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="db.chunk.chunk-id.axis">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="axis" select="'previous'"/>
+ <xsl:with-param name="depth_in_chunk" select="0"/>
+ <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:param>
+ <xsl:param name="next_id">
+ <xsl:call-template name="db.chunk.chunk-id.axis">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="axis" select="'next'"/>
+ <xsl:with-param name="depth_in_chunk" select="0"/>
+ <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
+ </xsl:call-template>
+ </xsl:param>
+ <xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
+ <xsl:param name="next_node" select="key('idkey', $next_id)"/>
+ <xsl:if test="$db2html.navbar.bottom">
+ <xsl:call-template name="db2html.navbar">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="prev_id" select="$prev_id"/>
+ <xsl:with-param name="next_id" select="$next_id"/>
+ <xsl:with-param name="prev_node" select="$prev_node"/>
+ <xsl:with-param name="next_node" select="$next_node"/>
+ <xsl:with-param name="position" select="'bottom'"/>
+ </xsl:call-template>
+ </xsl:if>
+</xsl:template>
+
+
+<!-- == Matched Templates % db.chunk.content.mode == -->
+
+<!--#% db.chunk.content.mode -->
<xsl:template mode="db.chunk.content.mode" match="*">
<xsl:param name="depth_of_chunk">
<xsl:call-template name="db.chunk.depth-of-chunk"/>
diff --git a/xslt/docbook/html/db2html-media.xsl b/xslt/docbook/html/db2html-media.xsl
index 454ea66..1cb1a63 100644
--- a/xslt/docbook/html/db2html-media.xsl
+++ b/xslt/docbook/html/db2html-media.xsl
@@ -195,7 +195,12 @@ as a text-only mode.
<div class="mediaobject">
<xsl:call-template name="db2html.anchor"/>
<xsl:call-template name="db2html.mediaobject"/>
- <xsl:apply-templates select="caption"/>
+ <!-- When a figure contains only a single mediaobject, it eats the caption -->
+ <xsl:if test="not(../self::figure) or
+ ../*[not(self::blockinfo) and not(self::title) and
+ not(self::titleabbrev) and not(. = current()) ]">
+ <xsl:apply-templates select="caption"/>
+ </xsl:if>
</div>
</xsl:template>
diff --git a/xslt/docbook/html/db2html-title.xsl b/xslt/docbook/html/db2html-title.xsl
index cebad06..ae452f7 100644
--- a/xslt/docbook/html/db2html-title.xsl
+++ b/xslt/docbook/html/db2html-title.xsl
@@ -28,55 +28,6 @@ REMARK: Describe this module
<!--**==========================================================================
-db2html.title.css
-Outputs CSS that controls the appearance of titles
-
-REMARK: Describe this template
--->
-<xsl:template name="db2html.title.css">
-<xsl:text>
-h1 { font-size: 1.72em; margin-top: 0em; }
-h2 { font-size: 1.44em; }
-h2.title { margin-top: 1.72em; border-bottom: solid 1px; }
-h3 { font-size: 1.2em; }
-h3.title { margin-top: 1.72em; }
-h3 span.title { border-bottom: solid 1px; }
-h4 { font-size: 1.0em; }
-h4.title { margin-top: 1.44em; }
-h4 span.title { border-bottom: solid 1px; }
-h5 { font-size: 1em; margin-top: 1em; }
-h6 { font-size: 1em; margin-top: 1em; }
-h7 { font-size: 1em; margin-top: 1em; }
-</xsl:text>
-</xsl:template>
-
-
-<!--**==========================================================================
-db2html.title.label
-Generates the label for a title
-$node: The element to generate a label for
-$depth_in_chunk: The depth of ${node} in the containing chunk
-
-REMARK: Talk about what a label is
--->
-<xsl:template name="db2html.title.label">
- <xsl:param name="node" select="."/>
- <xsl:param name="depth_in_chunk">
- <xsl:call-template name="db.chunk.depth-in-chunk">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:param>
- <span class="label">
- <xsl:call-template name="db.label">
- <xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="role" select="'header'"/>
- <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
- </xsl:call-template>
- </span>
-</xsl:template>
-
-
-<!--**==========================================================================
db2html.title.block
Generates a labeled block title
$node: The element to generate a title for
@@ -87,286 +38,43 @@ REMARK: Talk about the different kinds of title blocks
<xsl:template name="db2html.title.block">
<xsl:param name="node" select="."/>
<xsl:param name="referent" select="$node/.."/>
- <div class="{local-name($node)}">
- <span class="{local-name($node)}">
- <xsl:call-template name="db2html.anchor">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- <xsl:call-template name="db2html.title.label">
- <xsl:with-param name="node" select="$referent"/>
- </xsl:call-template>
- <xsl:apply-templates select="$node/node()"/>
- </span>
- </div>
-</xsl:template>
-
-
-<!--**==========================================================================
-db2html.title.simple
-Generates a simple, unlabeled title
-$node: The element to generate a title for
-$referent: The element that ${node} is a title for
-
-REMARK: Talk about the different kinds of title blocks
--->
-<xsl:template name="db2html.title.simple">
- <xsl:param name="node" select="."/>
- <xsl:param name="referent" select="$node/.."/>
- <div class="{local-name($node)}">
- <span class="{local-name($node)}">
- <xsl:call-template name="db2html.anchor">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- <b>
- <xsl:apply-templates select="$node/node()"/>
- </b>
- </span>
- </div>
-</xsl:template>
-
-
-<!--**==========================================================================
-db2html.title.header
-Generates a header-level title
-$node: The element to generate a title for
-$referent: The element that ${node} is a title for
-$depth_in_chunk: The depth of ${node} in the containing chunk
-$referent_depth_in_chunk: The depth of ${referent} in the containing chunk
-$depth_of_chunk: The depth of the containing chunk in the document
-$generate_label: Whether to generate a label in the title
-$title_content: An optional string containing the title
-
-REMARK: Talk about the different kinds of title blocks
--->
-<xsl:template name="db2html.title.header">
- <xsl:param name="node" select="."/>
- <xsl:param name="referent" select="$node/.."/>
- <xsl:param name="depth_in_chunk">
+ <xsl:variable name="depth_in_chunk">
<xsl:call-template name="db.chunk.depth-in-chunk">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:param>
- <xsl:param name="referent_depth_in_chunk">
- <xsl:choose>
- <xsl:when test="$referent = $node">
- <xsl:value-of select="$depth_in_chunk"/>
- </xsl:when>
- <xsl:when test="$node/ancestor::* = $referent">
- <xsl:value-of select="$depth_in_chunk -
- (count($node/ancestor::*) - count($referent/ancestor::*)) "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="db.chunk.depth-in-chunk">
- <xsl:with-param name="node" select="$referent"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:param name="depth_of_chunk">
- <xsl:call-template name="db.chunk.depth-of-chunk">
- <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="node" select="$referent"/>
</xsl:call-template>
- </xsl:param>
- <xsl:param name="generate_label" select="true()"/>
- <xsl:param name="title_content"/>
-
- <xsl:element name="{concat('h', $depth_in_chunk)}"
- namespace="http://www.w3.org/1999/xhtml">
- <xsl:attribute name="class">
- <xsl:value-of select="local-name($referent)"/>
- <xsl:text> title</xsl:text>
- </xsl:attribute>
- <span class="title">
+ </xsl:variable>
+ <div class="block block-first {local-name($node)}">
+ <span class="{local-name($node)}">
<xsl:call-template name="db2html.anchor">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
- <xsl:if test="$generate_label">
- <xsl:call-template name="db2html.title.label">
+ <span class="label">
+ <xsl:call-template name="db.label">
<xsl:with-param name="node" select="$referent"/>
- <xsl:with-param name="depth_in_chunk" select="$referent_depth_in_chunk"/>
+ <xsl:with-param name="role" select="'header'"/>
+ <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
</xsl:call-template>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$title_content">
- <xsl:value-of select="$title_content"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node/node()"/>
- </xsl:otherwise>
- </xsl:choose>
+ </span>
+ <xsl:apply-templates select="$node/node()"/>
</span>
- </xsl:element>
+ </div>
</xsl:template>
-<!--**==========================================================================
-db2html.subtitle.header
-Generates a header-level subtitle
-$node: The element to generate a subtitle for
-$referent: The element that ${node} is a subtitle for
-$depth_in_chunk: The depth of ${node} in the containing chunk
-$referent_depth_in_chunk: The depth of ${referent} in the containing chunk
-$subtitle_content: An optional string containing the subtitle
-
-REMARK: Talk about the different kinds of title blocks
--->
-<xsl:template name="db2html.subtitle.header">
- <xsl:param name="node" select="."/>
- <xsl:param name="referent" select="$node/.."/>
- <xsl:param name="depth_in_chunk">
- <xsl:call-template name="db.chunk.depth-in-chunk">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:param>
- <xsl:param name="referent_depth_in_chunk">
- <xsl:choose>
- <xsl:when test="$referent = $node">
- <xsl:value-of select="$depth_in_chunk"/>
- </xsl:when>
- <xsl:when test="$node/ancestor::* = $referent">
- <xsl:value-of select="$depth_in_chunk -
- (count($node/ancestor::*) - count($referent/ancestor::*)) "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="db.chunk.depth-in-chunk">
- <xsl:with-param name="node" select="$referent"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:param name="subtitle_content"/>
-
- <xsl:element name="{concat('h', $depth_in_chunk + 1)}"
- namespace="http://www.w3.org/1999/xhtml">
- <xsl:attribute name="class">
- <xsl:value-of select="local-name($referent)"/>
- </xsl:attribute>
- <span class="subtitle">
- <xsl:call-template name="db2html.anchor">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="$subtitle_content">
- <xsl:value-of select="$subtitle_content"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node/node()"/>
- </xsl:otherwise>
- </xsl:choose>
- </span>
- </xsl:element>
-</xsl:template>
<!-- == Matched Templates == -->
-<!-- = title = -->
-<xsl:template match="title">
- <xsl:param name="referent" select=".."/>
- <xsl:param name="depth_in_chunk">
- <xsl:call-template name="db.chunk.depth-in-chunk"/>
- </xsl:param>
- <xsl:param name="referent_depth_in_chunk">
- <xsl:choose>
- <xsl:when test="$referent = .">
- <xsl:value-of select="$depth_in_chunk"/>
- </xsl:when>
- <xsl:when test="ancestor::* = $referent">
- <xsl:value-of select="$depth_in_chunk -
- (count(ancestor::*) - count($referent/ancestor::*)) "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="db.chunk.depth-in-chunk">
- <xsl:with-param name="node" select="$referent"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:param name="depth_of_chunk">
- <xsl:call-template name="db.chunk.depth-of-chunk"/>
- </xsl:param>
- <xsl:call-template name="db2html.title.header">
- <xsl:with-param name="referent" select="$referent"/>
- <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
- <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
- <xsl:with-param name="generate_label"
- select="$referent_depth_in_chunk != 0 and (
- $referent/self::appendix or $referent/self::chatper or
- $referent/self::section or $referent/self::sect1 or
- $referent/self::sect2 or $referent/self::sect3 or
- $referent/self::sect4 or $referent/self::sect5 or
- $referent/self::simplesect )"/>
- </xsl:call-template>
-</xsl:template>
-
<!-- = subtitle = -->
-<xsl:template match="subtitle">
- <xsl:param name="referent" select=".."/>
- <xsl:param name="depth_in_chunk">
- <xsl:call-template name="db.chunk.depth-in-chunk"/>
- </xsl:param>
- <xsl:param name="referent_depth_in_chunk">
- <xsl:choose>
- <xsl:when test="$referent = .">
- <xsl:value-of select="$depth_in_chunk"/>
- </xsl:when>
- <xsl:when test="ancestor::* = $referent">
- <xsl:value-of select="$depth_in_chunk -
- (count(ancestor::*) - count($referent/ancestor::*)) "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="db.chunk.depth-in-chunk">
- <xsl:with-param name="node" select="$referent"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:call-template name="db2html.subtitle.header">
- <xsl:with-param name="referent" select="$referent"/>
- <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
- </xsl:call-template>
-</xsl:template>
+<!-- Handled in db2html.title.header -->
+<xsl:template match="subtitle"/>
-<!-- = abstract/title = -->
-<xsl:template match="abstract/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = blockquote/title = -->
-<xsl:template match="abstract/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = calloutlist/title = -->
-<xsl:template match="calloutlist/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = example/title = -->
-<xsl:template match="example/title">
- <xsl:call-template name="db2html.title.block"/>
-</xsl:template>
<!-- = equation/title = -->
<xsl:template match="equation/title">
<xsl:call-template name="db2html.title.block"/>
</xsl:template>
-<!-- = figure/title = -->
-<xsl:template match="figure/title">
- <xsl:call-template name="db2html.title.block"/>
-</xsl:template>
-
-<!-- = formalpara/title = -->
-<xsl:template match="formalpara/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = itemizedlist/title = -->
-<xsl:template match="itemizedlist/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
<!-- = msg/title = -->
<xsl:template match="msg/title">
<xsl:call-template name="db2html.title.block"/>
@@ -387,39 +95,9 @@ REMARK: Talk about the different kinds of title blocks
<xsl:call-template name="db2html.title.block"/>
</xsl:template>
-<!-- = orderedlist/title = -->
-<xsl:template match="orderedlist/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = procedure/title = -->
-<xsl:template match="procedure/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = segmentedlist/title = -->
-<xsl:template match="segmentedlist/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = sidebar/title = -->
-<xsl:template match="sidebar/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
-<!-- = step/title = -->
-<xsl:template match="step/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
<!-- = table/title = -->
<xsl:template match="table/title">
<xsl:call-template name="db2html.title.block"/>
</xsl:template>
-<!-- = variablelist/title = -->
-<xsl:template match="variablelist/title">
- <xsl:call-template name="db2html.title.simple"/>
-</xsl:template>
-
</xsl:stylesheet>
diff --git a/xslt/docbook/html/db2html.xsl b/xslt/docbook/html/db2html.xsl
index e980350..3428f7b 100644
--- a/xslt/docbook/html/db2html.xsl
+++ b/xslt/docbook/html/db2html.xsl
@@ -29,13 +29,14 @@ DocBook to HTML
<!--#@ db.chunk.extension -->
<xsl:param name="db.chunk.extension" select="'.xhtml'"/>
+<xsl:include href="../../common/theme.xsl"/>
+
<xsl:include href="../common/db-chunk.xsl"/>
<xsl:include href="../common/db-common.xsl"/>
<xsl:include href="../common/db-label.xsl"/>
<xsl:include href="../common/db-title.xsl"/>
<xsl:include href="../common/db-xref.xsl"/>
-<xsl:include href="db2html-admon.xsl"/>
<xsl:include href="db2html-autotoc.xsl"/>
<xsl:include href="db2html-bibliography.xsl"/>
<xsl:include href="db2html-block.xsl"/>