summaryrefslogtreecommitdiff
path: root/xslt
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2009-05-24 21:46:43 -0500
committerShaun McCance <shaunm@gnome.org>2009-05-24 21:46:43 -0500
commitb077d566a813b0ab58b9b00af4dd201e3feaa7c8 (patch)
treeffd6b5c0d89c3d021d8cfac120c24aafde081dfc /xslt
parentb24a1092e4537d9cd705063fd8627bb84f3fb483 (diff)
downloadgnome-doc-utils-b077d566a813b0ab58b9b00af4dd201e3feaa7c8.tar.gz
[mallard] Work on terms and tree lists
Diffstat (limited to 'xslt')
-rw-r--r--xslt/mallard/html/mal2html-css.xsl4
-rw-r--r--xslt/mallard/html/mal2html-list.xsl107
2 files changed, 85 insertions, 26 deletions
diff --git a/xslt/mallard/html/mal2html-css.xsl b/xslt/mallard/html/mal2html-css.xsl
index e62ae72..5ae2315 100644
--- a/xslt/mallard/html/mal2html-css.xsl
+++ b/xslt/mallard/html/mal2html-css.xsl
@@ -95,8 +95,8 @@ body {
padding: 12px;
min-height: 100%;
}
-ul, ol, dl { margin: 0; }
-div, pre, p, li { margin: 1em 0 0 0; padding: 0; }
+ul, ol, dl, dd { margin: 0; }
+div, pre, p, li, dt { margin: 1em 0 0 0; padding: 0; }
.first-child { margin-top: 0; }
a {
text-decoration: none;
diff --git a/xslt/mallard/html/mal2html-list.xsl b/xslt/mallard/html/mal2html-list.xsl
index 0871091..f5b7c25 100644
--- a/xslt/mallard/html/mal2html-list.xsl
+++ b/xslt/mallard/html/mal2html-list.xsl
@@ -36,11 +36,13 @@ REMARK: Describe this template
-->
<xsl:template name="mal2html.list.css">
<xsl:text>
+div.list-contents { margin: 0; padding: 0; }
div.title-list { margin-bottom: 0.5em; }
ol.list, ul.list { margin: 0; padding: 0; }
li.item-list { margin-left: 1.44em; }
-div.steps {
+div.steps-contents {
+ margin: 0;
padding: 0.5em 1em 0.5em 1em;
border-top: solid 2px;
border-bottom: solid 2px;
@@ -49,15 +51,21 @@ div.steps {
background-color: </xsl:text>
<xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
}
-div.steps div.steps {
+div.steps-contents div.steps-contents {
padding: 0;
border: none;
background-color: none;
}
-div.title-steps { margin-bottom: 0.5em; }
ol.steps, ul.steps { margin: 0; padding: 0; }
li.item-steps { margin-left: 1.44em; }
+div.terms-contents { margin: 0; }
+dt.item-next { margin-top: 0; }
+dd.item-terms {
+ margin-top: 0.2em;
+ margin-left: 1.44em;
+}
+
ul.tree {
margin: 0; padding: 0;
list-style-type: none;
@@ -100,17 +108,19 @@ div.tree-lines ul.tree ul.tree ul.tree {
</xsl:if>
</xsl:attribute>
<xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
- <xsl:element name="{$el}" namespace="{$mal2html.namespace}">
- <xsl:attribute name="class">
- <xsl:text>list</xsl:text>
- </xsl:attribute>
- <xsl:if test="@type">
- <xsl:attribute name="style">
- <xsl:value-of select="concat('list-style-type:', @type)"/>
+ <div class="list-contents">
+ <xsl:element name="{$el}" namespace="{$mal2html.namespace}">
+ <xsl:attribute name="class">
+ <xsl:text>list</xsl:text>
</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode="mal2html.list.list.mode" select="mal:item"/>
- </xsl:element>
+ <xsl:if test="@type">
+ <xsl:attribute name="style">
+ <xsl:value-of select="concat('list-style-type:', @type)"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates mode="mal2html.list.list.mode" select="mal:item"/>
+ </xsl:element>
+ </div>
</div>
</xsl:template>
@@ -124,9 +134,9 @@ div.tree-lines ul.tree ul.tree ul.tree {
</xsl:if>
</xsl:attribute>
<xsl:for-each
- select="mal:*[
- ($mal2html.editor_mode or not(self::mal:comment)
- or processing-instruction('mal2html.show_comment'))]">
+ select="mal:*[
+ ($mal2html.editor_mode or not(self::mal:comment)
+ or processing-instruction('mal2html.show_comment'))]">
<xsl:apply-templates mode="mal2html.block.mode" select=".">
<xsl:with-param name="first_child" select="position() = 1"/>
</xsl:apply-templates>
@@ -145,13 +155,15 @@ div.tree-lines ul.tree ul.tree ul.tree {
</xsl:if>
</xsl:attribute>
<xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
- <ol class="steps">
- <xsl:apply-templates mode="mal2html.list.steps.mode" select="mal:item"/>
- </ol>
+ <div class="steps-contents">
+ <ol class="steps">
+ <xsl:apply-templates mode="mal2html.list.steps.mode" select="mal:item"/>
+ </ol>
+ </div>
</div>
</xsl:template>
-<!-- = list/item = -->
+<!-- = steps/item = -->
<xsl:template mode="mal2html.list.steps.mode" match="mal:item">
<li>
<xsl:attribute name="class">
@@ -161,9 +173,9 @@ div.tree-lines ul.tree ul.tree ul.tree {
</xsl:if>
</xsl:attribute>
<xsl:for-each
- select="mal:*[
- ($mal2html.editor_mode or not(self::mal:comment)
- or processing-instruction('mal2html.show_comment'))]">
+ select="mal:*[
+ ($mal2html.editor_mode or not(self::mal:comment)
+ or processing-instruction('mal2html.show_comment'))]">
<xsl:apply-templates mode="mal2html.block.mode" select=".">
<xsl:with-param name="first_child" select="position() = 1"/>
</xsl:apply-templates>
@@ -171,6 +183,53 @@ div.tree-lines ul.tree ul.tree ul.tree {
</li>
</xsl:template>
+<!-- = terms = -->
+<xsl:template mode="mal2html.block.mode" match="mal:terms">
+ <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
+ <div>
+ <xsl:attribute name="class">
+ <xsl:text>terms</xsl:text>
+ <xsl:if test="$first_child">
+ <xsl:text> first-child</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
+ <div class="terms-contents">
+ <dl class="terms">
+ <xsl:apply-templates mode="mal2html.list.terms.mode" select="mal:item"/>
+ </dl>
+ </div>
+ </div>
+</xsl:template>
+
+<!-- = list/item = -->
+<xsl:template mode="mal2html.list.terms.mode" match="mal:item">
+ <xsl:for-each select="mal:title">
+ <dt>
+ <xsl:attribute name="class">
+ <xsl:text>item-terms</xsl:text>
+ <xsl:if test="not(../preceding-sibling::mal:item)">
+ <xsl:text> first-child</xsl:text>
+ </xsl:if>
+ <xsl:if test="preceding-sibling::mal:title">
+ <xsl:text> item-next</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates mode="mal2html.inline.mode"/>
+ </dt>
+ </xsl:for-each>
+ <dd class="item-terms">
+ <xsl:for-each
+ select="mal:*[not(self::mal:title)
+ and ($mal2html.editor_mode or not(self::mal:comment)
+ or processing-instruction('mal2html.show_comment'))]">
+ <xsl:apply-templates mode="mal2html.block.mode" select=".">
+ <xsl:with-param name="first_child" select="position() = 1"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </dd>
+</xsl:template>
+
<!-- = tree = -->
<xsl:template mode="mal2html.block.mode" match="mal:tree">
<xsl:param name="first_child" select="not(preceding-sibling::*)"/>
@@ -210,7 +269,7 @@ div.tree-lines ul.tree ul.tree ul.tree {
</xsl:choose>
</xsl:if>
<xsl:apply-templates mode="mal2html.inline.mode"
- select="*[not(self::mal:item)]"/>
+ select="node()[not(self::mal:item)]"/>
</div>
<xsl:if test="mal:item">
<ul class="tree">