~ubuntu-branches/ubuntu/trusty/gnome-doc-utils/trusty

« back to all changes in this revision

Viewing changes to doc/mallard/C/mal_block_tree.page

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2009-06-15 11:03:13 UTC
  • mfrom: (1.1.24 upstream)
  • Revision ID: james.westby@ubuntu.com-20090615110313-b4vn2m00muam19tc
Tags: 0.17.1-0ubuntu1
* New upstream release: (LP: #387210)
  - Integrated Mallard support
  - Fix file-not-found warnings from config.status (Christian Persch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<page xmlns="http://projectmallard.org/1.0/"
 
2
      type="topic"
 
3
      id="mal_block_tree">
 
4
 
 
5
<info>
 
6
  <revision version="0.1" date="2009-05-25" status="review"/>
 
7
 
 
8
  <credit type="author">
 
9
    <name>Shaun McCance</name>
 
10
    <email>shaunm@gnome.org</email>
 
11
  </credit>
 
12
  <copyright>
 
13
    <year>2008-2009</year>
 
14
    <name>Shaun McCance</name>
 
15
  </copyright>
 
16
 
 
17
  <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude" />
 
18
 
 
19
  <desc>Create simple trees to show heirarchical structures.</desc>
 
20
</info>
 
21
 
 
22
<title>Tree Lists</title>
 
23
 
 
24
<synopsis><code mime="application/relax-ng-compact-syntax">
 
25
mal_block_tree = element tree {
 
26
  attribute style { xsd:NMTOKENS } ?,
 
27
  attribute * - (mal:* | local:*) { text } *,
 
28
 
 
29
  <link xref="mal_block_title">mal_block_title</link> ?,
 
30
  mal_tree_item +
 
31
}
 
32
mal_tree_item = element item {
 
33
  attribute style { xsd:NMTOKENS } ?,
 
34
  attribute * - (mal:* | local:*) { text } *,
 
35
 
 
36
  <link xref="mal_inline">mal_inline</link>,
 
37
  mal_tree_item *
 
38
}
 
39
</code></synopsis>
 
40
 
 
41
<p>Use the <code>tree</code> element to create a heirarchical tree.  While
 
42
conceptually similar to nested <code xref="mal_block_list">list</code>
 
43
elements, trees offer a simple way to display common heirarchies such as
 
44
class inheritance or directory layouts.</p>
 
45
 
 
46
 
 
47
<!-- BEGIN notes -->
 
48
<section id="notes">
 
49
  <title>Notes</title>
 
50
  <list>
 
51
    <item><p>The <code>tree</code> element can contain an optional
 
52
    <code xref="mal_block_title">title</code> element followed by one or more
 
53
    <code>item</code> elements.  Each child <code>item</code> element can
 
54
    contain a mixture of text and any
 
55
    <link xref="mal_inline">general inline elements</link>, followed by
 
56
    zero or more nested <code>item</code> elements.</p></item>
 
57
 
 
58
    <item><p>The <code>tree</code> element can occur in any
 
59
    general block context, including inside
 
60
    <link xref="mal_page">pages</link>, <link xref="mal_section">sections</link>,
 
61
    and certain <link xref="mal_block">block elements</link>.</p></item>
 
62
 
 
63
    <item><p>The <code>style</code> attribute takes a space-separated list of
 
64
    style hints.  Processing tools should adjust their behavior according to
 
65
    those style hints they understand.</p></item>
 
66
 
 
67
    <item>
 
68
      <p>The following style hints are recommended:</p>
 
69
      <table rules="rows">
 
70
        <tr>
 
71
          <td><p><code>lines</code></p></td>
 
72
          <td><p>draw lines to show the hierarchy</p></td>
 
73
        </tr>
 
74
      </table>
 
75
    </item>
 
76
 
 
77
    <item><p>The <code>tree</code> element can have attributes from external
 
78
    namespaces.  See <link xref="mal_external"/> for more information
 
79
    on external-namespace attributes.</p></item>
 
80
  </list>
 
81
</section>
 
82
<!-- END notes -->
 
83
 
 
84
 
 
85
<!-- BEGIN examples -->
 
86
<section id="examples">
 
87
  <title>Examples</title>
 
88
 
 
89
  <p>Use a tree to outline a class heirarchy inside a
 
90
  <code xref="mal_block_synopsis">>synopsis</code> element:</p>
 
91
 
 
92
  <example>
 
93
    <code><![CDATA[
 
94
<synopsis>
 
95
  <tree>
 
96
    <item>
 
97
      <code>GtkBin</code>
 
98
      <item>
 
99
        <code>GtkButton</code>
 
100
        <item><code>GtkToggleButton</code></item>
 
101
        <item><code>GtkColorButton</code></item>
 
102
        <item><code>GtkFontButton</code></item>
 
103
        <item><code>GtkLinkButton</code></item>
 
104
        <item><code>GtkOptionMenu</code></item>
 
105
        <item><code>GtkScaleButton</code></item>
 
106
      </item>
 
107
    </item>
 
108
  </tree>
 
109
</synopsis>]]></code>
 
110
    <synopsis>
 
111
      <tree>
 
112
        <item>
 
113
          <code>GtkBin</code>
 
114
          <item>
 
115
            <code>GtkButton</code>
 
116
            <item><code>GtkToggleButton</code></item>
 
117
            <item><code>GtkColorButton</code></item>
 
118
            <item><code>GtkFontButton</code></item>
 
119
            <item><code>GtkLinkButton</code></item>
 
120
            <item><code>GtkOptionMenu</code></item>
 
121
            <item><code>GtkScaleButton</code></item>
 
122
          </item>
 
123
        </item>
 
124
      </tree>
 
125
    </synopsis>
 
126
  </example>
 
127
 
 
128
  <p>Use the <code>lines</code> style hint to visually show the tree structure:</p>
 
129
 
 
130
  <example>
 
131
    <code><![CDATA[
 
132
<tree style="lines">
 
133
  <item>
 
134
    Anatinae (dabbling ducks)
 
135
    <item>
 
136
      Anas
 
137
      <item>Baikal Teal</item>
 
138
      <item>Wigeons</item>
 
139
      <item>Mallard</item>
 
140
    </item>
 
141
    <item>Lophonetta</item>
 
142
    <item>Speculanas</item>
 
143
  </item>
 
144
  <item>
 
145
    Anthyinae (diving ducks)
 
146
    <item>Aythya</item>
 
147
    <item>Netta</item>
 
148
  </item>
 
149
  <item>Dendrocygninae (whistling ducks)</item>
 
150
</tree>]]></code>
 
151
    <tree style="lines">
 
152
      <item>
 
153
        Anatinae (dabbling ducks)
 
154
        <item>
 
155
          Anas
 
156
          <item>Baikal Teal</item>
 
157
          <item>Wigeons</item>
 
158
          <item>Mallard</item>
 
159
        </item>
 
160
        <item>Lophonetta</item>
 
161
        <item>Speculanas</item>
 
162
      </item>
 
163
      <item>
 
164
        Anthyinae (diving ducks)
 
165
        <item>Aythya</item>
 
166
        <item>Netta</item>
 
167
      </item>
 
168
      <item>Dendrocygninae (whistling ducks)</item>
 
169
    </tree>
 
170
  </example>
 
171
</section>
 
172
<!-- END examples -->
 
173
 
 
174
 
 
175
<!-- BEGIN processing -->
 
176
<section id="processing">
 
177
  <title>Processing Expectations</title>
 
178
 
 
179
  <p>Tree lists are display as block elements.  Each child <code>item</code>
 
180
  has its leading inline content displayed in a single block and any nested
 
181
  <code>item</code> elements displayed as blocks in turn.  Successive levels
 
182
  of nesting should yield more indentation, though this may vary based on
 
183
  style hints or other factors.  By default, there should be little vertical
 
184
  spacing between items; trees are compact.  No bullets, icons, or other marks
 
185
  are expected to precede items, although they may be used for certain style
 
186
  hints.</p>
 
187
</section>
 
188
<!-- END processing -->
 
189
 
 
190
</page>