Free tutorials for Java, Eclipse and Web programming



Follow me on twitter

4. Docbook examples

The following is an overview of useful Docbook tags.

4.1. Tags

Table 1. Important Docbook tags

TagExplanation
<![CDATA[ SPECIAL_SIGN_HERE,e.g. & ]]> Allows to enter special signs into the text which would be otherwise intepreted by DocBook
<programlisting> </programlisting> Highlights the text as coding.
<emphasis> </emphasis> Highlights the text
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="example1.txt" /> Includes example1.xml as text, so the file can contain tag, etc.
<ulink url="http://www.heise.de/newsticker">German IT News</ulink>. Paste a hypertext link into the the document.
&amp; & Creates the & sign. Can for example be used in links.

4.2. Tables

You can create an table like this:

				
<table frame='all'>
	<title>Sample Table</title>
	<tgroup cols='2' align='left' colsep='1' rowsep='1'>
		<colspec colname='c1' />
		<colspec colname='c2' />
		<thead>
			<row>
				<entry>a4</entry>
				<entry>a5</entry>
			</row>
		</thead>
		<tfoot>
			<row>
				<entry>f4</entry>
				<entry>f5</entry>
			</row>
		</tfoot>
		<tbody>
			<row>
				<entry>b1</entry>
				<entry>b2</entry>
			</row>
			<row>
				<entry>d1</entry>
				<entry>d5</entry>
			</row>
		</tbody>
	</tgroup>
</table>
			

The output look then like this:

Table 2. Sample Table

a4a5
f4f5
b1b2
d1d5

4.3. Lists

You can create non-numbered lists like this:

				
<itemizedlist>
	<listitem>
		<para>Item1</para>
	</listitem>
	<listitem>
		<para>Item2</para>
	</listitem>
	<listitem>
		<para>Item3</para>
	</listitem>
	<listitem>
		<para>Item4</para>
	</listitem>
</itemizedlist>
			

The output look then like this:

  1. This is a list entry

  2. This is another list entry

You can create non-numbered lists like this:

				
<orderedlist>
	<listitem> 
	<para>This is a list entry</para>
	</listitem>
	<listitem>
	<para>This is another list entry</para>
	</listitem>
</orderedlist>

			

The output look then like this:

  • Item1

  • Item2

  • Item3

  • Item4

4.4. Links

You can create links like this

			
<para>
	We use the Ant integrated into Eclipse. See
	<ulink url="http://www.vogella.de/articles/ApacheAnt/article.html"> Apache Ant Tutorial</ulink>
	for an introduction into Apache Ant.
</para>
		

4.5. Including images

You can include graphics via the following tag

			
<para>
	<mediaobject>
		<imageobject>
			<imagedata fileref="images/antview10.gif" format="gif">
			</imagedata>
		</imageobject>
	</mediaobject>
</para>