summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2009-05-25 20:58:58 -0500
committerShaun McCance <shaunm@gnome.org>2009-05-25 20:58:58 -0500
commitee6312e96290c9d8c790aba2fedf5adced894843 (patch)
treebcbe8c62c81bff885f9023f9904fa972efe016cb
parentb077d566a813b0ab58b9b00af4dd201e3feaa7c8 (diff)
downloadgnome-doc-utils-ee6312e96290c9d8c790aba2fedf5adced894843.tar.gz
[mallard] Finished block_tree, plus other misc fixes
-rw-r--r--doc/mallard/C/mal_block_list.xml5
-rw-r--r--doc/mallard/C/mal_block_note.xml10
-rw-r--r--doc/mallard/C/mal_block_quote.xml4
-rw-r--r--doc/mallard/C/mal_block_steps.xml5
-rw-r--r--doc/mallard/C/mal_block_terms.xml7
-rw-r--r--doc/mallard/C/mal_block_tree.xml116
-rw-r--r--xslt/mallard/html/mal2html-list.xsl44
7 files changed, 153 insertions, 38 deletions
diff --git a/doc/mallard/C/mal_block_list.xml b/doc/mallard/C/mal_block_list.xml
index 7668397..2db6b8a 100644
--- a/doc/mallard/C/mal_block_list.xml
+++ b/doc/mallard/C/mal_block_list.xml
@@ -52,8 +52,9 @@ element.</p>
<list>
<item><p>The <code>list</code> element can contain an optional
<code xref="mal_block_title">title</code> element followed by one or more
- <code>item</code> elements. Each child <code>item</code> element contains
- any <link xref="mal_inline">general inline elements</link>.</p></item>
+ <code>item</code> elements. Each child <code>item</code> element can
+ contain a mixture of text and any
+ <link xref="mal_inline">general inline elements</link>.</p></item>
<item><p>The <code>list</code> element can occur in any
general block context, including inside
diff --git a/doc/mallard/C/mal_block_note.xml b/doc/mallard/C/mal_block_note.xml
index fdd1e88..1a977fd 100644
--- a/doc/mallard/C/mal_block_note.xml
+++ b/doc/mallard/C/mal_block_note.xml
@@ -60,23 +60,23 @@ of your document.</p>
<p>The following style hints are recommended:</p>
<table rules="rows">
<tr>
- <td><p><code>"advanced"</code></p></td>
+ <td><p><code>advanced</code></p></td>
<td><p>information that advanced users may find useful</p></td>
</tr>
<tr>
- <td><p><code>"bug"</code></p></td>
+ <td><p><code>bug</code></p></td>
<td><p>a note about a known bug in the software</p></td>
</tr>
<tr>
- <td><p><code>"important"</code></p></td>
+ <td><p><code>important</code></p></td>
<td><p>important information highlighted in a note</p></td>
</tr>
<tr>
- <td><p><code>"tip"</code></p></td>
+ <td><p><code>tip</code></p></td>
<td><p>a general tip that may help the reader perform an operation better</p></td>
</tr>
<tr>
- <td><p><code>"warning"</code></p></td>
+ <td><p><code>warning</code></p></td>
<td><p>a warning to the reader about a potentially dangerous operation</p></td>
</tr>
</table>
diff --git a/doc/mallard/C/mal_block_quote.xml b/doc/mallard/C/mal_block_quote.xml
index e09b9ec..e9f172e 100644
--- a/doc/mallard/C/mal_block_quote.xml
+++ b/doc/mallard/C/mal_block_quote.xml
@@ -60,9 +60,9 @@ and have it automatically formatted by display tools.</p>
<p>The following style hints are recommended:</p>
<table rules="rows">
<tr>
- <td><p><code>"epigraph"</code></p></td>
+ <td><p><code>epigraph</code></p></td>
<td><p>an introductory or closing quote that is not part of the
- running prose, generally formatted flush right.</p></td>
+ running prose, generally formatted flush right</p></td>
</tr>
</table>
</item>
diff --git a/doc/mallard/C/mal_block_steps.xml b/doc/mallard/C/mal_block_steps.xml
index a5dc217..78641f6 100644
--- a/doc/mallard/C/mal_block_steps.xml
+++ b/doc/mallard/C/mal_block_steps.xml
@@ -51,8 +51,9 @@ attribute to <code>"numbered"</code> instead.</p>
<list>
<item><p>The <code>steps</code> element can contain an optional
<code xref="mal_block_title">title</code> element followed by one or more
- <code>item</code> elements. Each child <code>item</code> element contains
- any <link xref="mal_inline">general inline elements</link>.</p></item>
+ <code>item</code> elements. Each child <code>item</code> element can
+ contain a mixture of text and any
+ <link xref="mal_inline">general inline elements</link>.</p></item>
<item><p>The <code>steps</code> element can occur in any
general block context, including inside
diff --git a/doc/mallard/C/mal_block_terms.xml b/doc/mallard/C/mal_block_terms.xml
index 8a01dda..a52824f 100644
--- a/doc/mallard/C/mal_block_terms.xml
+++ b/doc/mallard/C/mal_block_terms.xml
@@ -47,9 +47,10 @@ mal_block_terms = element terms {
<list>
<item><p>The <code>dlist</code> element can contain an optional
<code xref="mal_block_title">title</code> element followed by one or more
- <code>item</code> elements. Each child <code>item</code> element contains
- one or more <code xref="mal_block_title">title</code> elements followed by
- any <link xref="mal_inline">general inline elements</link>.</p></item>
+ <code>item</code> elements. Each child <code>item</code> element can
+ contain one or more <code xref="mal_block_title">title</code> elements
+ followed by a mixture of text and any
+ <link xref="mal_inline">general inline elements</link>.</p></item>
<item><p>The <code>dlist</code> element can occur in any
general block context, including inside
diff --git a/doc/mallard/C/mal_block_tree.xml b/doc/mallard/C/mal_block_tree.xml
index 440033a..f760f2d 100644
--- a/doc/mallard/C/mal_block_tree.xml
+++ b/doc/mallard/C/mal_block_tree.xml
@@ -3,7 +3,20 @@
id="mal_block_tree">
<info>
- <version number="0.1" date="2007-02-21" status="stub"/>
+ <version number="0.1" date="2009-05-25" status="review"/>
+
+ <credit type="author">
+ <name>Shaun McCance</name>
+ <email>shaunm@gnome.org</email>
+ </credit>
+ <copyright>
+ <year>2008-2009</year>
+ <name>Shaun McCance</name>
+ </copyright>
+
+ <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude" />
+
+ <desc>Create simple trees to show heirarchical structures.</desc>
</info>
<title>Tree Lists</title>
@@ -25,6 +38,49 @@ mal_tree_item = element item {
}
</code></synopsis>
+<p>Use the <code>tree</code> element to create a heirarchical tree. While
+conceptually similar to nested <code xref="mal_block_list">list</code>
+elements, trees offer a simple way to display common heirarchies such as
+class inheritance or directory layouts.</p>
+
+
+<!-- BEGIN notes -->
+<section id="notes">
+ <title>Notes</title>
+ <list>
+ <item><p>The <code>tree</code> element can contain an optional
+ <code xref="mal_block_title">title</code> element followed by one or more
+ <code>item</code> elements. Each child <code>item</code> element can
+ contain a mixture of text and any
+ <link xref="mal_inline">general inline elements</link>, followed by
+ zero or more nested <code>item</code> elements.</p></item>
+
+ <item><p>The <code>tree</code> element can occur in any
+ general block context, including inside
+ <link xref="mal_page">pages</link>, <link xref="mal_section">sections</link>,
+ and certain <link xref="mal_block">block elements</link>.</p></item>
+
+ <item><p>The <code>style</code> attribute takes a space-separated list of
+ style hints. Processing tools should adjust their behavior according to
+ those style hints they understand.</p></item>
+
+ <item>
+ <p>The following style hints are recommended:</p>
+ <table rules="rows">
+ <tr>
+ <td><p><code>lines</code></p></td>
+ <td><p>draw lines to show the hierarchy</p></td>
+ </tr>
+ </table>
+ </item>
+
+ <item><p>The <code>tree</code> element can have attributes from external
+ namespaces. See <link xref="mal_external"/> for more information
+ on external-namespace attributes.</p></item>
+ </list>
+</section>
+<!-- END notes -->
+
<!-- BEGIN examples -->
<section id="examples">
@@ -69,18 +125,66 @@ mal_tree_item = element item {
</synopsis>
</example>
+ <p>Use the <code>lines</code> style hint to visually show the tree structure:</p>
+
+ <example>
+ <code><![CDATA[
+<tree style="lines">
+ <item>
+ Anatinae (dabbling ducks)
+ <item>
+ Anas
+ <item>Baikal Teal</item>
+ <item>Wigeons</item>
+ <item>Mallard</item>
+ </item>
+ <item>Lophonetta</item>
+ <item>Speculanas</item>
+ </item>
+ <item>
+ Anthyinae (diving ducks)
+ <item>Aythya</item>
+ <item>Netta</item>
+ </item>
+ <item>Dendrocygninae (whistling ducks)</item>
+</tree>]]></code>
<tree style="lines">
<item>
- one
- <item>do</item>
- <item>re</item>
- <item>mi</item>
+ Anatinae (dabbling ducks)
+ <item>
+ Anas
+ <item>Baikal Teal</item>
+ <item>Wigeons</item>
+ <item>Mallard</item>
+ </item>
+ <item>Lophonetta</item>
+ <item>Speculanas</item>
</item>
<item>
- two
+ Anthyinae (diving ducks)
+ <item>Aythya</item>
+ <item>Netta</item>
</item>
+ <item>Dendrocygninae (whistling ducks)</item>
</tree>
+ </example>
</section>
<!-- END examples -->
+
+<!-- BEGIN processing -->
+<section id="processing">
+ <title>Processing Expectations</title>
+
+ <p>Tree lists are display as block elements. Each child <code>item</code>
+ has its leading inline content displayed in a single block and any nested
+ <code>item</code> elements displayed as blocks in turn. Successive levels
+ of nesting should yield more indentation, though this may vary based on
+ style hints or other factors. By default, there should be little vertical
+ spacing between items; trees are compact. No bullets, icons, or other marks
+ are expected to precede items, although they may be used for certain style
+ hints.</p>
+</section>
+<!-- END processing -->
+
</page>
diff --git a/xslt/mallard/html/mal2html-list.xsl b/xslt/mallard/html/mal2html-list.xsl
index f5b7c25..22a54f0 100644
--- a/xslt/mallard/html/mal2html-list.xsl
+++ b/xslt/mallard/html/mal2html-list.xsl
@@ -75,12 +75,7 @@ div.item-tree { margin: 0; padding: 0; }
ul.tree ul.tree {
margin-left: 1.44em;
}
-div.tree-lines ul.tree ul.tree {
- margin-left: 0.2em;
-}
-div.tree-lines ul.tree ul.tree ul.tree {
- margin-left: 1.44em;
-}
+div.tree-lines ul.tree { margin-left: 0; }
</xsl:text>
</xsl:template>
@@ -256,26 +251,39 @@ div.tree-lines ul.tree ul.tree ul.tree {
<!-- = tree/item = -->
<xsl:template mode="mal2html.list.tree.mode" match="mal:item">
<xsl:param name="lines" select="false()"/>
+ <xsl:param name="prefix" select="''"/>
<li class="item-tree">
<div class="item-tree">
- <xsl:if test="$lines and not(parent::mal:list)">
- <xsl:choose>
- <xsl:when test="following-sibling::mal:item">
- <xsl:text>&#x251C; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>&#x2514; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:if test="$lines">
+ <xsl:value-of select="$prefix"/>
+ <xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates mode="mal2html.inline.mode"
select="node()[not(self::mal:item)]"/>
</div>
<xsl:if test="mal:item">
<ul class="tree">
- <xsl:apply-templates mode="mal2html.list.tree.mode" select="mal:item">
- <xsl:with-param name="lines" select="$lines"/>
- </xsl:apply-templates>
+ <xsl:for-each select="mal:item">
+ <xsl:apply-templates mode="mal2html.list.tree.mode" select=".">
+ <xsl:with-param name="lines" select="$lines"/>
+ <xsl:with-param name="prefix">
+ <xsl:if test="$lines">
+ <xsl:value-of select="translate(
+ translate($prefix, '&#x251C;', '&#x2502;'),
+ '&#x2514;', '&#x202F;')"/>
+ <xsl:text>&#x202F;&#x202F;&#x202F;&#x202F;</xsl:text>
+ <xsl:choose>
+ <xsl:when test="following-sibling::mal:item">
+ <xsl:text>&#x251C;</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>&#x2514;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:for-each>
</ul>
</xsl:if>
</li>