This pretty much summarises my experience of trying to get started writing in DocBook. A lot of the documentation to do with DocBook on the web is written in DocBook and the various DocBook web pages link to each other. Pretty soon I got rather lost.
This document is a getting started beginner guide to DocBook specifically for those using Red Hat Linux 7.0. Unlike other DocBook documents it is refreshingly written in plain old HTML. It is also meant for those that want to use the RPM package management system as much as possible. The version of DocBook supplied with Red Hat Linux 7.0 is DocBook 3.1.
The document covers making an SGML source file and viewing it in HTML, PDF, Postscript and RTF document formats.
/usr/lib/sgml/stylesheets/nwalsh-modular/html/dbtitle.dslThe file converts DocBook section headings into hypertext <H1> <H2> <H3> <H4> <H5> tags as appropriate. If you wanted to change the appearance of the headings in the hypertext output, you would edit this file.
This package also contains the magical scripts which we will use later. They are db2dvi, db2html, db2pdf, db2ps and db2rtf.
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> <article lang="en"> <artheader> <title>This is a Test</title> <author> <firstname>John</firstname> <surname>Doe</surname> <othername role="mi">L</othername> <affiliation> <address> <email>j.doe@jdoe dot com</email> </address> </affiliation> </author> <revhistory> <revision> <revnumber>v1.0</revnumber> <date>2000-12-30</date> <authorinitials>jld</authorinitials> </revision> </revhistory> <abstract> <para> This is a test DocBook document. </para> </abstract> </artheader> <sect1 id="test1"> <title>Test 1</title> <para> Test section 1. </para> <sect2> <title>Test 1.1</title> <para> Test section 1.1 </para> </sect2> <sect2> <title>Test 1.2</title> <para> <screen> -- Test section 1.2 openjade -t sgml -d $DSLFILE test.sgml </screen> </para> </sect2> </sect1> <sect1 id="test2"> <title>Test 2</title> <para> Test section 2. </para> <sect2> <title>Test 2.1</title> <para> Test section 2.1 </para> </sect2> <sect2> <title>Test 2.2</title> <para> Test section 2.2 </para> </sect2> </sect1> </article>
db2dvi myfile.sgml
xdvi myfile.dvi
db2html myfile.sgmlThis will make a folder called 'myfile' with HTML files in it. Here is the output viewed with Netscape:
db2pdf myfile.sgmlTo view the output use this command:
ghostview myfile.pdf
db2ps myfile.sgmlThis will produce DVI output in PostScript document text format.
db2rtf myfile.sgmlThis will produce Rich Text Format output which can be viewed in any word processor. This is what it looks like in AbiWord.