This document is an example of a Docbook article, which uses sections to structure its contents. Alternatively, the top level element could be a book. Books contain chapters, which in turn contain sections as shown here. You can organise document content in multiple files, using the include tag extension.
For information about Docbook, including online books, visit the 'official home page'. For the full DocBook tagset, see DocBook: The Definitive Guide. As you can see, DocBook is very big, with many specialised tags. PracticalXML covers only the commonly used features.
<section id="sectionId"> <title>Section Title</title> <!-- section content comes here --> </section>
Note the xml comment tags. The section id attribute is optional. You can use it on any tag to provide a target for an internal link. Id attributes must be unique in a document. See Links below.
You can nest sections. There are tags to support nesting (sect1, sect2, sect3, etc), but they offer no advantage over plain section.
<para>Paragraph 1 content.</para> <para>Paragraph 2 content.</para>
Paragraph 1 content.
Paragraph 2 content.
Itemized (bullet) list:
<itemizedlist> <listitem>First item content.</listitem> <listitem>Second item content.</listitem> </itemizedlist>
Ordered (numbered) list:
<orderedlist> <listitem>First item content.</listitem> <listitem>Second item content.</listitem> </orderedlist>
Lists can be nested.
Table with title:
<table> <title>Table Title</title> <tgroup cols="2"> <colspec colwidth="30mm"/> <colspec colwidth="110mm"/> <thead> <row> <entry>column1 title</entry> <entry>column2 title</entry> </row> </thead> <tbody> <row> <entry>row1 column1 content</entry> <entry>row1 column2 content</entry> </row> <row> <entry>row2 column1 content</entry> <entry>row2 column2 content</entry> </row> </tbody> </tgroup> </table>
column1 title | column2 title |
---|---|
row1 column1 content | row1 column2 content |
row2 column1 content | row2 column2 content |
For a table without a title, use informaltable which is otherwise the same. Table formatting isn't well behaved - more work need to tame this!
<graphic fileref="../graphics/viewlog1.png"/>
Image size control needs further work. For now, included images should be scaled to fit using an external program (eg ImageMagick - see JS for advice on this).
Link to document on the Web:
For the full DocBook tagset, see <ulink url="http://www.docbook.org/tdg/en/html/docbook.html"> DocBook: The Definitive Guide</ulink>.For the full DocBook tagset, see DocBook: The Definitive Guide.
Link to an email address:
Author: <ulink url="mailto:john.storrs@ukaea.org.uk">John Storrs</ulink>.Author: John Storrs.
Link to another document on the local server:
Here is the <ulink url="../imports/style.css">style sheet</ulink> for this document.Here is the style sheet for this document.
Link to another part of this document:
This links to the <link linkend="sectionId">Sections</link> section above.This links to the Sections section above. The linkend references the id attribute of the target element. Id attributes must be unique in a document.
<screen> This is verbatim layout It is typeset in a fixed-width font. Spacing is preserved. </screen>results in
This is verbatim layout It is typeset in a fixed-width font. Spacing is preserved.If the verbatim content includes the special xml characters '<' or '>' (eg xml text or program code), it must be preceded by <![CDATA[ and followed by ]]>.