Getting Started With DocBook on OpenOffice.
Who is this Guide intended for?
This guide is intended to be a starting point for somebody who wishes to use OpenOffice.org to produce and edit DocBook documents. It does not cover all of the functionality that is currently supported by the DocBook filter, but instead covers a few of the more frequently used operations that are necessary to commence using OpenOffice.org to edit and create DocBook files.
Before you Begin
A template that supplies all of the custom styles that are currently supported is available for download here. Load the DocBookTemplate.stw Template so that the required Docbook specific styles are available.Display the Style list by pressing F11. Now choose 'All Styles', so that all available styles are displayed.
Navigating through a Document
If you wish to see how sections are nested, use the F5 key to Display the Navigator window. Expand the sections tag, to display the layout of the sections within the document. You can skip to the start of a given section, by double-clicking on it.
Setting the Document Title.
Skip to the ArticleInfo Section by double clicking on it in the Navigator window. Select the 'Document Title' style from the stylelist and then type the Document Title. This Document Title will become the articleinfo title element, when the document is saved as DocBook.
Creating Sect1, Sect2,Sect3
To insert a section, select Insert->Section from the menu bar. Give the section a name and click Insert. The new section will now be displayed. The name you give the section will become the Section id in the produced Docbook document. To add a Section Title, select either Section Title or one of the Section# Title styles from the style list. When the final Docbook document is created, the Section Title will be translated into a 'Title' tag within that section.
While typing, if you wish to escape the current section type ALT+Return at the end of the Section.
Adding a table
To add a table, select Insert->Table from the menu bar. You can set the tables properties using the Insert Table dialog. When this is complete, click OK. The Name will become the id attribute of the Docbook table.
To give the table a Title in order to make it a Formal table, right click on the Displayed table, and select Caption. The caption will become the Table title.
Alternative Character Styles
Docbook allows paragraphs to contain many different types of formatted text (Emphasis, Sub Script, SuperScript, Filename, command etc.). To apply these styles to a piece of text, do the following.
Select the text you wish to modify.
On the StyleList, select the Character styles icon so that the Character style list is displayed.
Select the character style that you wish to apply to selected text.
Saving to DocBook
To Save your file to the DocBook format, select File->Save As from the menu. In the Save As Type selection box, select DocBook (.xml). When the Save button is pressed, the file will be saved in the DocBook format.
Sample Output
Below is a sample of the output that would be produced by the DocBook filter.
<?xml version="1.0" encoding="UTF-8"?>
<article lang="en-US">
<articleinfo>
<title>My Document Title</title>
<subtitle>My Document Subtitle</subtitle>
<edition />
</articleinfo>
<sect1 id="Sect1">
<title>Section1 title </title>
<para>Some random text</para>
<sect2 id="Sect2">
<title>Section 2 Title</title>
<para>Some more Text with
<emphasis>emphasis</emphasis>
</para>
<table frame="all" id="myTable">
<title>My table Name</title>
<tgroup cols="6">
<colspec colnum="1" colname="c1" />
<colspec colnum="2" colname="c2" />
<colspec colnum="3" colname="c3" />
<colspec colnum="4" colname="c4" />
<colspec colnum="5" colname="c5" />
<colspec colnum="6" colname="c6" />
<thead>
<row>
<entry>
<para>Header</para>
</entry>
<entry>
<para>Rows</para>
</entry>
<entry>
<para />
</entry>
<entry>
<para />
</entry>
<entry>
<para />
</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<para />
</entry>
<entry>
<para>Content </para>
</entry>
<entry>
<para>Rows</para>
</entry>
<entry>
<para />
</entry>
<entry>
<para />
</entry>
</row>
</tbody>
</tgroup>
</table>
<para />
</sect2>
</sect1>
</article>