Element Reference

The following is a short and incomplete guide to the most commonly used AlcoveBook elements. For further reference, see the AlcoveBook DTD.

Article header elements

Any AlcoveBook "article" should include an article header. The article header contains information such as the article title, author, revision history, abstract, and so forth. The order of appearance of elements is not important, but some elements must appear exactly once (title, subtitle, date, revhistory), some must not appear more than once (abstract, invpartnumber), and all others, when appearing more than once, must be grouped together (eg. you can't insert a corpauthor between two author elements).

Legal and corporate informations

Marking up text

The following elements can be used in a text paragraph in order to mark up in a specific way a part of text:

Marking up code, filenames, commands, and the like

If you're doing computer-related documentation or writing, chances are that you're going to have to use code samples, filenames, commands, and other computer-centric things in your document. AlcoveBook, being designed for doing technical documentation, provides tags for marking each of these up as a specific type of element.

Code samples

When you want to include a multiple-line code example in your document, you should use the programlisting tag included in a example element. You may use example since it allows you to name every example of your document, which can be useful to produce a table of examples, or to have a stylesheet render reference to examples using this name.

	    
<section>
  <title>Your first C program</title>
  <para>
    You will write a Hello World! program for your first C lesson:
  </para>
  <example>
    <title>Hello.c</title>
    <programlisting>
      #include &lt;stdio.h&gt;
      int 
      main (int argc, char ** argv)
      {
        printf("Hello world!\n");
      }
    </programlisting>
  </example>
</section>
	  

If you want not to mess too much with your example's content, because of the presence of characters that are special to SGML (eg. SGML, XML, or HTML examples, or even C programs), you have to use a special bit of markup that tells the parser to ignore any tags it contains. This special bit of markup is a CDATA marker, the beginning of which appears directly after the programlisting start tag, and which ends just before the programlisting end tag:

<para>
  <programlisting>
  <![CDATA[
    <html>
      <head>
        <title>Web Page Title</title>
      </head>

      <body bgcolor="#ffffff">
        Web Page Content
      </body>
    </html>
    
  ]]>
  
  </programlisting>
</para>
	  

Note that the beginning of the CDATA marker is "<![CDATA[", and the end of the CDATA marker is "]]>". Any markup contained between the beginning and end bits of a CDATA marker will be ignored by the processing tools and treated as if it were just part of the regular text.

The downside of this is that you can't use, say, tags like function, varname, classname, etc., that could have been used to pretty-print your example, or footnotes, or any other things that would have been useful. An automatic pretty-printer for examples will probably be provided in the future, but you'll have to do things by hand if you want to do sophisticated things. You may want to use a callout where you would have used footnotes.

Marking up lists, tables, figures

Using external files

It is quite handy to insert external files in a SGML document (i.e. to split a document into as many files as chapters or to insert an exemple rather than using pasting it into the document). Two methods can be used:

Including an image of the text

This is done by defining an imagedata element (the Section called Figures), i.e. in a mediaobject context. Its format attribute must be specified as linespecific. This solution allows to included documents without SGML transformation of the included document (ie. an image of the file, which can be seen as an image encoded in ASCII instead of a bitmap format). But it is a DocBook feature, not an SGML feature like general entities.