Product SiteDocumentation Site

3.3.2. Docbook XML elements

This chapter is gathering some basic of DocBook element and explaining how to use them into serna-free and how it is encoded into DocBook XML.
In serna-free, the contextual menu can be activated on both right and left panels. It will gives you the access to every possibilities given during the edition of your document. When a text is selected, it is possible to 'tag' the selected text and insert it into an XML element.
Highlighting words
A word could be highlighted using emphasis: Bold, italic, underline
To do so, select the text to highlight into the editing pane and click on the button of the tool-bar. The document will be modified as in the screen-shot below (Bold in bold, Italic in italic and underline underlined):
This is a graphical view of the underlaying XML which is in reality:
<para>A word could be highlighted using enphsis: <emphasis role="bold">Bold</emphasis>, <emphasis role="italic">italic</emphasis>, <emphasis role="underline">underline</emphasis></para>
A word could also represent a filename, an application, a command, a code, a phrase, a classname... There are a lot of possibility offered by the DocBook reference. To highlight a specific word or phrase, you should select it and from the contextual menu select Wrap Info Element
Images
Image are specific object and have to be inserted as <mediaobject> or <inlinemediaobject> composed by an <imageobject> composed by and <imagedata>.
The <imagedata> element contains attributes visible using the context menu Element Attributes...
The image to display is defined by the attribute fileref. You can use the little yellow folder in the bottom left to browse the image to insert.
The underlying XML code looks like that:
      <mediaobject>
        <imageobject>
          <imagedata align="center" fileref="images/MediaObject.png"/>
        </imageobject>
      </mediaobject>
Lists
Two kinds of lists exist: <itemizedlist> and <orderedlist>. In the first list, each item is preceded by a bullet. In the ordered list, each item is preceded by a number (incremental).
The elements <itemizedlist> and <orderedlist> represent the entry point of the list. These elements are composed by a list of <listitem> containing the data to display a <para> like in the example bellow:
The underlying XML code looks like that:
    <itemizedlist>
      <listitem>
        <para>Introduction stored into the file <filename>Section-Introduction.xml</filename></para>
      </listitem>
      <listitem>
        <para>Installation stored into the file <filename>Section-Installation.xml</filename></para>
      </listitem>
      <listitem>
        <para>Redaction stored into the file <filename>Section-Redaction.xml</filename></para>
      </listitem>
      <listitem>
        <para>Publication stored into the file <filename>Section-Publication.xml</filename></para>
      </listitem>
    </itemizedlist>
In this document we only used <itemizedlist>. Creating a sub-listing can be done by inserting an <itemizedlist> or <orderedlist> inside a <listitem>.
Program listing
The element <programlisting> allow to insert pieces of code inside a document. publican as the capability to highlight the code to make it easier to read. To perform the correct highlighting, it is mandatory to define the language of the code. This language will be defined into the attribute language of the element. The list of supported language is available into the following page:
The first column list represent the text to add into the attribute.
To go further
Video how to use serna are available at
Information about how to write a clean docbook article are available at