summaryrefslogtreecommitdiff
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
parent4879aee77c51f76289e2624ce00f9a162f4866dd (diff)
downloadyelp-tools-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
-rw-r--r--ChangeLog22
-rw-r--r--test/testbook/Makefile13
-rw-r--r--test/testbook/testbook.xml303
-rw-r--r--xslt/common/theme.xsl258
-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
13 files changed, 1687 insertions, 922 deletions
diff --git a/ChangeLog b/ChangeLog
index aef3be1..1310400 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2007-04-20 Shaun McCance <shaunm@gnome.org>
+
+ * 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
+
2007-04-09 Shaun McCance <shaunm@gnome.org>
* configure.in:
diff --git a/test/testbook/Makefile b/test/testbook/Makefile
new file mode 100644
index 0000000..9fad6f5
--- /dev/null
+++ b/test/testbook/Makefile
@@ -0,0 +1,13 @@
+.ALL: html
+.PHONY: html
+
+html:
+ if [ ! -d html ]; then mkdir html; fi
+ rm -f html/*.*
+ xsltproc --timing --nonet --xinclude -o html/ \
+ --param db.chunk.chunk_top 1 \
+ --stringparam theme.icon.admon.path "../../../data/icons/" \
+ --stringparam theme.icon.nav.previous "../../../data/icons/nav-previous.png" \
+ --stringparam theme.icon.nav.next "../../../data/icons/nav-next.png" \
+ ../../xslt/docbook/html/db2html.xsl \
+ testbook.xml
diff --git a/test/testbook/testbook.xml b/test/testbook/testbook.xml
new file mode 100644
index 0000000..1e8ce9d
--- /dev/null
+++ b/test/testbook/testbook.xml
@@ -0,0 +1,303 @@
+<?xml version="1.0"?><!-- -*- indent-tabs-mode: nil -*- -->
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<book id="index">
+ <title>Test Book</title>
+ <bookinfo>
+ <abstract role="description">
+ <para>This is a description of the document.</para>
+ </abstract>
+ <copyright>
+ <year>2007</year>
+ <holder>Shaun McCance</holder>
+ </copyright>
+ <publisher role="maintainer">
+ <publishername>GNOME Documentation Project</publishername>
+ </publisher>
+ <author>
+ <firstname>Shaun</firstname>
+ <surname>McCance</surname>
+ <affiliation>
+ <orgname>GNOME Documentation Project</orgname>
+ </affiliation>
+ <email>shaunm@gnome.org</email>
+ </author>
+ <revhistory>
+ <revision>
+ <revnumber>0.1</revnumber>
+ <date>1887-02-03</date>
+ <revdescription>
+ <para role="author">Shaun McCance</para>
+ <para role="publisher">GNOME Documentation Project</para>
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>0.2</revnumber>
+ <date>1902-03-08</date>
+ <revdescription>
+ <para role="author">Shaun McCance</para>
+ <para role="publisher">GNOME Documentation Project</para>
+ </revdescription>
+ </revision>
+ </revhistory>
+
+ <legalnotice>
+ <title>Feedback</title>
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+ Integer lacinia.</para>
+ </legalnotice>
+ </bookinfo>
+
+<chapter id="some-blocks">
+<title>Some Block Elements</title>
+<titleabbrev>Some Blocks</titleabbrev>
+
+<para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+porttitor condimentum nulla.</para>
+
+<section id="admon">
+ <title>Admonitions</title>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+ <caution>
+ <title>Beware the Title!</title>
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+ </caution>
+
+ <important>
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+ </important>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+ <note>
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+ </note>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+ <note role="bug">
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+ </note>
+
+ <tip>
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+ </tip>
+
+ <warning>
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+ </warning>
+
+</section> <!-- admon -->
+
+<section id="formal-block">
+ <title>Formal Blocks</title>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+ <example>
+ <title>An Example</title>
+ <programlisting><![CDATA[
+$(_DOC_LC_DOCS) : $(_DOC_C_DOCS)
+ if ! test -d $(dir $@); then mkdir $(dir $@); fi
+ case "$(srcdir)" in /*) sd="$(srcdir)";; *) sd="../$(srcdir)";;esac; \
+ if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$$sd/"; fi; \
+ (cd $(dir $@) && \
+ $(_xml2po) -e -p \
+ "$${d}$(dir $@)$(patsubst %/$(notdir $@),%,$@).po" \
+ "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \
+ cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)
+]]></programlisting>
+ </example>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+ <figure>
+ <title>A Figure</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="http://www.gnome.org/projects/orca/images/orca2-sm.jpg"/>
+ </imageobject>
+ <caption><para>The mascot for the <ulink
+ url="http://www.gnome.org/projects/orca/index.html">Orca screen
+ reader</ulink></para></caption>
+ </mediaobject>
+ </figure>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+</section> <!-- formal-block -->
+
+<section id="misc-block">
+ <title>Miscellaneous</title>
+
+ <epigraph>
+ <attribution>Henry Spencer</attribution>
+ <para>Those who do not understand Unix are condemned to reinvent it,
+ poorly.</para>
+ </epigraph>
+
+ <para>The above was brought to you courtesy of the <sgmltag>epigraph</sgmltag>
+ element. Now here is an <sgmltag>address</sgmltag> element:</para>
+
+ <address>Free Software Foundation
+51 Franklin Street, Fifth Floor
+Boston, MA 02110-1301
+USA</address>
+
+ <para>Here is a <sgmltag>blockquote</sgmltag> element:</para>
+
+ <blockquote>
+ <attribution>Richard Stallman, from the <ulink
+ url="http://www.gnu.org/gnu/manifesto.html">GNU Manifeto</ulink></attribution>
+ <para>I consider that the golden rule requires that if I like a program
+ I must share it with other people who like it. Software sellers want to
+ divide the users and conquer them, making each user agree not to share
+ with others. I refuse to break solidarity with other users in this way.
+ I cannot in good conscience sign a nondisclosure agreement or a software
+ license agreement. For years I worked within the Artificial Intelligence
+ Lab to resist such tendencies and other inhospitalities, but eventually
+ they had gone too far: I could not remain in an institution where such
+ things are done for me against my will.</para>
+ </blockquote>
+
+<!-- FIXME:
+example
+figure (caption)
+formalpara
+glossary stuff
+highlights
+literallayout
+programlisting
+screen
+synopsis
+-->
+
+</section> <!-- misc-block -->
+
+</chapter> <!-- some-blocks -->
+
+<chapter id="lists">
+<title>List Elements</title>
+
+<section id="bullet-lists">
+ <title>Bullet Lists</title>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+</section> <!-- bullet lists -->
+
+<section id="numbered-lists">
+ <title>Numbered Lists</title>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+</section> <!-- numbered-lists -->
+
+<section id="simple-lists">
+ <title>Simple Lists</title>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+</section> <!-- simple-lists -->
+
+<section id="variable-lists">
+ <title>Variable Lists</title>
+
+ <para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed risus dui,
+ faucibus at, blandit eu, congue in, sem. Suspendisse nec mi. Sed vel augue.
+ Cras egestas. Vivamus nisi. Fusce neque. Aenean posuere, orci non lacinia
+ consectetuer, neque libero semper metus, ut ullamcorper eros lorem at tellus.
+ Ut ante tellus, iaculis at, tincidunt quis, ultrices at, ligula. Pellentesque
+ porttitor condimentum nulla.</para>
+
+</section> <!-- variable-lists -->
+
+</chapter> <!-- lists -->
+
+<chapter id="tables">
+<title>Table Elements</title>
+
+</chapter> <!-- tables -->
+
+</book>
diff --git a/xslt/common/theme.xsl b/xslt/common/theme.xsl
new file mode 100644
index 0000000..1ec04fa
--- /dev/null
+++ b/xslt/common/theme.xsl
@@ -0,0 +1,258 @@
+<?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"
+ version="1.0">
+
+<!--!!==========================================================================
+Themes
+
+This module provides a common interface to specify custom colors and icons
+for transformations to presentation-oreinted formats. This allows similar
+output for different types of input documents. Theme information may either
+be passed in as XSLT parameters or specified in a theme file.
+
+REMARK: Describe the format of theme files.
+-->
+
+
+<!-- == Colors ============================================================= -->
+
+<!--@@==========================================================================
+theme.color.background
+The background color
+
+This parameter specifies the default background color.
+-->
+<xsl:param name="theme.color.background" select="'#ffffff'"/>
+
+<!--@@==========================================================================
+theme.color.link
+The color of links
+
+If set, this parameter specifies the color for unvisited links.
+-->
+<xsl:param name="theme.color.link" select="'#1f609f'"/>
+
+<!--@@==========================================================================
+theme.color.link_visited
+The color of visited links
+
+This parameter specifies the color for visited links.
+-->
+<xsl:param name="theme.color.link_visited" select="'#9f1f6f'"/>
+
+<!--@@==========================================================================
+theme.color.text
+The normal text color
+
+This parameter specifies the default color for normal text.
+-->
+<xsl:param name="theme.color.text" select="'#ffffff'"/>
+
+<!--@@==========================================================================
+theme.color.text_light
+The light text color
+
+This parameter specifies the color for light text. The light text
+color is used to make bold headings and certain parenthetical text less intense.
+-->
+<xsl:param name="theme.color.text_light" select="'#3f3f3f'"/>
+
+<!--@@==========================================================================
+theme.color.blue_background
+The blue background color
+
+This parameter specifies the blue background color. The blue
+background color may be used by certain types of block elements.
+-->
+<xsl:param name="theme.color.blue_background" select="'#f0f9ff'"/>
+
+<!--@@==========================================================================
+theme.color.blue_border
+The blue border color
+
+This parameter specifies the blue border color. The blue
+border color may be used by certain types of block elements.
+-->
+<xsl:param name="theme.color.blue_border" select="'#c0c9ff'"/>
+
+<!--@@==========================================================================
+theme.color.gray_background
+The gray background color
+
+This parameter specifies the gray background color. The gray
+background color may be used by certain types of block elements.
+-->
+<xsl:param name="theme.color.gray_background" select="'#f9f9f6'"/>
+
+<!--@@==========================================================================
+theme.color.gray_border
+The gray border color
+
+This parameter specifies the gray border color. The gray
+border color may be used by certain types of block elements.
+-->
+<xsl:param name="theme.color.gray_border" select="'#e0e0df'"/>
+
+<!--@@==========================================================================
+theme.color.red_background
+The red background color
+
+This parameter specifies the red background color. The red
+background color may be used by certain types of block elements.
+-->
+<xsl:param name="theme.color.red_background" select="'#fff0f0'"/>
+
+<!--@@==========================================================================
+theme.color.red_border
+The red border color
+
+This parameter specifies the red border color. The red
+border color may be used by certain types of block elements.
+-->
+<xsl:param name="theme.color.red_border" select="'#ffc0c0'"/>
+
+<!--@@==========================================================================
+theme.color.yellow_background
+The yellow background color
+
+This parameter specifies the yellow background color. The yellow
+background color may be used by certain types of block elements.
+-->
+<xsl:param name="theme.color.yellow_background" select="'#fffff0'"/>
+
+<!--@@==========================================================================
+theme.color.yellow_border
+The yellow border color
+
+This parameter specifies the yellow border color. The yellow
+border color may be used by certain types of block elements.
+-->
+<xsl:param name="theme.color.yellow_border" select="'#ffffc0'"/>
+
+
+<!-- == Navigation Icons =================================================== -->
+
+<!--@@==========================================================================
+theme.icon.nav.previous
+The path for the previous page icon
+
+This parameter specifies the icon used for previous page links.
+-->
+<xsl:param name="theme.icon.nav.previous" select="'nav-previous.png'"/>
+
+<!--@@==========================================================================
+theme.icon.nav.next
+The path for the next page icon
+
+This parameter specifies the icon used for next page links.
+-->
+<xsl:param name="theme.icon.nav.next" select="'nav-next.png'"/>
+
+<!--@@==========================================================================
+theme.icon.nav.size
+The size of the navigation icons
+
+This parameter specifies the size of the icons given in @{theme.icon.nav.previous}
+and @{theme.icon.nav.next}. The value of this parameter should be a single integer
+specifying both the width and the height in pixels. Icon sizes are assumed to be
+square.
+-->
+<xsl:param name="theme.icon.nav.size" select="22"/>
+
+
+<!-- == Admonition Icons =================================================== -->
+
+<!--@@==========================================================================
+theme.icon.admon.path
+The default path to the admonition icons
+
+This parameter specifies a default path where admonition icons can be found.
+This is only a default path. It has no effect on admonition icons for which
+the corresponding parameter has been specified explicitly.
+-->
+<xsl:param name="theme.icon.admon.path" select="''"/>
+
+<!--@@==========================================================================
+theme.icon.admon.size
+The size of the admonition icons
+
+This parameter specifies the size of the icons given in @{theme.icon.admon.bug},
+@{theme.icon.admon.caution}, @{theme.icon.admon.important}, @{theme.icon.admon.note},
+@{theme.icon.admon.tip}, and @{theme.icon.admon.warning}. The value of this parameter
+should be a single integer specifying both the width and the height in pixels. Icon
+sizes are assumed to be square.
+-->
+<xsl:param name="theme.icon.admon.size" select="48"/>
+
+<!--@@==========================================================================
+theme.icon.admon.bug
+The path for the bug admonition icon
+
+This parameter specifies the icon used for bug admonitions.
+-->
+<xsl:param name="theme.icon.admon.bug"
+ select="concat($theme.icon.admon.path, 'admon-bug.png')"/>
+
+<!--@@==========================================================================
+theme.icon.admon.caution
+The path for the caution admonition icon
+
+This parameter specifies the icon used for caution admonitions.
+-->
+<xsl:param name="theme.icon.admon.caution"
+ select="concat($theme.icon.admon.path, 'admon-caution.png')"/>
+
+<!--@@==========================================================================
+theme.icon.admon.important
+The path for the important admonition icon
+
+This parameter specifies the icon used for important admonitions.
+-->
+<xsl:param name="theme.icon.admon.important"
+ select="concat($theme.icon.admon.path, 'admon-important.png')"/>
+
+<!--@@==========================================================================
+theme.icon.admon.note
+The path for the note admonition icon
+
+This parameter specifies the icon used for note admonitions.
+-->
+<xsl:param name="theme.icon.admon.note"
+ select="concat($theme.icon.admon.path, 'admon-note.png')"/>
+
+<!--@@==========================================================================
+theme.icon.admon.tip
+The path for the tip admonition icon
+
+This parameter specifies the icon used for tip admonitions.
+-->
+<xsl:param name="theme.icon.admon.tip"
+ select="concat($theme.icon.admon.path, 'admon-tip.png')"/>
+
+<!--@@==========================================================================
+theme.icon.admon.warning
+The path for the warning admonition icon
+
+This parameter specifies the icon used for warning admonitions.
+-->
+<xsl:param name="theme.icon.admon.warning"
+ select="concat($theme.icon.admon.path, 'admon-warning.png')"/>
+
+</xsl:stylesheet>
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"/>