summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog17
-rw-r--r--test/testdocs/db2html.xsl18
-rw-r--r--xslt/docbook/common/db-format.xml.in52
-rw-r--r--xslt/docbook/common/db-label.xsl25
-rw-r--r--xslt/docbook/html/db2html-admon.xsl4
-rw-r--r--xslt/docbook/html/db2html-block.xsl22
-rw-r--r--xslt/docbook/html/db2html-css.xsl1
-rw-r--r--xslt/docbook/html/db2html-qanda.xsl34
-rw-r--r--xslt/docbook/html/db2html-table.xsl2
-rw-r--r--xslt/docbook/html/db2html-title.xsl10
-rw-r--r--xslt/gettext/gettext.xsl3
11 files changed, 154 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index 4e59a21..0a2d462 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2004-10-28 Shaun McCance <shaunm@gnome.org>
+
+ * test/testdocs/db2html.xsl:
+ * xslt/docbook/common/db-format.xml.in:
+ * xslt/docbook/common/db-label.xsl:
+ * xslt/docbook/html/db2html-admon.xsl:
+ * xslt/docbook/html/db2html-block.xsl:
+ * xslt/docbook/html/db2html-css.xsl:
+ * xslt/docbook/html/db2html-qanda.xsl:
+ * xslt/docbook/html/db2html-table.xsl:
+ * xslt/docbook/html/db2html-title.xsl:
+ - Example label formatter
+ - Stylistic improvements
+
+ * xslt/gettext/gettext.xsl:
+ - Fixed typo
+
2004-10-21 Shaun McCance <shaunm@gnome.org>
* doc/xslt/Makefile.am:
diff --git a/test/testdocs/db2html.xsl b/test/testdocs/db2html.xsl
index 1bd5877..a83a72d 100644
--- a/test/testdocs/db2html.xsl
+++ b/test/testdocs/db2html.xsl
@@ -5,24 +5,8 @@
<xsl:import href="../../xslt/docbook/html/db2html.xsl"/>
-<!--
-<xsl:template match="/*/*[1]/title | /*/title">
- <xsl:param name="title_for" select=".."/>
- <xsl:param name="depth_in_chunk">
- <xsl:call-template name="db.chunk.depth-in-chunk"/>
- </xsl:param>
- <xsl:call-template name="db2html.title.header">
- <xsl:with-param name="title_for" select="$title_for"/>
- <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
- </xsl:call-template>
- <pre style="margin: 0.8em; padding: 0.8em; background-color: #9EB6D1;">
- <xsl:apply-templates mode="source.mode" select="/"/>
- </pre>
-</xsl:template>
--->
-
<xsl:template match="/*/*[preceding-sibling::*][name(.) != 'title']">
- <pre style="margin: 0.8em; padding: 0.8em; background-color: #9EB6D1;">
+ <pre style="margin: 16px; padding: 0.8em; background-color: #9EB6D1; -moz-border-radius: 8px;">
<xsl:apply-templates mode="source.mode" select="."/>
</pre>
<xsl:apply-imports/>
diff --git a/xslt/docbook/common/db-format.xml.in b/xslt/docbook/common/db-format.xml.in
index c1101b3..0b99be9 100644
--- a/xslt/docbook/common/db-format.xml.in
+++ b/xslt/docbook/common/db-format.xml.in
@@ -287,6 +287,58 @@
<parameter>
<name>role</name>
<description>
+<!-- == format.example.label =============================================== -->
+
+<template xmlns="http://www.gnome.org/~shaunm/xsldoc">
+ <name>format.example.label</name>
+ <description>
+ Format the label for a <xmltag>example</xmltag> element
+ </description>
+ <parameter>
+ <name>node</name>
+ <description>
+ The <xmltag>example</xmltag> element to format
+ </description>
+ </parameter>
+ <parameter>
+ <name>role</name>
+ <description>
+ The role of the label
+ </description>
+ </parameter>
+ <parameter>
+ <name>depth_in_chunk</name>
+ <description>
+ The depth of the element in the containing chunk
+ </description>
+ </parameter>
+</template>
+
+<xsl:template name="format.example.label">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="role"/>
+ <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>
+ <msg:msg id="format.example.label">
+ <!-- Figure %t{example} -->
+ <_msg:msgstr>format.example.label</_msg:msgstr>
+ <msg:msgstr xml:lang="C">Example %t{number}</msg:msgstr>
+ </msg:msg>
+ <msg:arg name="number">
+ <xsl:call-template name="db.label.number">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
+ </xsl:call-template>
+ </msg:arg>
+ <msg:arg name="title">
+ <xsl:apply-templates select="$node/title/node()"/>
+ </msg:arg>
+</xsl:template>
+
+
The role of the label
</description>
</parameter>
diff --git a/xslt/docbook/common/db-label.xsl b/xslt/docbook/common/db-label.xsl
index d1fede6..3f33a0b 100644
--- a/xslt/docbook/common/db-label.xsl
+++ b/xslt/docbook/common/db-label.xsl
@@ -88,6 +88,21 @@
</xsl:call-template>
</xsl:template>
+<xsl:template mode="db.label.mode" match="example">
+ <xsl:param name="role"/>
+ <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:call-template name="format.example.label">
+ <xsl:with-param name="node" select="."/>
+ <xsl:with-param name="role" select="$role"/>
+ <xsl:with-param name="lang" select="ancestor-or-self::*[@lang][1]/@lang"/>
+ <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
+ </xsl:call-template>
+</xsl:template>
+
<xsl:template mode="db.label.mode" match="figure">
<xsl:param name="role"/>
<xsl:param name="depth_in_chunk">
@@ -136,6 +151,7 @@
</xsl:call-template>
</xsl:template>
+
<xsl:template mode="db.label.mode" match="
appendix | article | book | bibliography |
colophon | example | glossary | index |
@@ -150,7 +166,7 @@
</xsl:template>
<xsl:template mode="db.label.mode" match="answer | question">
- <xsl:param name="role"/>
+ <xsl:param name="role" select="@role"/>
<xsl:variable name="qandaset" select="ancestor::qandaset[1]"/>
<!-- FIXME -->
<xsl:choose>
@@ -159,9 +175,14 @@
</xsl:when>
<xsl:when test="$qandaset/@defaultlabel = 'none'"/>
<xsl:when test="$qandaset/@defaultlabel = 'qanda'">
- <xsl:call-template name="db.label.name"/>
+ <xsl:call-template name="gettext">
+ <xsl:with-param name="msgid" select="'Q:'"/>
+ </xsl:call-template>
</xsl:when>
<xsl:otherwise>
+ <xsl:call-template name="gettext">
+ <xsl:with-param name="msgid" select="'Q:'"/>
+ </xsl:call-template>
<xsl:call-template name="db.label.number"/>
</xsl:otherwise>
</xsl:choose>
diff --git a/xslt/docbook/html/db2html-admon.xsl b/xslt/docbook/html/db2html-admon.xsl
index 8b86426..79f576a 100644
--- a/xslt/docbook/html/db2html-admon.xsl
+++ b/xslt/docbook/html/db2html-admon.xsl
@@ -179,8 +179,8 @@
<xsl:template name="db2html.admon.css">
<xsl:text>
div[class~="admonition"] {
- margin-left: 28px;
- margin-right: 28px;
+ margin-left: 24px;
+ margin-right: 24px;
}
</xsl:text>
</xsl:template>
diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl
index e0a9da1..1c6fc78 100644
--- a/xslt/docbook/html/db2html-block.xsl
+++ b/xslt/docbook/html/db2html-block.xsl
@@ -126,14 +126,26 @@
<xsl:template name="db2html.block.css">
<xsl:text>
- div[class~="figure"] { margin-left: 28px; }
+ div[class~="figure"] { margin-left: 24px; margin-right: 12px; }
div[class~="figure"] div[class~="title"] span[class~="label"] {
margin-right: 0.8em;
font-style: italic;
}
- pre[class~="programlisting"] { margin-left: 28px; overflow: auto; }
- pre[class~="screen"] { margin-left: 28px; overflow: auto; }
- pre[class~="synopsis"] { margin-left: 28px; overflow: auto; }
+ pre[class~="programlisting"] {
+ margin-left: 24px;
+ margin-right: 12px;
+ overflow: auto;
+ }
+ pre[class~="screen"] {
+ margin-left: 24px;
+ margin-right: 12px;
+ overflow: auto;
+ }
+ pre[class~="synopsis"] {
+ margin-left: 24px;
+ margin-right: 12px;
+ overflow: auto;
+ }
pre[class~="linenumbering"] {
<!-- This margin is important to get the line numbering
to line up vertically with the content. -->
@@ -145,7 +157,7 @@
padding-right: 0.4em;
padding-left: 0.4em;
}
- blockquote[class~="blockquote"] { margin-left: 28px; }
+ blockquote[class~="blockquote"] { margin-left: 24px; margin-right: 12px; }
dt[class~="glossterm"] { margin-left: 8px; }
dt[class~="glossterm"] + dd { margin-top: -8px; }
dd[class~="glossdef"] { margin-left: 24px; margin-right: 12px; }
diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl
index a09c2b4..77da6e2 100644
--- a/xslt/docbook/html/db2html-css.xsl
+++ b/xslt/docbook/html/db2html-css.xsl
@@ -21,6 +21,7 @@
<xsl:call-template name="db2html.block.css"/>
<xsl:call-template name="db2html.callout.css"/>
<xsl:call-template name="db2html.list.css"/>
+ <xsl:call-template name="db2html.qanda.css"/>
<xsl:call-template name="db2html.table.css"/>
<xsl:call-template name="db2html.title.css"/>
body {
diff --git a/xslt/docbook/html/db2html-qanda.xsl b/xslt/docbook/html/db2html-qanda.xsl
index 5819aef..daca9e6 100644
--- a/xslt/docbook/html/db2html-qanda.xsl
+++ b/xslt/docbook/html/db2html-qanda.xsl
@@ -8,10 +8,39 @@
<doc:title>Question and Answer Sets</doc:title>
+<!-- == db2html.qanda.css ================================================== -->
+
+<template xmlns="http://www.gnome.org/~shaunm/xsldoc">
+ <name>db2html.qanda.css</name>
+ <description>
+ Create CSS for the qanda elements
+ </description>
+</template>
+
+<xsl:template name="db2html.qanda.css">
+ <xsl:text>
+ dl[class~="qandaset"] dt + dd { margin-top: -8px; }
+ dt[class~="question"] { margin-left: 0px; }
+ dt[class~="question"] div[class~="label"] {
+ float: right;
+ margin-right: 1em;
+ }
+ dd[class~="answer"] { margin-left: 12px; }
+ dt[class~="answer"] div[class~="label"] {
+ float: right;
+ margin-right: 1em;
+ }
+ </xsl:text>
+</xsl:template>
+
+
<!-- == Matched Templates ================================================== -->
<xsl:template match="answer">
<dd class="answer">
+ <div class="label">
+ <xsl:call-template name="db.label"/>
+ </div>
<xsl:apply-templates/>
</dd>
</xsl:template>
@@ -60,7 +89,10 @@
<xsl:template match="question">
<dt class="question">
- <xsl:call-template name="db.label"/>
+ <!-- FIXME -->
+ <div class="label">
+ <xsl:call-template name="db.label"/>
+ </div>
<xsl:apply-templates/>
</dt>
</xsl:template>
diff --git a/xslt/docbook/html/db2html-table.xsl b/xslt/docbook/html/db2html-table.xsl
index ebba6c3..f1c1f87 100644
--- a/xslt/docbook/html/db2html-table.xsl
+++ b/xslt/docbook/html/db2html-table.xsl
@@ -39,7 +39,7 @@
<xsl:template name="db2html.table.css">
<xsl:text>
- div[class~="table"] { margin-left: 28px; }
+ div[class~="table"] { margin-left: 24px; }
div[class~="table"] div[class~="title"] span[class~="title"] {
padding-top: 2px;
padding-left: 0.4em;
diff --git a/xslt/docbook/html/db2html-title.xsl b/xslt/docbook/html/db2html-title.xsl
index 7416cea..832259c 100644
--- a/xslt/docbook/html/db2html-title.xsl
+++ b/xslt/docbook/html/db2html-title.xsl
@@ -22,13 +22,11 @@
h1 {
font-size: 1.6em;
margin-top: 0em;
- margin-left: -8px;
}
h2 {
font-size: 1.4em;
margin-top: 1.8em;
border-bottom: solid 1px;
- margin-left: -8px;
}
h2 span[class~="label"] {
float: right;
@@ -38,9 +36,11 @@
padding-bottom: 8px;
border-left: solid 1px;
}
- h3 { font-size: 1.2em; margin-top: 1.8em; margin-left: -8px; }
- h4 { font-size: 1.2em; margin-top: 1.2em; margin-left: -8px; }
- h5 { font-size: 1.0em; margin-top: 1.2em; margin-left: -8px; }
+ h3 { font-size: 1.2em; margin-top: 1.8em; }
+ h3 span[class~="title"] { border-bottom: solid 1px; }
+ h4 { font-size: 1.2em; margin-top: 1.2em; }
+ h4 span[class~="title"] { border-bottom: solid 1px; }
+ h5 { font-size: 1.0em; margin-top: 1.2em; }
</xsl:text>
</xsl:template>
diff --git a/xslt/gettext/gettext.xsl b/xslt/gettext/gettext.xsl
index 8980a96..2781d9a 100644
--- a/xslt/gettext/gettext.xsl
+++ b/xslt/gettext/gettext.xsl
@@ -122,6 +122,7 @@
</xsl:if>
</xsl:param>
+
<!-- == gettext ============================================================ -->
<template xmlns="http://www.gnome.org/~shaunm/xsldoc">
@@ -424,7 +425,7 @@
</xsl:param>
<xsl:choose>
- <xsl:when test="$num = 1">
+ <xsl:when test="$number = 1">
<xsl:text>singular</xsl:text>
</xsl:when>
<xsl:otherwise>