summaryrefslogtreecommitdiff
path: root/doc/mallard/C/mal_block_list.xml
blob: 2db6b8ac563adf4ed4474c798aec39ce301d57aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<page xmlns="http://www.gnome.org/~shaunm/mallard"
      type="topic"
      id="mal_block_list">

<info>
  <version number="0.1" date="2009-05-22" 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 a basic bulleted or numbered list.</desc>
</info>

<title>Basic Lists</title>

<synopsis><code mime="application/relax-ng-compact-syntax">
mal_block_list = element list {
  attribute type { xsl:NMTOKEN } ?,
  attribute style { xsd:NMTOKENS } ?,
  attribute * - (mal:* | local:*) { text } *,

  <link xref="mal_block_title">mal_block_title</link> ?,

  element item {
    attribute style { xsd:NMTOKENS } ?,
    attribute * - (mal:* | local:*) { text } *,

    <link xref="mal_block">mal_block</link> +
  } +
}
</code></synopsis>

<p>Use the <code>list</code> element to create a basic bulleted or numbered
list.  By default, lists are unordered, and list items are marked with a
bullet or other glyph.  You can select various numbering systems using the
<code>type</code> attribute.  If you need a numbered list to enumerate steps
the reader should perform, use the <code xref="mal_block_steps">steps</code>
element.</p>


<!-- BEGIN notes -->
<section id="notes">
  <title>Notes</title>
  <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 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
    <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>type</code> attribute allows you to select the list type,
    which affects the markers used for each list item.  Allowed values are those
    from the <link href="http://www.w3.org/TR/css3-lists/">CSS
    <code>list-style-type</code> property</link>.  Additionally, the value of
    <code>"numbered"</code> can be used to select a numbered list type appropriate
    for the page's language.</p></item>

    <item><p>If no <code>type</code> attribute is present, it is assumed to be a
    <link href="http://www.w3.org/TR/css3-lists/#glyphs">glyph type</link> such
    as <code>"disc"</code> or <code>"circle"</code>.  That is, lists default to
    bulleted lists.</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 <code>list</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">
  <title>Examples</title>

  <p>Create a basic unordered list:</p>

  <example>
    <code><![CDATA[
<list>
  <item><p><code>GTK_MESSAGE_INFO</code></p></item>
  <item><p><code>GTK_MESSAGE_WARNING</code></p></item>
  <item><p><code>GTK_MESSAGE_QUESTION</code></p></item>
  <item><p><code>GTK_MESSAGE_ERROR</code></p></item>
  <item><p><code>GTK_MESSAGE_OTHER</code></p></item>
</list>
]]></code>
    <list>
      <item><p><code>GTK_MESSAGE_INFO</code></p></item>
      <item><p><code>GTK_MESSAGE_WARNING</code></p></item>
      <item><p><code>GTK_MESSAGE_QUESTION</code></p></item>
      <item><p><code>GTK_MESSAGE_ERROR</code></p></item>
      <item><p><code>GTK_MESSAGE_OTHER</code></p></item>
    </list>
  </example>

  <p>Create an unordered list with a title:</p>

  <example>
    <code><![CDATA[
<list>
  <title>Message Types</title>
  <item><p><code>GTK_MESSAGE_INFO</code></p></item>
  <item><p><code>GTK_MESSAGE_WARNING</code></p></item>
  <item><p><code>GTK_MESSAGE_QUESTION</code></p></item>
  <item><p><code>GTK_MESSAGE_ERROR</code></p></item>
  <item><p><code>GTK_MESSAGE_OTHER</code></p></item>
</list>
]]></code>
    <list>
      <title>Message Types</title>
      <item><p><code>GTK_MESSAGE_INFO</code></p></item>
      <item><p><code>GTK_MESSAGE_WARNING</code></p></item>
      <item><p><code>GTK_MESSAGE_QUESTION</code></p></item>
      <item><p><code>GTK_MESSAGE_ERROR</code></p></item>
      <item><p><code>GTK_MESSAGE_OTHER</code></p></item>
    </list>
  </example>

  <p>Create a simple numbered list:</p>

  <example>
    <code><![CDATA[
<list type="numbered">
  <item><p>First</p></item>
  <item><p>Second</p></item>
  <item><p>Third</p></item>
</list>
]]></code>
    <list type="numbered">
      <item><p>First</p></item>
      <item><p>Second</p></item>
      <item><p>Third</p></item>
    </list>
  </example>

  <p>Create a numbered list with Roman numerals:</p>

  <example>
    <code><![CDATA[
<list type="upper-roman">
  <item><p>First</p></item>
  <item><p>Second</p></item>
  <item><p>Third</p></item>
</list>
]]></code>
    <list type="upper-roman">
      <item><p>First</p></item>
      <item><p>Second</p></item>
      <item><p>Third</p></item>
    </list>
  </example>
</section>
<!-- END examples -->


<!-- BEGIN processing -->
<section id="processing">
  <title>Processing Expectations</title>

  <p>Lists are displayed as block elements, with each child <code>item</code>
  displayed as a list item.  When present, the title should be displayed in a
  way that makes it clear that it is the title of the list.  List items are
  interpreted in the same way as <code>li</code> elements in HTML, except that
  the <code>item</code> element only allows block-level child content.</p>

  <p>Item markers are taken from the <code>type</code> attribute, which is
  either a valid value of the <link href="http://www.w3.org/TR/css3-lists/">CSS
  <code>list-style-type</code> property</link>, or the special value
  <code>"numbered"</code>.  When the <code>"numbered"</code> type is used, a
  numeric marker type is chosen that is appropriate for the language of the
  page.  The default numeric marker type per language may vary between
  implementations.</p>
</section>
<!-- END processing -->


<!-- BEGIN comparison -->
<section id="comparison">
  <title>Comparison to Other Formats</title>

  <p>The <code>list</code> element combines the functionality of the
  <code href="http://www.docbook.org/tdg/en/html/itemizedlist.html">itemizedlist</code>
  and <code href="http://www.docbook.org/tdg/en/html/orderedlist.html">orderedlist</code>
  elements in DocBook.  DocBook allows leading block-level content in its list
  elements.  This is not allowed in Mallard, though an optional <code>title</code>
  element is allowed.  DocBook allows you to override the bullet or numbering
  type on each list item.  Mallard does not allow this.</p>
</section>
<!-- END comparison -->

</page>