[project @ 2000-10-11 10:20:26 by rrt]
[ghc-hetmet.git] / docs / docbook-cheat-sheet.sgml
index 5462c11..c2a87f5 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE Article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
 
-<Article>
+<Article id="docbook-cheat-sheet">
 
 <ArtHeader>
 
 </ArtHeader>
 
 
-<Sect1><Title>Getting the DocBook tools</Title>
+<Sect1 id="sec-getting-docbook"><Title>Getting the DocBook tools</Title>
 
 <Para>
-See the building guide.
+See the installation guide.
 </Para>
 
 </Sect1>
 
 
-<Sect1><Title>Document layout</Title>
+<Sect1 id="doc-layout"><Title>Document layout</Title>
 
 <Para>
 The GHC documentation is written using DocBook 3.1, so the DTD line should be:
@@ -31,16 +31,41 @@ The GHC documentation is written using DocBook 3.1, so the DTD line should be:
 &lt;!DOCTYPE Article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"&gt;
 </Screen>
 
-<Para>
-This guide is <Emphasis>not</Emphasis> meant to teach you how to write DocBook; read the <ULink URL="http://www.docbook.org/">DocBook book</ULink> for that. It is more of a reference than a tutorial, so see the <ULink URL="http://www.oasis-open.org/docbook/">DocBook home page</ULink> for other links.
-</Para>
+<Para> This guide is <Emphasis>not</Emphasis> meant to teach you how to
+write DocBook; read the <ULink URL="http://www.docbook.org/">DocBook
+book</ULink> for that. It is more of a reference than a tutorial, so see the
+<ULink URL="http://www.oasis-open.org/docbook/">DocBook home page</ULink>
+for other links. </Para>
 
-<Para>
-The rest of this section outlines the use of several tags which may not be obvious (DocBook is rather scholastic in style: it has tags for many things from C function prototypes to keyboard bindings; at the same time it has many omissions and oddities). The current scheme has many infelicities, partly because it was dreamt up in a hurry while the author was learning DocBook and converting the documentation thereto, and partly because DocBook is rather C-centric.
+<Para> However, by popular demand, here are some useful points: </Para>
+
+<ItemizedList>
+<ListItem>
+<Para>Remember to use <SGMLTag class="StartTag">Para</SGMLTag> inside
+<SGMLTag class="StartTag">ListItem</SGMLTag>s.
 </Para>
+</ListItem>
+</ItemizedList>
+
+<Para> The rest of this section outlines the use of several tags which may
+not be obvious (DocBook is rather scholastic in style: it has tags for many
+things from C function prototypes to keyboard bindings; at the same time it
+has many omissions and oddities). The current scheme has many infelicities,
+partly because it was dreamt up in a hurry while the author was learning
+DocBook and converting the documentation thereto, and partly because DocBook
+is rather C-centric. </Para>
 
 <VariableList>
 
+<VarListEntry><Term>Comments</Term>
+<ListItem>
+<Para>
+Comments in SGML look like this: <SGMLTag class=SGMLComment>This is a
+comment</SGMLTag>.
+</Para>
+</ListItem>
+</VarListEntry>
+
 <VarListEntry><Term><SGMLTag class="StartTag">Command</SGMLTag></Term>
 <ListItem>
 <Para>
@@ -141,4 +166,43 @@ Used for variables, but not type variables.
 
 </Sect1>
 
+<Sect1 id="docbook-tables"><Title>Tables</Title>
+
+<Para>
+Tables are quite complicated to write in SGML (as in HTML, there are lots of fiddly tags), so here's an example you can cannibalise. In the spirit of the LaTeX short introduction I don't repeat all the markup verbatim; you have to look at the source for that.
+</Para>
+
+<Para>
+<InformalTable>
+<TGroup cols="3">
+<ColSpec Colname="one" Align="Left" Colsep="0">
+<ColSpec Colname="two" Align="Center" Colsep="0">
+<ColSpec Colname="three" Align="Right" Colsep="0">
+<TBody>
+
+<Row>
+<Entry>Here's</Entry>
+<Entry>a sample</Entry>
+<Entry>table</Entry>
+</Row>
+
+<Row>
+<Entry>With differently</Entry>
+<Entry>aligned</Entry>
+<Entry>cells</Entry>
+</Row>
+
+<Row>
+<Entry namest="one" nameend="three" morerows="1"><Para>
+There's not much else to it. Entries can span both extra rows and extra columns; just be careful when using block markup (such as <SGMLTag class="starttag">Para</SGMLTag>s) within an <SGMLTag class="starttag">Entry</SGMLTag> that there is no space between the open and close <SGMLTag class="starttag">Entry</SGMLTag> tags and the adjacent text, as otherwise you will suffer from <ULink URL="http://www.docbook.org/tdg/html/entry.html">Pernicious Mixed Content</ULink> (the parser will think you're using inline markup).</Para></Entry>
+</Row>
+
+</TBody>
+
+</TGroup>
+</InformalTable>
+</Para>
+
+</Sect1>
+
 </Article>