Added <description> element for description lists
authorarjen <arjen>
Tue, 19 Aug 2003 06:34:43 +0000 (06:34 +0000)
committerarjen <arjen>
Tue, 19 Aug 2003 06:34:43 +0000 (06:34 +0000)
Added table example

doc/block.xml

index 36a593e..b102fed 100644 (file)
@@ -5,7 +5,7 @@
 <!--
       XML documentation system
       Original author :  Arjen Baart - arjen@andromeda.nl
-      Version         : $Revision: 1.1 $
+      Version         : $Revision: 1.2 $
 -->
 
 <chapter>
@@ -87,7 +87,7 @@ Which comes out like this:
 </section>
 
 <section>
-<heading>Footnotes</heading>
+<heading><label name='footnote'/>Footnotes</heading>
 <para>
 Footnotes are created with the <strong>footnote</strong> element:
 <footnote>This is an example of a footnote</footnote>
@@ -111,17 +111,18 @@ running text referring to that footnote.
 </section>
 
 <section>
-<heading>Lists</heading>
+<heading><label name='list'/>Lists</heading>
 <para>
-Two types of lists<footnote>A description list is not implemented yet</footnote> are supported:
+Three types of lists are supported:
 <itemize>
 <item><code>itemize</code> for bulleted lists such as this one.</item>
 <item><code>enumerate</code> for numbered lists.</item>
+<item><code>description</code> for tagged lists.</item>
 </itemize>
 
-Each item in such a list must be in an <strong>item</strong> element.
-In fact, an <strong>item</strong> is the only element allowed in an
-<strong>itemize</strong> or <strong>enumerate</strong> element.
+Each item in such a list must be in an <code>item</code> element.
+In fact, an <code>item</code> is the only element allowed in an
+<code>itemize</code>, <code>enumerate</code> or <code>description</code> element.
 You should not put ordinary text or any other element in a list without
 enclosing them in <code>&lt;item&gt;</code> and <code>&lt;/item&gt;</code>.
 Here is an example of a numbered list:
@@ -139,16 +140,39 @@ Here is an example of a numbered list:
 And this is what the list turns into:
 
 <enumerate>
-   <item>First you need an enumerate or itemize tag.</item>
+   <item>First you need an enumerate, itemize or description tag.</item>
    <item>Second, include one or more item elements.</item>
    <item>Finally, put the content inside the items.</item>
 </enumerate>
 
+In a description list, you make your own tags for each item instead
+of the automatically generated bullts or numbers.
+The tags for each item go in the <code>tag</code> attribute of the
+<code>item</code> element.
+So, repeating the above list as a description list:
+
+<verbatim>
+&lt;description&gt;
+   &lt;item tag='itemize'&gt; for bulleted lists such as this one.&lt;/item&gt;
+   &lt;item tag='enumerate'&gt; for numbered lists.&lt;/item&gt;
+   &lt;item tag='description'&gt; for tagged lists.&lt;/item&gt;
+&lt;/description&gt;
+</verbatim>
+
+Which creates the following output:
+
+<description>
+<item tag='itemize'> for bulleted lists.</item>
+<item tag='enumerate'> for numbered lists.</item>
+<item tag='description'> for tagged lists such as this one.</item>
+</description>
+
+An item can contain inline content as well as block-level content.
 </para>
 </section>
 
 <section>
-<heading>Including graphics</heading>
+<heading><label name='graphics'/>Including graphics</heading>
 <para>
 The empty element <strong>picture</strong> is used to include
 graphics in your document, like this:
@@ -162,20 +186,41 @@ The two attributes are used in either HTML or LaTeX.
 </section>
 
 <section>
-<heading>Tables</heading>
+<heading><label name='table'/>Tables</heading>
 <para>
 Creating tables in XMLDoc is much like creating tables in HTML.
-First, there is the <strong>table</strong> element.
-The <strong>table</strong> element may contain any number of
-<strong>row</strong> elements, which may in turn contain any number
-of <strong>col</strong> elements.
-The <strong>col</strong> elements hold the actual content of
-the table, which must be inline content (see next chapter).
-To use the tables in LaTeX, you must supply a <strong>cpos</strong>
-attribute in the <strong>table</strong> tag.
-<para>
-<emph>...tune in next week for a table example...</emph>
+First, there is the <code>table</code> element.
+The <code>table</code> element may contain an optional <code>thead</code>
+and any number of <code>row</code> elements.
+Both the <code>thead</code> and the <code>row</code> elements must contain
+one or more <code>col</code> elements.
+The <code>col</code> elements hold the actual content of
+the table, which must be inline content (see next chapter) or block content.
+To use the tables in LaTeX, you must supply a <code>cpos</code>
+attribute in the <code>table</code> tag.
 </para>
+
+<para>
+An example of a table is shown below:
+
+<verbatim>
+
+&lt;table cpos='lr'&gt;
+  &lt;thead&gt;&lt;col&gt;Drink   &lt;/col&gt;&lt;col&gt;Price&lt;/col&gt;&lt;/thead&gt;
+  &lt;row&gt;&lt;col&gt;Beer      &lt;/col&gt;&lt;col&gt; 1.80&lt;/col&gt;&lt;/row&gt;
+  &lt;row&gt;&lt;col&gt;Wiskey    &lt;/col&gt;&lt;col&gt; 3.50&lt;/col&gt;&lt;/row&gt;
+  &lt;row&gt;&lt;col&gt;Wine      &lt;/col&gt;&lt;col&gt; 2.20&lt;/col&gt;&lt;/row&gt;
+&lt;/table>
+
+</verbatim>
+
+<table cpos='lr'>
+  <thead><col>Drink   </col><col>Price</col></thead>
+  <row><col>Beer      </col><col> 1.80</col></row>
+  <row><col>Wiskey    </col><col> 3.50</col></row>
+  <row><col>Wine      </col><col> 2.20</col></row>
+</table>
+
 </para>
 </section>