1
<page xmlns="http://projectmallard.org/1.0/"
6
<revision version="0.1" date="2009-05-25" status="review"/>
9
<name>Shaun McCance</name>
10
<email>shaunm@gnome.org</email>
11
<years>2008-2009</years>
14
<include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude" />
16
<desc>Create simple trees to show heirarchical structures.</desc>
19
<title>Tree Lists</title>
21
<synopsis><code mime="application/relax-ng-compact-syntax">
22
mal_block_tree = element tree {
23
attribute style { xsd:NMTOKENS } ?,
24
attribute * - (mal:* | local:*) { text } *,
26
<link xref="mal_block_title">mal_block_title</link> ?,
29
mal_tree_item = element item {
30
attribute style { xsd:NMTOKENS } ?,
31
attribute * - (mal:* | local:*) { text } *,
33
<link xref="mal_inline">mal_inline</link>,
38
<p>Use the <code>tree</code> element to create a heirarchical tree. While
39
conceptually similar to nested <code xref="mal_block_list">list</code>
40
elements, trees offer a simple way to display common heirarchies such as
41
class inheritance or directory layouts.</p>
48
<item><p>The <code>tree</code> element can contain an optional
49
<code xref="mal_block_title">title</code> element followed by one or more
50
<code>item</code> elements. Each child <code>item</code> element can
51
contain a mixture of text and any
52
<link xref="mal_inline">general inline elements</link>, followed by
53
zero or more nested <code>item</code> elements.</p></item>
55
<item><p>The <code>tree</code> element can occur in any
56
general block context, including inside
57
<link xref="mal_page">pages</link>, <link xref="mal_section">sections</link>,
58
and certain <link xref="mal_block">block elements</link>.</p></item>
60
<item><p>The <code>style</code> attribute takes a space-separated list of
61
style hints. Processing tools should adjust their behavior according to
62
those style hints they understand.</p></item>
65
<p>The following style hints are recommended:</p>
68
<td><p><code>lines</code></p></td>
69
<td><p>draw lines to show the hierarchy</p></td>
74
<item><p>The <code>tree</code> element can have attributes from external
75
namespaces. See <link xref="mal_external"/> for more information
76
on external-namespace attributes.</p></item>
82
<!-- BEGIN examples -->
83
<section id="examples">
84
<title>Examples</title>
86
<p>Use a tree to outline a class heirarchy inside a
87
<code xref="mal_block_synopsis">>synopsis</code> element:</p>
96
<code>GtkButton</code>
97
<item><code>GtkToggleButton</code></item>
98
<item><code>GtkColorButton</code></item>
99
<item><code>GtkFontButton</code></item>
100
<item><code>GtkLinkButton</code></item>
101
<item><code>GtkOptionMenu</code></item>
102
<item><code>GtkScaleButton</code></item>
106
</synopsis>]]></code>
112
<code>GtkButton</code>
113
<item><code>GtkToggleButton</code></item>
114
<item><code>GtkColorButton</code></item>
115
<item><code>GtkFontButton</code></item>
116
<item><code>GtkLinkButton</code></item>
117
<item><code>GtkOptionMenu</code></item>
118
<item><code>GtkScaleButton</code></item>
125
<p>Use the <code>lines</code> style hint to visually show the tree structure:</p>
131
Anatinae (dabbling ducks)
134
<item>Baikal Teal</item>
138
<item>Lophonetta</item>
139
<item>Speculanas</item>
142
Anthyinae (diving ducks)
146
<item>Dendrocygninae (whistling ducks)</item>
150
Anatinae (dabbling ducks)
153
<item>Baikal Teal</item>
157
<item>Lophonetta</item>
158
<item>Speculanas</item>
161
Anthyinae (diving ducks)
165
<item>Dendrocygninae (whistling ducks)</item>
169
<!-- END examples -->
172
<!-- BEGIN processing -->
173
<section id="processing">
174
<title>Processing Expectations</title>
176
<p>Tree lists are display as block elements. Each child <code>item</code>
177
has its leading inline content displayed in a single block and any nested
178
<code>item</code> elements displayed as blocks in turn. Successive levels
179
of nesting should yield more indentation, though this may vary based on
180
style hints or other factors. By default, there should be little vertical
181
spacing between items; trees are compact. No bullets, icons, or other marks
182
are expected to precede items, although they may be used for certain style
185
<!-- END processing -->