Abstract
This miniguide should be the first help for people with no experience in DocBook to write simple DocBook documents.
This miniguide provides some small sample DocBook XML files which uses the most used tags within DocBook documents.
Writing DocBook XML files could be done simply with normal text editor programs. Writing an XML file is nearly the same as writing a plain[1] HTML file.
![]() | Note |
---|---|
So everyone who has ever written a plain HTML file, should be familar with XML at once. The only difference of course is, that with DocBook XML we have different tags. |
In HTML you write the following:
<p>This is a simple paragraph</p>
In DocBook it looks like the following:
<para>This is a simple paragraph</para>
Or an example for a list:
<ul> <li>something here</li> <li>and here</li> </ul>
in DocBook (ok, it looks a little more complicated than in HTML):
<itemizedlist> <listitem><para>something here</para></listitem> <listitem><para>and here</para></listitem> </itemizedlist>
The DocBook DTD (Document Type Definition) declares only the allowed tags, and where they can occur. The same is true for XHMTL by the way (it's only a different DTD).
The idea of DocBook, and of XML in general, is to assign your content with more specific information, which leads to an abstraction between data (content) and layout (how it is shown)
You don't mark your documents in this way (shown in a XML syntax):
This is my program <b>c:program Files/myProgram.exe</b> and this is my database <em>MyDatabase</em> and this is the author: <b>Billy the Gates</b>.
but in this way:
This is my program <filename>c:program Files/myProgram.exe</filename> and this is my database <database>MyDatabase</database> and this is the author <author><firstname>Billy</firstname><surname>the Gates</surname></author>
This approach allows you to concentrate on the content, and to control the layout with a global customization layer. So you decide later how the information should be shown to the reader.