diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2007-07-24 18:49:19 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2007-07-24 18:49:19 +0000 |
commit | 682c1518c1253bc78ecfadba2b92054c96287f3a (patch) | |
tree | e71b65122f29c38a29aae462ad7ea1b8a1076945 /xslt/docbook | |
parent | 2a223a2a69d224ccc87ce1312a20d1be6213b5ba (diff) | |
download | yelp-tools-682c1518c1253bc78ecfadba2b92054c96287f3a.tar.gz |
- Added cmdsynopsis and glossary tests
* test/testbook/testbook.xml:
- Added cmdsynopsis and glossary tests
* xslt/docbook/html/db2html-division.xsl:
- Fixed node comparisons by using set:has-same-node
- Put entry-type division children are in a "block" div for CSS
* xslt/docbook/html/db2html-qanda.xsl:
* xslt/docbook/html/db2html-table.xsl:
- Added FIXME notes
* xslt/docbook/html/db2html-css.xsl:
- Much CSS simplification
* xslt/docbook/html/db2html-block.xsl:
* xslt/docbook/html/db2html-refentry.xsl:
- Fixed node comparisons by using set:has-same-node
* xslt/gettext/l10n.xml.in:
* xslt/docbook/common/db-label.xsl:
* xslt/docbook/common/db-xref.xsl:
* xslt/docbook/html/db2html-cmdsynopsis.xsl:
* xslt/docbook/html/db2html-ebnf.xsl:
* xslt/docbook/html/db2html-suppressed.xsl:
* xslt/docbook/html/db2html-funcsynopsis.xsl:
- Changed sbr handling, suppress by default
- Implemented synopfragments correctly
- Put in automatic alignment padding for sbr elements
- Consolidated CSS for *synopsis elements
* xslt/docbook/html/db2html-bibliography.xsl:
- Fixed node comparisons by using set:has-same-node
- Implemented bibliolist
* xslt/docbook/html/db2html-list.xsl:
* xslt/docbook/html/db2html-classsynopsis.xsl:
- Consolidated properties for CSS styling
* xslt/docbook/html/db2html-autotoc.xsl:
- Documentation edit
svn path=/trunk/; revision=985
Diffstat (limited to 'xslt/docbook')
-rw-r--r-- | xslt/docbook/common/db-label.xsl | 28 | ||||
-rw-r--r-- | xslt/docbook/common/db-xref.xsl | 10 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-autotoc.xsl | 3 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-bibliography.xsl | 54 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-block.xsl | 108 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-classsynopsis.xsl | 2 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-cmdsynopsis.xsl | 308 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-css.xsl | 204 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-division.xsl | 17 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-ebnf.xsl | 1 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-funcsynopsis.xsl | 2 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-list.xsl | 269 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-qanda.xsl | 1 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-refentry.xsl | 5 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-suppressed.xsl | 2 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-table.xsl | 1 |
16 files changed, 655 insertions, 360 deletions
diff --git a/xslt/docbook/common/db-label.xsl b/xslt/docbook/common/db-label.xsl index 411c783..15d4445 100644 --- a/xslt/docbook/common/db-label.xsl +++ b/xslt/docbook/common/db-label.xsl @@ -240,12 +240,15 @@ REMARK: Document this mode, and the role param </xsl:call-template> </xsl:template> -<!-- FIXME --> +<!-- = db.label.mode % synopfragment = --> <xsl:template mode="db.label.mode" match="synopfragment"> <xsl:param name="role"/> - <xsl:text>(</xsl:text> - <xsl:call-template name="db.number"/> - <xsl:text>)</xsl:text> + <xsl:call-template name="l10n.gettext"> + <xsl:with-param name="msgid" select="'synopfragment.label'"/> + <xsl:with-param name="role" select="$role"/> + <xsl:with-param name="node" select="."/> + <xsl:with-param name="format" select="true()"/> + </xsl:call-template> </xsl:template> <xsl:template mode="db.label.mode" match="title | subtitle"> @@ -489,6 +492,11 @@ REMARK: Document this mode </xsl:choose> </xsl:template> +<!-- = db.number.mode % synopfragment = --> +<xsl:template mode="db.number.mode" match="synopfragment"> + <xsl:call-template name="db.digit"/> +</xsl:template> + <!-- = db.number.mode % table = --> <xsl:template mode="db.number.mode" match="table"> <xsl:choose> @@ -727,6 +735,18 @@ REMARK: Document this mode. Rename to db.number.digit.mode? </xsl:call-template> </xsl:template> +<!-- = db.digit.mode % synopfragment = --> +<xsl:template mode="db.digit.mode" match="synopfragment"> + <xsl:call-template name="db.digit.format"> + <xsl:with-param name="digit" select="count(preceding-sibling::synopfragment) + 1"/> + <xsl:with-param name="format"> + <xsl:call-template name="l10n.gettext"> + <xsl:with-param name="msgid" select="'synopfragment.digit'"/> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + <!-- = db.digit.mode % table = --> <xsl:template mode="db.digit.mode" match="table"> <xsl:call-template name="db.digit.format"> diff --git a/xslt/docbook/common/db-xref.xsl b/xslt/docbook/common/db-xref.xsl index fb43f74..99e1fb4 100644 --- a/xslt/docbook/common/db-xref.xsl +++ b/xslt/docbook/common/db-xref.xsl @@ -316,6 +316,16 @@ REMARK: Document this mode </xsl:call-template> </xsl:template> +<!-- = db.xref.content.mode % synopfragment = --> +<xsl:template mode="db.xref.content.mode" match="synopfragment"> + <xsl:param name="xrefstyle"/> + <xsl:call-template name="l10n.gettext"> + <xsl:with-param name="msgid" select="'synopfragment.label'"/> + <xsl:with-param name="node" select="."/> + <xsl:with-param name="format" select="true()"/> + </xsl:call-template> +</xsl:template> + <!-- = db.xref.content.mode % table = --> <xsl:template mode="db.xref.content.mode" match="table"> <xsl:param name="xrefstyle"/> diff --git a/xslt/docbook/html/db2html-autotoc.xsl b/xslt/docbook/html/db2html-autotoc.xsl index f856bd9..86c279d 100644 --- a/xslt/docbook/html/db2html-autotoc.xsl +++ b/xslt/docbook/html/db2html-autotoc.xsl @@ -24,7 +24,8 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA DocBook to HTML - Tables of Contents :Requires: db-label db-xref db2html-xref gettext -REMARK: Write some intro material here +This module provides templates to create tables of contents from any +division-level elements. --> diff --git a/xslt/docbook/html/db2html-bibliography.xsl b/xslt/docbook/html/db2html-bibliography.xsl index 680375f..2944bce 100644 --- a/xslt/docbook/html/db2html-bibliography.xsl +++ b/xslt/docbook/html/db2html-bibliography.xsl @@ -17,6 +17,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:set="http://exslt.org/sets" xmlns:msg="http://www.gnome.org/~shaunm/gnome-doc-utils/l10n" xmlns="http://www.w3.org/1999/xhtml" version="1.0"> @@ -25,27 +26,21 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA DocBook to HTML - Bibliographies :Requires: db-chunk db-common db-label db2html-block db2html-inline db2html-division db2html-xref gettext -REMARK: Describe this module +This module provides templates to process DocBook bibliograpies. --> <!--** ========================================================================= -db2html.bibliography.css -Outputs CSS that controls the appearance of bibliograpies ---> -<xsl:template name="db2html.bibliography.css"> -<xsl:text> -span.bibliolabel { color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>; } -* + div.biblioentry { margin-top: 1.2em; } -* + div.bibliomixed { margin-top: 1.2em; } -</xsl:text> -</xsl:template> - - -<!--** ========================================================================= db2html.biblioentry.label Outputs the label for a bibliography entry $node: The #{biblioentry} or #{bibliomixed} element to generate a label for + +This outputs a label to be placed inline at the beginning of a bibliography +entry. Labels are created for both #{biblioentry} and #{bibliomixed} elements. +The label is typically an abbreviation of the authors' names an the year of +publication. In DocBook, it is usually provides with a leading #{abbrev} +element. Without a leading #{abbrev} element, this template will instead +use the #{xreflabel} or #{id} attribute. --> <xsl:template name="db2html.biblioentry.label"> <xsl:param name="node" select="."/> @@ -80,9 +75,11 @@ $node: The #{biblioentry} or #{bibliomixed} element to generate a label for <!--%%========================================================================== db2html.biblioentry.mode -FIXME +Formats elements inside a #{biblioentry} element -REMARK: Describe this mode +This mode is used when processing the child elements of a #{biblioentry} +element. Many elements are treated differently when they appear inside +a bibliography entry. --> <xsl:template mode="db2html.biblioentry.mode" match="*"> <xsl:apply-templates select="."/> @@ -469,9 +466,11 @@ REMARK: Describe this mode <!--%%========================================================================== db2html.bibliomixed.mode -FIXME +Formats elements inside a #{bibliomixed} element -REMARK: Describe this mode +This mode is used when processing the child elements of a #{bibliomixed} +element. Many elements are treated differently when they appear inside +a bibliography entry. --> <xsl:template mode="db2html.bibliomixed.mode" match="*"> <xsl:apply-templates select="."/> @@ -602,15 +601,15 @@ REMARK: Describe this mode <xsl:variable name="node" select="."/> <div> <xsl:attribute name="class"> - <xsl:text>biblioentry block</xsl:text> - <xsl:if test="not(preceding-sibling::biblioentry or preceding-sibling::bibliomixed)"> + <xsl:text>bibliomixed block</xsl:text> + <xsl:if test="not(preceding-sibling::biblioentry | preceding-sibling::bibliomixed)"> <xsl:text> block-first</xsl:text> </xsl:if> </xsl:attribute> <xsl:call-template name="db2html.anchor"/> <xsl:call-template name="db2html.biblioentry.label"/> <xsl:apply-templates mode="db2html.biblioentry.mode" - select="*[not(. = $node/*[1]/self::abbrev)]"/> + select="*[not(set:has-same-node(., $node/*[1]/self::abbrev))]"/> </div> </xsl:template> @@ -620,15 +619,24 @@ REMARK: Describe this mode <div> <xsl:attribute name="class"> <xsl:text>bibliomixed block</xsl:text> - <xsl:if test="not(preceding-sibling::biblioentry or preceding-sibling::bibliomixed)"> + <xsl:if test="not(preceding-sibling::biblioentry | preceding-sibling::bibliomixed)"> <xsl:text> block-first</xsl:text> </xsl:if> </xsl:attribute> <xsl:call-template name="db2html.anchor"/> <xsl:call-template name="db2html.biblioentry.label"/> <xsl:apply-templates mode="db2html.bibliomixed.mode" - select="node()[not(. = $node/*[1]/self::abbrev)]"/> + select="node()[not(set:has-same-node(., $node/*[1]/self::abbrev))]"/> </div> </xsl:template> +<!-- = bibliolist = --> +<xsl:template match="bibliolist"> + <xsl:call-template name="db2html.block"> + <xsl:with-param name="class" select="'list'"/> + <xsl:with-param name="indent" select="true()"/> + <xsl:with-param name="formal" select="true()"/> + </xsl:call-template> +</xsl:template> + </xsl:stylesheet> diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl index 35ea41d..25f431c 100644 --- a/xslt/docbook/html/db2html-block.xsl +++ b/xslt/docbook/html/db2html-block.xsl @@ -17,6 +17,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:set="http://exslt.org/sets" xmlns:msg="http://www.gnome.org/~shaunm/gnome-doc-utils/l10n" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="msg" @@ -85,15 +86,10 @@ is then used by the CSS for styling. </xsl:call-template> </xsl:if> <div class="{local-name($node)}-inner"> - <xsl:apply-templates select="$node/node()[not(. = $title) and not(. = $caption)]"/> + <xsl:apply-templates select="$node/node()[not(set:has-same-node(., $title | $caption))]"/> </div> <xsl:apply-templates select="$caption"/> </xsl:when> - <xsl:when test="$node/self::title"> - <span class="title"> - <xsl:apply-templates select="$node/node()"/> - </span> - </xsl:when> <xsl:otherwise> <xsl:apply-templates select="$node/node()"/> </xsl:otherwise> @@ -108,7 +104,8 @@ Renders a formal title for a block-level element $node: The block-level element being processed $title: The element containing the title -FIXME +This template formats the contents of ${title} as a title for a block-level +element. It is called by *{db2html.block} for formal block elements. --> <xsl:template name="db2html.block.title"> <xsl:param name="node" select="."/> @@ -117,16 +114,19 @@ FIXME <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 class="title"> + <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()"/> </span> - <xsl:apply-templates select="$title/node()"/> </div> </xsl:template> + <!--**========================================================================== db2html.blockquote Renders a #{blockquote} element to HTML @@ -155,8 +155,7 @@ element. </xsl:call-template> <xsl:apply-templates select="$node/title"/> <blockquote class="{local-name($node)}"> - <xsl:apply-templates - select="$node/node()[name(.) != 'title' and name(.) != 'attribution']"/> + <xsl:apply-templates select="$node/node()[not(self::title) and not(self::attribution)]"/> </blockquote> <xsl:apply-templates select="$node/attribution"/> </div> @@ -197,6 +196,7 @@ This template creates an HTML #{p} element for the given DocBook element. db2html.pre Renders a block-level element as an HTML #{pre} element $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 $children: The child elements to process @@ -204,24 +204,23 @@ $children: The child elements to process 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. + +If ${node} has the #{linenumbering} attribute set to #{"numbered"}, then this +template will create line numbers for each line, using the *{db.linenumbering} +template. --> <xsl:template name="db2html.pre"> <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="children" select="$node/node()"/> - <!-- FIXME: - @width - @language - @format - --> <div> <xsl:attribute name="class"> - <xsl:value-of select="local-name($node)"/> - <xsl:text> block</xsl:text> + <xsl:value-of select="concat($class, ' block ', local-name($node))"/> <xsl:if test="$indent"> <xsl:text> block-indent</xsl:text> </xsl:if> @@ -269,22 +268,6 @@ is then used by the CSS for styling. </xsl:template> -<!--**========================================================================== -db2html.block.css -Outputs CSS that controls the appearance of block-level elements - -REMARK: Describe this template ---> -<xsl:template name="db2html.block.css"> -<xsl:text> -dt.glossterm { margin-left: 0em; } -dd + dt.glossterm { margin-top: 2em; } -dd.glossdef, dd.glosssee, dd.glossseealso - { margin-top: 1em; margin-left: 2em; margin-right: 1em; } -</xsl:text> -</xsl:template> - - <!-- == Matched Templates == --> <!-- = abstract = --> @@ -367,23 +350,37 @@ dd.glossdef, dd.glosssee, dd.glossseealso <!-- = glossdef = --> <xsl:template match="glossdef"> <dd class="glossdef"> - <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/> + <xsl:apply-templates select="*[not(self::glossseealso)]"/> </dd> <xsl:apply-templates select="glossseealso[1]"/> </xsl:template> <!-- = glossentry = --> <xsl:template match="glossentry"> - <dt class="glossterm"> + <dt> + <xsl:attribute name="class"> + <xsl:text>glossterm</xsl:text> + <xsl:if test="not(preceding-sibling::glossentry)"> + <xsl:text> dt-first</xsl:text> + </xsl:if> + </xsl:attribute> <xsl:apply-templates select="glossterm"/> + <xsl:if test="acronym or abbrev"> + <xsl:text> </xsl:text> + <xsl:call-template name="l10n.gettext"> + <xsl:with-param name="msgid" select="'glossentry.abbrev.format'"/> + <xsl:with-param name="node" select="(acronym | abbrev)[1]"/> + <xsl:with-param name="format" select="true()"/> + </xsl:call-template> + </xsl:if> </dt> <xsl:apply-templates select="glossdef | glosssee[1]"/> </xsl:template> -<!-- = glosssee = --> +<!-- = glosssee(also) = --> <xsl:template match="glosssee | glossseealso"> <dd class="{local-name(.)}"> - <p> + <p class="block block-first"> <xsl:call-template name="l10n.gettext"> <xsl:with-param name="msgid" select="concat(local-name(.), '.format')"/> <xsl:with-param name="node" select="."/> @@ -416,18 +413,18 @@ dd.glossdef, dd.glosssee, dd.glossseealso <xsl:with-param name="linkend" select="@otherterm"/> </xsl:call-template> </xsl:attribute> + <xsl:choose> + <xsl:when test="normalize-space(.) != ''"> + <xsl:apply-templates/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="db.xref.content"> + <xsl:with-param name="linkend" select="@otherterm"/> + <xsl:with-param name="role" select="'glosssee'"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> </a> - <xsl:choose> - <xsl:when test="normalize-space(.) != ''"> - <xsl:apply-templates/> - </xsl:when> - <xsl:otherwise> - <xsl:call-template name="db.xref.content"> - <xsl:with-param name="linkend" select="@otherterm"/> - <xsl:with-param name="role" select="'glosssee'"/> - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> @@ -530,7 +527,10 @@ dd.glossdef, dd.glosssee, dd.glossseealso <!-- = title = --> <xsl:template match="title"> - <xsl:call-template name="db2html.block"/> + <xsl:call-template name="db2html.block.title"> + <xsl:with-param name="node" select=".."/> + <xsl:with-param name="title" select="."/> + </xsl:call-template> </xsl:template> <!-- = warning = --> diff --git a/xslt/docbook/html/db2html-classsynopsis.xsl b/xslt/docbook/html/db2html-classsynopsis.xsl index a52cdf9..fd3e4f9 100644 --- a/xslt/docbook/html/db2html-classsynopsis.xsl +++ b/xslt/docbook/html/db2html-classsynopsis.xsl @@ -75,8 +75,8 @@ REMARK: Describe this param <div> <xsl:attribute name="class"> + <xsl:text>block synopsis </xsl:text> <xsl:value-of select="local-name(.)"/> - <xsl:text> block</xsl:text> <xsl:if test="$first"> <xsl:text> block-first</xsl:text> </xsl:if> diff --git a/xslt/docbook/html/db2html-cmdsynopsis.xsl b/xslt/docbook/html/db2html-cmdsynopsis.xsl index e23ada1..5355247 100644 --- a/xslt/docbook/html/db2html-cmdsynopsis.xsl +++ b/xslt/docbook/html/db2html-cmdsynopsis.xsl @@ -18,6 +18,8 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:set="http://exslt.org/sets" + xmlns:str="http://exslt.org/strings" xmlns="http://www.w3.org/1999/xhtml" version="1.0"> @@ -25,20 +27,11 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA DocBook to HTML - Command Synopses :Requires: db-label db2html-xref -REMARK: Describe this module +This module contains templates to process DocBook command synopsis elements. --> <!--@@========================================================================== -db2html.cmdsynopsis.sepchar -The default value for the #{sepchar} parameter - -REMARK: Describe this param ---> -<xsl:param name="db2html.cmdsynopsis.sepchar" select="' '"/> - - -<!--@@========================================================================== db2html.arg.choice The default value of the #{choice} parameter for #{arg} elements @@ -76,7 +69,7 @@ REMARK: Describe this param <!--**========================================================================== db2html.cmdsynopsis.css -Outputs CSS that controls the appearance of command synopsi elements +Outputs CSS that controls the appearance of command synopsis elements REMARK: Describe this template --> @@ -97,7 +90,7 @@ div.cmdsynopsis { font-family: monospace; } <xsl:value-of select="ancestor::cmdsynopsis[1]/@sepchar"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="$db2html.cmdsynopsis.sepchar"/> + <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:param> @@ -133,9 +126,23 @@ div.cmdsynopsis { font-family: monospace; } </xsl:otherwise> </xsl:choose> <span class="arg"> - <xsl:apply-templates> - <xsl:with-param name="sepchar" select="$sepchar"/> - </xsl:apply-templates> + <xsl:for-each select="node()"> + <xsl:choose> + <xsl:when test="self::sbr"> + <xsl:text>
</xsl:text> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" + select="ancestor::cmdsynopsis[1]"> + <xsl:with-param name="sbr" select="."/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="."> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> </span> <xsl:if test="$rep = 'repeat'"> <xsl:text>...</xsl:text> @@ -160,17 +167,35 @@ div.cmdsynopsis { font-family: monospace; } <xsl:value-of select="@sepchar"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="$db2html.cmdsynopsis.sepchar"/> + <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:param> - <div class="cmdsynopsis"> + <div> + <xsl:attribute name="class"> + <xsl:text>synopsis cmdsynopsis block</xsl:text> + <xsl:if test="not(preceding-sibling::* + [not(self::blockinfo) and not(self::title) and + not(self::titleabbrev) and not(self::attribution) ])"> + <xsl:text> block-first</xsl:text> + </xsl:if> + </xsl:attribute> <xsl:call-template name="db2html.anchor"/> - <pre> + <pre class="cmdsynopsis"> <xsl:for-each select="command | arg | group | sbr"> - <xsl:if test="position() != 1"> - <xsl:value-of select="$sepchar"/> - </xsl:if> + <xsl:choose> + <xsl:when test="position() = 1"/> + <xsl:when test="self::sbr"> + <xsl:text>
</xsl:text> + <xsl:value-of select="str:padding(string-length(preceding-sibling::command[1]), ' ')"/> + </xsl:when> + <xsl:when test="self::command"> + <xsl:text>
</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$sepchar"/> + </xsl:otherwise> + </xsl:choose> <xsl:apply-templates select="."> <xsl:with-param name="sepchar" select="$sepchar"/> </xsl:apply-templates> @@ -190,7 +215,7 @@ div.cmdsynopsis { font-family: monospace; } <xsl:value-of select="ancestor::cmdsynopsis[1]/@sepchar"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="$db2html.cmdsynopsis.sepchar"/> + <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:param> @@ -214,6 +239,15 @@ div.cmdsynopsis { font-family: monospace; } </xsl:otherwise> </xsl:choose> </xsl:param> + <xsl:variable name="padding"> + <xsl:if test="sbr"> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" + select="ancestor::cmdsynopsis[1]"> + <xsl:with-param name="sbr" select="sbr[1]"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + </xsl:if> + </xsl:variable> <span class="group-punc"> <xsl:choose> @@ -229,12 +263,20 @@ div.cmdsynopsis { font-family: monospace; } </xsl:choose> <span class="group"> <xsl:for-each select="*"> - <xsl:if test="local-name(.) = 'arg' and position() != 1"> - <xsl:value-of select="concat($sepchar, '|', $sepchar)"/> - </xsl:if> - <xsl:apply-templates select="."> - <xsl:with-param name="sepchar" select="$sepchar"/> - </xsl:apply-templates> + <xsl:choose> + <xsl:when test="self::sbr"> + <xsl:text>
</xsl:text> + <xsl:value-of select="$padding"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="."> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + <xsl:if test="position() != last()"> + <xsl:value-of select="concat($sepchar, '|', $sepchar)"/> + </xsl:if> + </xsl:otherwise> + </xsl:choose> </xsl:for-each> </span> <xsl:choose> @@ -254,11 +296,6 @@ div.cmdsynopsis { font-family: monospace; } </span> </xsl:template> -<!-- = sbr = --> -<xsl:template match="sbr"> - <br class="sbr"/> -</xsl:template> - <!-- = synopfragment = --> <xsl:template match="synopfragment"> <xsl:param name="sepchar"> @@ -267,16 +304,19 @@ div.cmdsynopsis { font-family: monospace; } <xsl:value-of select="ancestor::cmdsynopsis[1]/@sepchar"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="$db2html.cmdsynopsis.sepchar"/> + <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:param> <div class="synopfragment"> <xsl:call-template name="db2html.anchor"/> <i><xsl:call-template name="db.label"/></i> - <xsl:apply-templates> - <xsl:with-param name="sepchar" select="$sepchar"/> - </xsl:apply-templates> + <xsl:for-each select="*"> + <xsl:value-of select="$sepchar"/> + <xsl:apply-templates select="."> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + </xsl:for-each> </div> </xsl:template> @@ -285,4 +325,198 @@ div.cmdsynopsis { font-family: monospace; } <xsl:call-template name="db2html.xref"/> </xsl:template> + +<!--%%========================================================================== +db2html.cmdsynopsis.sbr.padding.mode +Outputs padding for elements leading up to an #{sbr} element +$sbr: The #{sbr} element to pad up to +$sepchar: The value of the #{sepchar} attribute on the enclosing #{cmdsynopsis} + +When processed in this mode, elements output whitespace to the length of the +textual output they would normally produce. This allows options to be aligned +when explicit line breaks are inserted with #{sbr} elements. + +To create the padding for a given #{sbr} element, this mode is called on the +enclosing #{cmdsynopsis} element, passing the #{sbr} element. When processed +in this mode, elements should only output padding for content the leads up to +the #{sbr} element passed in the ${sbr} parameter. When processing children +that don't contain the given #{sbr} element, the ${sbr} parameter should be +set to #{false()} for those children. This avoids additional ancestor +selectors, which are generally expensive to perform. +--> +<xsl:template mode="db2html.cmdsynopsis.sbr.padding.mode" match="node()"> + <xsl:value-of select="str:padding(string-length(.), ' ')"/> +</xsl:template> + +<!-- = cmdsynopsis % db2html.cmdsynopsis.sbr.padding.mode = --> +<xsl:template mode="db2html.cmdsynopsis.sbr.padding.mode" match="cmdsynopsis"> + <xsl:param name="sbr"/> + <xsl:param name="sepchar"/> + <xsl:variable name="child" select="*[set:has-same-node(.|.//sbr, $sbr)][1]"/> + <xsl:choose> + <xsl:when test="$child/self::synopfragment"> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" select="$child"> + <xsl:with-param name="sbr" select="$sbr"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + </xsl:when> + <xsl:otherwise> + <!-- Output padding for the preceding command --> + <xsl:variable name="cmd" select="$child/preceding-sibling::command[1]"/> + <xsl:value-of select="str:padding(string-length($cmd), ' ')"/> + <xsl:value-of select="str:padding(string-length($sepchar), ' ')"/> + <!-- Process all children that are between $cmd and $child, but + after any sbr elements between $cmd and $child --> + <xsl:for-each select="$cmd/following-sibling::* + [set:has-same-node(following-sibling::*, $child)] + [not(set:has-same-node(. | following-sibling::sbr, + $child/preceding-sibling::sbr))]"> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" select="."> + <xsl:with-param name="sbr" select="false()"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + <xsl:value-of select="str:padding(string-length($sepchar), ' ')"/> + </xsl:for-each> + <!-- And process $child itself --> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" select="$child"> + <xsl:with-param name="sbr" select="$sbr"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- = arg % db2html.cmdsynopsis.sbr.padding.mode = --> +<xsl:template mode="db2html.cmdsynopsis.sbr.padding.mode" match="arg"> + <xsl:param name="sbr"/> + <xsl:param name="sepchar"/> + <xsl:if test="@choice != 'plain'"> + <xsl:text> </xsl:text> + </xsl:if> + <xsl:choose> + <xsl:when test="not($sbr)"> + <!-- The sbr is outside this element. The total width an arg is whatever + comes before an sbr plus whatever comes after an sbr plus possible + punctuation spacing. --> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" + select="node()[not(preceding-sibling::sbr)]"> + <xsl:with-param name="sbr" select="$sbr"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" + select="sbr[last()]/following-sibling::node()"> + <xsl:with-param name="sbr" select="$sbr"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + <xsl:if test="@choice != 'plain'"> + <xsl:text> </xsl:text> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="child" select="*[set:has-same-node(.|.//sbr, $sbr)][1]"/> + <!-- Process all children that are before $child, but after + any sbr elements before $child. Process any children + before the initial sbr before $child, if it exists. --> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" + select="$child/preceding-sibling::sbr[last()]/preceding-sibling::node() + | ($child/preceding-sibling::node()) + [not(set:has-same-node(. | following-sibling::sbr, + $child/preceding-sibling::sbr))]"> + <xsl:with-param name="sbr" select="false()"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + <!-- And process $child itself --> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" select="$child"> + <xsl:with-param name="sbr" select="$sbr"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- = group % db2html.cmdsynopsis.sbr.padding.mode = --> +<xsl:template mode="db2html.cmdsynopsis.sbr.padding.mode" match="group"> + <xsl:param name="sbr"/> + <xsl:param name="sepchar"/> + <xsl:text> </xsl:text> + <xsl:choose> + <xsl:when test="not($sbr)"> + <!-- The sbr is outside this element. The total width a group is + calculated by taking all children after the last sbr (or all + children if there is no sbr), adding their widths, and adding + width for joining punctuation for all but one of them. Add + to this punctuation spacing for the group as a whole. --> + <xsl:for-each select="*[not(following-sibling::sbr) and not(self::sbr)]"> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" select="."> + <xsl:with-param name="sbr" select="$sbr"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + <xsl:if test="position() != 1"> + <xsl:value-of select="str:padding(2 * string-length($sepchar) + 1, ' ')"/> + </xsl:if> + </xsl:for-each> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:when test="set:has-same-node(., $sbr/..)"/> + <xsl:otherwise> + <xsl:variable name="child" select="*[set:has-same-node(.|.//sbr, $sbr)][1]"/> + <!-- Process all children that are before $child, but after + any sbr elements before $child. Add joining punctuation + padding for all but one of them. --> + <xsl:for-each select="($child/preceding-sibling::*) + [not(set:has-same-node(. | following-sibling::sbr, + $child/preceding-sibling::sbr))]"> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" select="."> + <xsl:with-param name="sbr" select="false()"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + <xsl:if test="position() != 1"> + <xsl:value-of select="str:padding(2 * string-length($sepchar) + 1, ' ')"/> + </xsl:if> + </xsl:for-each> + <!-- And process $child itself --> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" select="$child"> + <xsl:with-param name="sbr" select="$sbr"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- = synopfragment % db2html.cmdsynopsis.sbr.padding.mode = --> +<xsl:template mode="db2html.cmdsynopsis.sbr.padding.mode" match="synopfragment"> + <xsl:param name="sbr"/> + <xsl:param name="sepchar"/> + <xsl:variable name="label"> + <xsl:call-template name="db.label"/> + </xsl:variable> + <xsl:value-of select="str:padding(string-length($label), ' ')"/> + <xsl:value-of select="str:padding(string-length($sepchar), ' ')"/> + <xsl:variable name="child" select="*[set:has-same-node(.|.//sbr, $sbr)][1]"/> + <!-- Process all children that are before $child, but + after any sbr elements before $child --> + <xsl:for-each select="$child/preceding-sibling::* + [not(set:has-same-node(. | following-sibling::sbr, + $child/preceding-sibling::sbr))]"> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" select="."> + <xsl:with-param name="sbr" select="false()"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> + <xsl:value-of select="str:padding(string-length($sepchar), ' ')"/> + </xsl:for-each> + <!-- And process $child itself --> + <xsl:apply-templates mode="db2html.cmdsynopsis.sbr.padding.mode" select="$child"> + <xsl:with-param name="sbr" select="$sbr"/> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> +</xsl:template> + +<!-- = synopfragmentref % db2html.cmdsynopsis.sbr.padding.mode = --> +<xsl:template mode="db2html.cmdsynopsis.sbr.padding.mode" match="synopfragmentref"> + <xsl:variable name="label"> + <xsl:call-template name="db2html.xref"/> + </xsl:variable> + <xsl:value-of select="str:padding(string-length($label), ' ')"/> +</xsl:template> + </xsl:stylesheet> diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl index c23799a..71d64b0 100644 --- a/xslt/docbook/html/db2html-css.xsl +++ b/xslt/docbook/html/db2html-css.xsl @@ -19,12 +19,11 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" - extension-element-prefixes="exsl" version="1.0"> <!--!!========================================================================== DocBook to HTML - CSS -:Requires: db2html-bibliography db2html-block db2html-footnote db2html-callout db2html-cmdsynopsis db2html-qanda db2html-refentry gettext theme +:Requires: db2html-footnote db2html-callout db2html-cmdsynopsis db2html-qanda db2html-refentry gettext theme REMARK: Describe this module --> @@ -83,10 +82,10 @@ 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:text> +<!-- == common == --> html { height: 100%; } body { - margin: 0px; - padding: 12px; + 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>; @@ -98,17 +97,17 @@ sub sub { font-size: 1em; } sup { font-size: 0.83em; } sup sup { font-size: 1em; } table { border-collapse: collapse; } +table.table-pgwide { width: 100%; } td { vertical-align: top; } td { padding: 0.2em 0.83em 0.2em 0.83em; } th { padding: 0 0.83em 0 0.83em; } -thead { - border-top: solid 2px; - border-bottom: solid 2px; -} -tfoot { - border-top: solid 2px; - border-bottom: solid 2px; +tr.tr-shade { + background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>; } +td.td-colsep { border-right: solid 1px; } +td.td-rowsep { border-bottom: solid 1px; } +thead { border-top: solid 2px; border-bottom: solid 2px; } +tfoot { border-top: solid 2px; border-bottom: solid 2px; } div.body { padding: 1em; max-width: 60em; @@ -168,14 +167,17 @@ li { padding: 0; } li.li-first { margin-top: 0; } -dt { margin: 0; } +dt { margin: 1em 0 0 0; } +dt.dt-first { margin: 0; } dd { <!-- FIXME: rtl --> margin-left: 1.72em; - margin-top: 0.2em; - margin-bottom: 1em; + margin-top: 0.5em; } +dl.dl-compact dt { margin-top: 0; } dl.dl-compact dd { margin-top: 0; margin-bottom: 0; } + +<!-- == linktrail == --> ul.linktrail { display: block; margin: 0.2em 0 0 0; @@ -191,6 +193,7 @@ li.linktrail::before { <!-- FIXME: rtl? --> li.linktrail-first::before, li.linktrail-only::before { content: ''; } +<!-- == navbar == --> div.navbar { padding: 0.5em 1em 0.5em 1em; max-width: 60em; @@ -217,22 +220,7 @@ a.navbar-next::after { color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>; } -div.autotoc { - <!-- FIXME: hack --> - display: table; - margin-top: 1em; - <!-- FIXME: rtl --> - margin-left: 1.72em; - padding: 0.5em 1em 0.5em 1em; - 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.autotoc ul { margin: 0; padding: 0; } -div.autotoc li { list-style-type: none; margin: 0; } -div.autotoc div.autotoc-title { margin-bottom: 0.5em; } -div.autotoc div.autotoc { border: none; padding: 0; margin-top: 0; margin-bottom: 0.5em; } -div.autotoc div.autotoc div.autotoc { margin-bottom: 0; } - +<!-- == sidebar == --> div.sidebar { <!-- FIXME: rtl --> float: right; @@ -256,11 +244,58 @@ div.sidenav div.autotoc div.autotoc div.autotoc { } div.sidenav div.autotoc div.autotoc div.autotoc li { margin-bottom: 0; } -table.table-pgwide { width: 100%; } -tr.tr-shade { background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>; } -td.td-colsep { border-right: solid 1px; } -td.td-rowsep { border-bottom: solid 1px; } +<!-- == autotoc == --> +div.autotoc { + <!-- FIXME: hack --> + display: table; + margin-top: 1em; + <!-- FIXME: rtl --> + margin-left: 1.72em; + padding: 0.5em 1em 0.5em 1em; + 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.autotoc ul { margin: 0; padding: 0; } +div.autotoc li { list-style-type: none; margin: 0; } +div.autotoc div.autotoc-title { margin-bottom: 0.5em; } +div.autotoc div.autotoc { border: none; padding: 0; margin-top: 0; margin-bottom: 0.5em; } +div.autotoc div.autotoc div.autotoc { margin-bottom: 0; } + +<!-- == bibliography == --> +span.bibliolabel { + color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>; +} +<!-- == block == --> +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>"); +} div.blockquote { <!-- FIXME: i18n --> background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png'); @@ -301,38 +336,6 @@ div.figure-inner, div.informalfigure-inner { border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>; } div.caption { margin-top: 0.5em; } -div.list div.title span.title { - border-bottom: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>; -} -div.simplelist { - <!-- FIXME: rtl --> - margin-left: 1.72em; -} -div.simplelist table { margin-left: 0; border: none; } -div.simplelist td { - padding: 0.5em; - border-left: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>; -} -div.simplelist td.td-first { - <!-- FIXME: rtl --> - padding-left: 0; - <!-- FIXME: rtl --> - border-left: 0; -} -div.synopsis,div.funcsynopsis { - padding: 0.5em; - <!-- FIXME: watermark --> - background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>; - border-top: solid 2px </xsl:text><xsl:value-of select="$theme.color.blue_border"/><xsl:text>; - border-bottom: solid 2px </xsl:text><xsl:value-of select="$theme.color.blue_border"/><xsl:text>; -} -div.classsynopsis,div.constructorsynopsis,div.destructorsynopsis,div.methodsynopsis,div.fieldsynopsis { - padding: 0.5em; - <!-- FIXME: watermark --> - background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>; - border-top: solid 2px </xsl:text><xsl:value-of select="$theme.color.blue_border"/><xsl:text>; - border-bottom: solid 2px </xsl:text><xsl:value-of select="$theme.color.blue_border"/><xsl:text>; -} div.programlisting { padding: 0.5em; <!-- FIXME: watermark --> @@ -362,42 +365,41 @@ pre.linenumbering { <!-- FIXME: rtl --> text-align: right; } -.watermark-code-python { - <!-- FIXME --> - background-image: url("/shaunm/projects/gnome-doc-utils/data/watermarks/watermark-code-python.png"); - background-position: top right; - background-repeat: no-repeat; -} -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>"); + +<!-- == unsorted == --> +div.list div.title-formal span.title { + border-bottom: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>; } -div.important { - background-image: url("</xsl:text><xsl:value-of select="$theme.icon.admon.important"/><xsl:text>"); +div.simplelist { + <!-- FIXME: rtl --> + margin-left: 1.72em; } -div.note { - background-image: url("</xsl:text><xsl:value-of select="$theme.icon.admon.note"/><xsl:text>"); +div.simplelist table { margin-left: 0; border: none; } +div.simplelist td { + padding: 0.5em; + border-left: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>; } -div.note-bug { - background-image: url("</xsl:text><xsl:value-of select="$theme.icon.admon.bug"/><xsl:text>"); +div.simplelist td.td-first { + <!-- FIXME: rtl --> + padding-left: 0; + <!-- FIXME: rtl --> + border-left: 0; } -div.tip { - background-image: url("</xsl:text><xsl:value-of select="$theme.icon.admon.tip"/><xsl:text>"); +div.synopsis { + padding: 0.5em; + <!-- FIXME: watermarks --> + background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>; + border-top: solid 2px </xsl:text><xsl:value-of select="$theme.color.blue_border"/><xsl:text>; + border-bottom: solid 2px </xsl:text><xsl:value-of select="$theme.color.blue_border"/><xsl:text>; } -div.warning { - background-image: url("</xsl:text><xsl:value-of select="$theme.icon.admon.warning"/><xsl:text>"); +div.synopsis div.synopsis { + padding: 0; + border: none; } +div.synopsis div.block { margin-top: 0.2em; } +div.synopsis div.block-first { margin-top: 0; } + span.accel { text-decoration: underline; } span.acronym { font-family: sans-serif; } @@ -432,8 +434,16 @@ span.filename { font-family: monospace; } span.firstterm { font-style: italic; } span.foreignphrase { font-style: italic; } span.function { font-family: monospace; } -span.glossterm { font-style: italic; } + dt.glossterm span.glossterm { font-style: normal; } +<!-- +dt.glossterm { margin-left: 0em; } +dd + dt.glossterm { margin-top: 2em; } +dd.glossdef, dd.glosssee, dd.glossseealso { margin-top: 0em; margin-bottom: 0; } +--> + +span.glossterm { font-style: italic; } + span.guibutton, span.guilabel, span.guimenu, span.guimenuitem, span.guisubmenu, span.interface { font-weight: bold; color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>; @@ -469,8 +479,6 @@ span.wordasword { font-style: italic; } </xsl:text> <xsl:call-template name="db2html.footnote.css"/> - <xsl:call-template name="db2html.bibliography.css"/> - <xsl:call-template name="db2html.block.css"/> <xsl:call-template name="db2html.callout.css"/> <xsl:call-template name="db2html.cmdsynopsis.css"/> <xsl:call-template name="db2html.qanda.css"/> diff --git a/xslt/docbook/html/db2html-division.xsl b/xslt/docbook/html/db2html-division.xsl index 4889fac..78127c3 100644 --- a/xslt/docbook/html/db2html-division.xsl +++ b/xslt/docbook/html/db2html-division.xsl @@ -17,6 +17,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:set="http://exslt.org/sets" xmlns="http://www.w3.org/1999/xhtml" version="1.0"> @@ -313,17 +314,19 @@ REMARK: Talk about some of the parameters </xsl:call-template> </xsl:if> <xsl:variable name="nots" select="$divisions | $entries | $title_node | $subtitle_node"/> - <xsl:apply-templates select="*[not(. = $nots)]"> + <xsl:apply-templates select="*[not(set:has-same-node(., $nots))]"> <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:if test="$entries"> - <dl class="{local-name($node)}"> - <xsl:apply-templates select="$entries"> - <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> - </dl> + <div class="block"> + <dl class="{local-name($node)}"> + <xsl:apply-templates select="$entries"> + <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> + </dl> + </div> </xsl:if> <xsl:if test="$autotoc_depth != 0"> <xsl:call-template name="db2html.autotoc"> diff --git a/xslt/docbook/html/db2html-ebnf.xsl b/xslt/docbook/html/db2html-ebnf.xsl index 3e16e7e..73a1af3 100644 --- a/xslt/docbook/html/db2html-ebnf.xsl +++ b/xslt/docbook/html/db2html-ebnf.xsl @@ -27,6 +27,7 @@ DocBook to HTML - EBNF Elements REMARK: Describe this module --> +<!-- FIXME: rhs/sbr --> <!-- == Matched Templates == --> diff --git a/xslt/docbook/html/db2html-funcsynopsis.xsl b/xslt/docbook/html/db2html-funcsynopsis.xsl index 8e49a7d..f83afca 100644 --- a/xslt/docbook/html/db2html-funcsynopsis.xsl +++ b/xslt/docbook/html/db2html-funcsynopsis.xsl @@ -19,7 +19,6 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" xmlns="http://www.w3.org/1999/xhtml" - extension-element-prefixes="str" version="1.0"> <!--!!========================================================================== @@ -144,6 +143,7 @@ top of the XML document. The same processing instruction or inside a <xsl:call-template name="db2html.pre"> <xsl:with-param name="node" select="."/> <xsl:with-param name="children" select="*"/> + <xsl:with-param name="class" select="'synopsis'"/> </xsl:call-template> </xsl:template> diff --git a/xslt/docbook/html/db2html-list.xsl b/xslt/docbook/html/db2html-list.xsl index e81fc7d..ac0217a 100644 --- a/xslt/docbook/html/db2html-list.xsl +++ b/xslt/docbook/html/db2html-list.xsl @@ -30,31 +30,40 @@ REMARK: Describe this module <!-- == Matched Templates == --> +<!-- = variablelist = --> +<xsl:template match="glosslist"> + <div class="block list glosslist"> + <xsl:call-template name="db2html.anchor"/> + <xsl:apply-templates select="title"/> + <dl class="glosslist"> + <xsl:apply-templates select="glossentry"/> + </dl> + </div> +</xsl:template> + <!-- = itemizedlist = --> <xsl:template match="itemizedlist"> - <div class="block list"> - <div class="itemizedlist"> - <xsl:call-template name="db2html.anchor"/> - <xsl:apply-templates select="*[name(.) != 'listitem']"/> - <ul> - <xsl:if test="@mark"> - <xsl:attribute name="style"> - <xsl:text>list-style-type: </xsl:text> - <xsl:choose> - <xsl:when test="@mark = 'bullet'">disc</xsl:when> - <xsl:when test="@mark = 'box'">square</xsl:when> - <xsl:otherwise><xsl:value-of select="@mark"/></xsl:otherwise> - </xsl:choose> - </xsl:attribute> - </xsl:if> - <xsl:if test="@spacing = 'compact'"> - <xsl:attribute name="compact"> - <xsl:value-of select="@spacing"/> - </xsl:attribute> - </xsl:if> - <xsl:apply-templates select="listitem"/> - </ul> - </div> + <div class="block list itemizedlist"> + <xsl:call-template name="db2html.anchor"/> + <xsl:apply-templates select="*[not(self::listitem)]"/> + <ul class="itemizedlist"> + <xsl:if test="@mark"> + <xsl:attribute name="style"> + <xsl:text>list-style-type: </xsl:text> + <xsl:choose> + <xsl:when test="@mark = 'bullet'">disc</xsl:when> + <xsl:when test="@mark = 'box'">square</xsl:when> + <xsl:otherwise><xsl:value-of select="@mark"/></xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:if> + <xsl:if test="@spacing = 'compact'"> + <xsl:attribute name="compact"> + <xsl:value-of select="@spacing"/> + </xsl:attribute> + </xsl:if> + <xsl:apply-templates select="listitem"/> + </ul> </div> </xsl:template> @@ -101,37 +110,35 @@ REMARK: Describe this module </xsl:choose> </xsl:variable> <!-- FIXME: auto-numeration for nested lists --> - <div class="block list"> - <div class="orderedlist"> - <xsl:call-template name="db2html.anchor"/> - <xsl:apply-templates select="*[name(.) != 'listitem']"/> - <ol> - <xsl:if test="@numeration"> - <xsl:attribute name="type"> - <xsl:choose> - <xsl:when test="@numeration = 'arabic'">1</xsl:when> - <xsl:when test="@numeration = 'loweralpha'">a</xsl:when> - <xsl:when test="@numeration = 'lowerroman'">i</xsl:when> - <xsl:when test="@numeration = 'upperalpha'">A</xsl:when> - <xsl:when test="@numeration = 'upperroman'">I</xsl:when> - <xsl:otherwise>1</xsl:otherwise> - </xsl:choose> - </xsl:attribute> - </xsl:if> - <xsl:if test="$start != '1'"> - <xsl:attribute name="start"> - <xsl:value-of select="$start"/> - </xsl:attribute> - </xsl:if> - <xsl:if test="@spacing = 'compact'"> - <xsl:attribute name="compact"> - <xsl:value-of select="@spacing"/> - </xsl:attribute> - </xsl:if> - <!-- FIXME: @inheritnum --> - <xsl:apply-templates select="listitem"/> - </ol> - </div> + <div class="block list orderedlist"> + <xsl:call-template name="db2html.anchor"/> + <xsl:apply-templates select="*[not(self::listitem)]"/> + <ol class="orderedlist"> + <xsl:if test="@numeration"> + <xsl:attribute name="type"> + <xsl:choose> + <xsl:when test="@numeration = 'arabic'">1</xsl:when> + <xsl:when test="@numeration = 'loweralpha'">a</xsl:when> + <xsl:when test="@numeration = 'lowerroman'">i</xsl:when> + <xsl:when test="@numeration = 'upperalpha'">A</xsl:when> + <xsl:when test="@numeration = 'upperroman'">I</xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:if> + <xsl:if test="$start != '1'"> + <xsl:attribute name="start"> + <xsl:value-of select="$start"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@spacing = 'compact'"> + <xsl:attribute name="compact"> + <xsl:value-of select="@spacing"/> + </xsl:attribute> + </xsl:if> + <!-- FIXME: @inheritnum --> + <xsl:apply-templates select="listitem"/> + </ol> </div> </xsl:template> @@ -158,30 +165,28 @@ REMARK: Describe this module <!-- = procedure = --> <xsl:template match="procedure"> - <div class="block list"> - <div class="procedure"> - <xsl:call-template name="db2html.anchor"/> - <xsl:apply-templates select="*[name(.) != 'step']"/> - <xsl:choose> - <xsl:when test="count(step) = 1"> - <ul> - <xsl:apply-templates select="step"/> - </ul> - </xsl:when> - <xsl:otherwise> - <ol> - <xsl:apply-templates select="step"/> - </ol> - </xsl:otherwise> - </xsl:choose> - </div> + <div class="block list procedure"> + <xsl:call-template name="db2html.anchor"/> + <xsl:apply-templates select="*[not(self::step)]"/> + <xsl:choose> + <xsl:when test="count(step) = 1"> + <ul class="procedure"> + <xsl:apply-templates select="step"/> + </ul> + </xsl:when> + <xsl:otherwise> + <ol class="procedure"> + <xsl:apply-templates select="step"/> + </ol> + </xsl:otherwise> + </xsl:choose> </div> </xsl:template> <!-- = seg = --> <xsl:template match="seg"> <xsl:variable name="position" select="count(preceding-sibling::seg) + 1"/> - <p> + <p class="block seg"> <xsl:if test="$position = 1"> <xsl:attribute name="class"> <xsl:text>segfirst</xsl:text> @@ -195,7 +200,7 @@ REMARK: Describe this module <!-- = seglistitem = --> <xsl:template match="seglistitem"> <xsl:param name="position" select="count(preceding-sibling::seglistitem) + 1"/> - <div class="seglistitem"> + <div class="block seglistitem"> <div> <xsl:attribute name="class"> <xsl:choose> @@ -215,7 +220,7 @@ REMARK: Describe this module <!-- FIXME: Implement tabular segmentedlists --> <!-- = segmentedlist = --> <xsl:template match="segmentedlist"> - <div class="segmentedlist"> + <div class="block list segmentedlist"> <xsl:call-template name="db2html.anchor"/> <xsl:apply-templates select="title"/> <xsl:apply-templates select="seglistitem"/> @@ -259,59 +264,55 @@ REMARK: Describe this module </span> </xsl:when> <xsl:when test="@type = 'horiz'"> - <div class="block list"> - <div class="simplelist"> - <xsl:call-template name="db2html.anchor"/> - <table> - <xsl:for-each select="member[$columns = 1 or position() mod $columns = 1]"> - <tr> - <td class="td-first"> + <div class="block list simplelist"> + <xsl:call-template name="db2html.anchor"/> + <table class="simplelist"> + <xsl:for-each select="member[$columns = 1 or position() mod $columns = 1]"> + <tr> + <td class="td-first"> + <xsl:apply-templates select="."/> + </td> + <xsl:for-each select="following-sibling::member[ + position() < $columns]"> + <td> <xsl:apply-templates select="."/> </td> - <xsl:for-each select="following-sibling::member[ - position() < $columns]"> - <td> - <xsl:apply-templates select="."/> - </td> - </xsl:for-each> - <xsl:variable name="fcount" select="count(following-sibling::member)"/> - <xsl:if test="$fcount < ($columns - 1)"> - <td colspan="{$columns - $fcount - 1}"/> - </xsl:if> - </tr> - </xsl:for-each> - </table> - </div> + </xsl:for-each> + <xsl:variable name="fcount" select="count(following-sibling::member)"/> + <xsl:if test="$fcount < ($columns - 1)"> + <td colspan="{$columns - $fcount - 1}"/> + </xsl:if> + </tr> + </xsl:for-each> + </table> </div> </xsl:when> <xsl:otherwise> - <div class="block list"> - <div class="simplelist"> - <xsl:call-template name="db2html.anchor"/> - <xsl:variable name="rows" select="ceiling(count(member) div $columns)"/> - <table> - <xsl:for-each select="member[position() <= $rows]"> - <tr> - <td class="td-first"> + <div class="block list simplelist"> + <xsl:call-template name="db2html.anchor"/> + <xsl:variable name="rows" select="ceiling(count(member) div $columns)"/> + <table class="simplelist"> + <xsl:for-each select="member[position() <= $rows]"> + <tr> + <td class="td-first"> + <xsl:apply-templates select="."/> + </td> + <xsl:for-each select="following-sibling::member[ + position() mod $rows = 0]"> + <td> <xsl:apply-templates select="."/> </td> - <xsl:for-each select="following-sibling::member[ - position() mod $rows = 0]"> - <td> - <xsl:apply-templates select="."/> - </td> - </xsl:for-each> - <xsl:if test="position() = $rows"> - <xsl:variable name="fcount" - select="count(following-sibling::member[position() mod $rows = 0])"/> - <xsl:if test="$fcount < ($columns - 1)"> - <td colspan="{$columns - $fcount - 1}"/> - </xsl:if> + </xsl:for-each> + <xsl:if test="position() = $rows"> + <xsl:variable name="fcount" + select="count(following-sibling::member[position() mod $rows = 0])"/> + <xsl:if test="$fcount < ($columns - 1)"> + <td colspan="{$columns - $fcount - 1}"/> </xsl:if> - </tr> - </xsl:for-each> - </table> - </div> + </xsl:if> + </tr> + </xsl:for-each> + </table> </div> </xsl:otherwise> </xsl:choose> @@ -337,9 +338,9 @@ REMARK: Describe this module <!-- = substeps = --> <xsl:template match="substeps"> <xsl:variable name="depth" select="count(ancestor::substeps)"/> - <div class="substeps"> + <div class="block list substeps"> <xsl:call-template name="db2html.anchor"/> - <ol> + <ol class="substeps"> <xsl:attribute name="type"> <xsl:choose> <xsl:when test="$depth mod 3 = 0">a</xsl:when> @@ -354,7 +355,13 @@ REMARK: Describe this module <!-- = term = --> <xsl:template match="term"> - <dt class="term"> + <dt> + <xsl:attribute name="class"> + <xsl:text>term</xsl:text> + <xsl:if test="not(../preceding-sibling::varlistentry)"> + <xsl:text> dt-first</xsl:text> + </xsl:if> + </xsl:attribute> <xsl:if test="../varlistentry/@id and not(preceding-sibling::term)"> <xsl:call-template name="db2html.anchor"> <xsl:with-param name="node" select=".."/> @@ -366,14 +373,12 @@ REMARK: Describe this module <!-- = variablelist = --> <xsl:template match="variablelist"> - <div class="block list"> - <div class="variablelist"> - <xsl:call-template name="db2html.anchor"/> - <xsl:apply-templates select="*[name(.) != 'varlistentry']"/> - <dl> - <xsl:apply-templates select="varlistentry"/> - </dl> - </div> + <div class="block list variablelist"> + <xsl:call-template name="db2html.anchor"/> + <xsl:apply-templates select="*[not(self::varlistentry)]"/> + <dl class="variablelist"> + <xsl:apply-templates select="varlistentry"/> + </dl> </div> </xsl:template> @@ -393,11 +398,11 @@ REMARK: Describe this module <!-- +FIXME: are these still necessary with block-first? These templates strip the p tag around single-paragraph list items to avoid introducing extra spacing. We don't do this for list items in varlistentry elements because it adds a non-negligable amount of processing time for -non-trivial documents. The default CSS for dd elements has a negative top -margin instead. +non-trivial documents. --> <xsl:template match="itemizedlist/listitem/para[ not(preceding-sibling::* or following-sibling::*) and diff --git a/xslt/docbook/html/db2html-qanda.xsl b/xslt/docbook/html/db2html-qanda.xsl index 420a05e..aab3b67 100644 --- a/xslt/docbook/html/db2html-qanda.xsl +++ b/xslt/docbook/html/db2html-qanda.xsl @@ -110,6 +110,7 @@ dd.answer div.label { float: left; } <!-- = question = --> <xsl:template match="question"> + <!-- FIXME: dt-first --> <dt class="question"> <div class="label"> <xsl:call-template name="db.label"> diff --git a/xslt/docbook/html/db2html-refentry.xsl b/xslt/docbook/html/db2html-refentry.xsl index ce138e0..5a7d3c9 100644 --- a/xslt/docbook/html/db2html-refentry.xsl +++ b/xslt/docbook/html/db2html-refentry.xsl @@ -17,6 +17,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:set="http://exslt.org/sets" xmlns="http://www.w3.org/1999/xhtml" version="1.0"> @@ -257,10 +258,10 @@ div.refentry + div.refentry { </xsl:param> <xsl:param name="referent_depth_in_chunk"> <xsl:choose> - <xsl:when test="$referent = ."> + <xsl:when test="set:has-same-node(., $referent)"> <xsl:value-of select="$depth_in_chunk"/> </xsl:when> - <xsl:when test="ancestor::* = $referent"> + <xsl:when test="ancestor::*[set:has-same-node(., $referent)]"> <xsl:value-of select="$depth_in_chunk - (count(ancestor::*) - count($referent/ancestor::*)) "/> </xsl:when> diff --git a/xslt/docbook/html/db2html-suppressed.xsl b/xslt/docbook/html/db2html-suppressed.xsl index 12fccc3..3926dd4 100644 --- a/xslt/docbook/html/db2html-suppressed.xsl +++ b/xslt/docbook/html/db2html-suppressed.xsl @@ -43,6 +43,7 @@ modes because of the DocBook content model. <!-- Explicitly matched by parent --> <xsl:template match="listitem"/> +<xsl:template match="sbr"/> <!-- Index elements, not yet supported --> <xsl:template match="indexterm"/> @@ -61,6 +62,7 @@ modes because of the DocBook content model. <xsl:template match="appendixinfo"/> <xsl:template match="blockinfo"/> <xsl:template match="articleinfo"/> +<xsl:template match="bibliographyinfo"/> <xsl:template match="bookinfo"/> <xsl:template match="chapterinfo"/> <xsl:template match="glossaryinfo"/> diff --git a/xslt/docbook/html/db2html-table.xsl b/xslt/docbook/html/db2html-table.xsl index 8d0aace..08b05ce 100644 --- a/xslt/docbook/html/db2html-table.xsl +++ b/xslt/docbook/html/db2html-table.xsl @@ -908,6 +908,7 @@ REMARK: This template needs to be explained in detail, but I forgot how it works </xsl:template> <!--#* copy-string --> +<!-- FIXME: replace with str:padding? --> <xsl:template name="copy-string"> <xsl:param name="count" select="1"/> <xsl:param name="string"/> |