<!DOCTYPE article PUBLIC "-//OASIS//DTD docbook sgml V4.2//EN" 
                         "http://www.oasis-open.org/docbook/sgml/4.2/docbook.dtd" [

<!ENTITY license "
      <para>Permission is granted to copy, distribute and/or modify this
      document under the terms of the <ulink type='http'
      url='http://www.fsf.org/copyleft/fdl.html'><citetitle>GNU Free
      Documentation License</citetitle></ulink>, Version 1.1 or any later
      version published by the Free Software Foundation with no Invariant
      Sections, no Front-Cover Texts, and no Back-Cover Texts. You may
      obtain a copy of the <citetitle>GNU Free Documentation
      License</citetitle> from the Free Software Foundation by visiting
      <ulink url='http://www.fsf.org/'>their Web site</ulink>
      or by writing to: Free Software Foundation, Inc., 59 Temple Place -
      Suite 330, Boston, MA 02111-1307, USA.</para>

      <para>This manual contains short example programs (<quote>the
      Software</quote>). Permission is hereby granted, free of charge, to
      any person obtaining a copy of the Software, to deal in the Software
      without restriction, including without limitation the rights to use,
      copy, modify, merge, publish, distribute, sublicense, and/or sell
      copies of the Software, and to permit persons to whom the Software is
      furnished to do so, subject to the following condition:</para>

      <para>THE SOFTWARE IS PROVIDED <quote>AS IS</quote>, WITHOUT WARRANTY
      OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
      WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
      NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
      CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
      TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
      SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</para>
">


<!ENTITY legal.section "
  <section id='dbsgmlqs-1'>
    <title>Legal Notice</title>
    &license;
  </section>
">

]>

<!-- a test change for the cvs migration -->

<article id="dbsgml-quickstart">
  <title>Docbook SGML Quick Start</title>
  
  <articleinfo><title>Docbook SGML Quick Start</title>
    
    <pubdate>2002-11-27</pubdate>
    
    <authorgroup>
      <author>
    <firstname>Jim</firstname> 
    <surname>Weller</surname> 
    <affiliation> 
      <address><email>jim atat jimweller dot net</email></address>
    </affiliation> 
      </author>
    </authorgroup>
    
    <copyright>
      <year>2001-2002</year> 
      <holder>Jim Weller</holder>
    </copyright>
    
    <abstract>
      <para>Describes how to install, configure and use the tools and resources
      for docbook sgml and dsssl. The purpose of this quick start guide is to get new
      docbook authors, editors, and contributors up and running fast with the
      DoocBook sgml tools. It assumes a fair knowledge of building and installing
      source packages.</para>
    </abstract>
   
  </articleinfo>

  &legal.section;


  <section id="dbsgmlqs-2">
    <title>Introduction</title>


    <para>DocBook is a widely used DTD in SGML and XML that is tailored toward
    technical manuals. It's basically a way that authors can write a document
    once in markup and then, using processing tools, convert to many common
    formats (HTML, DOC, RTF, PDF, PostScript etc.). It is used on many projects
    as the main documentation system.</para>

    <para>I'm working on a HOWTO/book. These are my notes from my bout with 
    these tools and concepts. I had a difficult and frustrating time setting up 
    these tools at first. Plus, I couldn't find this document's working 
    equivalent. So, I truly hope this information will be helpful, but it is 
    provided without warranty or gaurantee. If you break anything you get to 
    keep both pieces.</para>

    <para>This guide tends toward brevity. Authors don't need to get mired in a 
    gajillion layers of DocBook complexity just to generate an articulate piece 
    of work. More simply: Get tools, write content and distribute.</para>

    <para>Please, note that I do not cover the installation or usage of some of 
    the 'fluffy' tools like docbook2X or sgml-tools. Nor do I make mention of 
    backends other than html and text. I leave it as an exercise for the reader 
    to generate different types of output (tex, pdf, etc.). This document is 
    intended to be a short path to writing and evaluating your documents.</para>

  </section>
  
  <section id="dbsgmlqs-3">
    <title>Requirements</title>

    <para>You'll have to download and install a number of
    packages. Most won't take much to install, but you should be
    familiar with installing GNU source packages.</para>

    <section> 
      <title>Basics</title>
      <para> You'll need a computer with the GNU development environment :) I 
      used linux. You can use another OS, but you'll have to interpolate as 
      necessary.</para>
    </section>   

    <section>
      <title>OpenJade</title>
      <itemizedlist>
    <listitem><para> OpenJade <ulink url="http://openjade.sourceforge.net">http://openjade.sourceforge.net</ulink></para></listitem> 
      </itemizedlist>
      <para> You'll need to download a recent version of the openjade suite. 
   OpenJade is a program implementing the ISO/IEC 10179:1996 standard DSSSL 
   language. </para>
    </section>

    <section>
      <title>DocBook DTD</title>
      <itemizedlist>
    
    <listitem><para> 
   sgml  4.2
   <ulink url="http://www.oasis-open.org/docbook/sgml/4.2/index.shtml">http://www.oasis-open.org/docbook/sgml/4.2/index.shtml</ulink>
   </para></listitem> 
      </itemizedlist>
      
      <para>
    You'll need to get the zip archive from the site listed above. DTD
    stands for Document Type Definition. This from Oasis:

    <blockquote>
      <para>
    DocBook is a DTD maintained by the DocBook Technical Committee of
    OASIS. It is particularly well suited to books and papers about
    computer hardware and software (though it is by no means limited to
    these applications).
    </para>
    </blockquote>
   </para>
    </section>


    <section>
      <title>ISO8879 Entities</title>
      <itemizedlist>
      <listitem><para>ISOEnts.zip <ulink url="http://www.oasis-open.org/cover/ISOEnts.zip">http://www.oasis-open.org/cover/ISOEnts.zip</ulink>
      </para></listitem> 
      </itemizedlist>

      <para>You'll need to get ISOEnts.zip. These are all the symbol entities 
      (e.g. &copy;,&reg; and <emphasis>lots</emphasis> more). You can read about 
      these at the <ulink url="http://www.oasis-open.org/cover/topics.html#entities">SGML/sgml Entity Sets and Entity 
      Management</ulink> site. If you understand all that, you probably don't 
      need this guide ;-)</para>

    </section>

    <section>
      <title>DocBook Style Sheets</title>

      <itemizedlist>
    <listitem><para> 
    DocBook DSSSL Stylesheets<ulink url="http://docbook.sourceforge.net/projects/dsssl/">http://docbook.sourceforge.net/projects/dsssl/</ulink>
   </para></listitem> 
    <listitem><para> 
   The LDP Customized Stylesheet <ulink url="http://tldp.org/authors/tools/ldp.dsl">http://tldp.org/authors/tools/ldp.dsl</ulink>
   </para></listitem> 
      </itemizedlist>
      
      <para>You'll need to download the nwalsh style sheets. You can get by with 
      just that, but the LDP ones have some nice extensions.  From Norman 
      Walsh's docbook site:

    <blockquote>
      <para> DSSSL is a stylesheet language for both print and online rendering. 
      The acronym stands for Document Style Semantics and Specification 
      Language. It is defined by ISO/IEC 10179:1996. </para>
    </blockquote>
   </para>
    </section>
  </section><!-- ends requirements -->

  <section id="dbsgmlqs-4">
    <title>Installation and Configuration</title>

    <para>Setting up the tools was the hard the first time. The maze of 
    catalogs, programs and acronyms is daunting to the first time (even 
    technically minded) user. I couldn't tell what I needed. Never mind the 
    miles of error message these tools generate by default. But this method is 
    quick and painless</para>
    
    <section>
      <title>Ground work</title>
      <para>
  First setup some handy environmental variables.
  </para>
      <screen>
export DBARCHIVE=/where/you/put/your/downloads
export SGMLHOME=/where/you/want/to/install/everything
      </screen>
    </section>

    <section>
      <title>OpenJade</title>
      <para> The only package that requires compiling is openjade. Openjade is a 
      reasonable GNU autotools source build. Be sure to add openjade's lib 
      directory to your library search path ($LD_LIBRARY_PATH or ld.so.conf on 
      Linux). Also be sure to add openjade's bin directory to your PATH. Note 
      that you have to manually copy the dsssl subdirectory as openjade's 
      install doesn't do it for you. </para>

      <screen>
cd /where/you/compile/source
tar -xzf $DBARCHIVE/openjade-1.3.1.tar.gz
cd openjade-1.3.1
./configure --prefix=$SGMLHOME/openjade-1.3 --enable-http &amp;&amp; make &amp;&amp; make install
cp -a dsssl $SGMLHOME/openjade-1.3.1
    </screen>


    </section>
    
    <section>
      <title>DocBook DTDs and Entities</title> 

      <para> Next, you'll need to unpack all the DocTools DTDs and entities. The 
      entities should be renamed to end in '.gml' . You can rename them by hand 
      or try my one line bash script.</para>

      <screen>
cd $SGMLHOME
mkdir dtd
cd dtd
unzip -a $DBARCHIVE/docbook-sgml-4.2.zip
unzip -a $DBARCHIVE/ISOEnts.zip
for i in ISO*;do mv $i `echo $i | sed -e 's/ISO/iso-/g'`.gml;done
    </screen>
    </section>
    
    <section>
      <title>Norm Walsh's and LDP's Style Sheets</title>
      <para> Now, we're ready to unpack Norm Walsh's and the LDP's Styles 
      Sheets.</para>
      
      <screen>
    
cd $SGMLHOME
tar -xzf $DBARCHIVE/docbook-dsssl-1.77.tar.gz
mv docbook-dsssl-1.77 dsssl
cd dsssl

cp $DBARCHIVE/ldp.dsl html/
cp $DBARCHIVE/ldp.dsl print/

    </screen>
    </section>
    
    <section>
      <title>Configuration</title>
      <para> Finally, we need to setup our SGML_CATALOG_FILES evironment 
      variable. This variable is a colon seperated list of files that openjade 
      will use to find 'stuff'.  Once you get it set and working, I recommend 
      making this a permanent fixture in your environment (.bash_profile,.profile, 
       etc.).</para>
      
      <screen>
export SGML_CATALOG_FILES=$SGMLHOME/openjade-1.3.1/dsssl/catalog:$SGMLHOME/dtd/docbook.cat
      </screen>
      
    </section>
  </section>


  <section id="dbsgmlqs-5">
    <title>Using the Tools</title>
    <para>This is a terse introduction to using the DocBook tools to compile 
    sgml documents. I won't go into the details of DocBook mark up. See <ulink 
    url="http://docbook.org/tdg/en/html/docbook.html">DocBook: The Definitive 
    Guide</ulink> for complete information on writing DocBook markup.</para>
    
    
    <section>
      <title>A Simple docbook sgml document</title>
      
      <para> Below is an example of a very simple docbook sgml document; a book. 
      Copy it into a text file and we'll compile it into HTML and RTF in a 
      minute. </para>

      <para><ulink url="sample/test.sgml">test.sgml</ulink> [<ulink url="sample/test.sgml.txt">text</ulink>]</para>

      <!-- BEGIN SAMPLE DOCUMENT -->
      <programlisting>
<![CDATA[

<!DOCTYPE book PUBLIC "-//OASIS//DTD docbook sgml V4.2//EN" 
                         "http://www.oasis-open.org/docbook/sgml/4.2/docbook.dtd" 
[
 <!ENTITY version "0.01">
]>

<!-- 
Comments just like html
-->

<book>

  <bookinfo>
    <title>Simple XML Sample</title>
    <author>
      <firstname>John</firstname>
      <surname>Doe</surname>
    </author>
    <copyright><year>2002</year><holder>John Doe</holder></copyright>
    <legalnotice>
      <para>This legal mumbo jumbo will stop evil.</para>
    </legalnotice>
    <abstract>
      <para>This is Simple XML Sample version &version;. It is good for nothing but processing.</para>
    </abstract>
  </bookinfo>

  <chapter>
    <title>About this book</title> 
    <para>
      This book was not hard.
    </para>
    
    <section>
    <title>Copyrights and Trademarks</title>
    <para>Copyright &copy; 2002 John Doe</para>
    </section>

    <section><title>Purpose/Scope</title> 
    <para>This guide is tightly scoped with one purpose; to process.</para>
    </section>
  </chapter>

  <appendix><title>References</title>
    <para>Some Hoity Toity Person</para>
  </appendix>

</book>

]]>

</programlisting>
<!-- END SAMPLE DOCUMENT -->

    </section>

    <section>
      <title>Generating HTML and RTF</title>

      <para>You can see that DocBook markup is simple. Now let's compile this 
      test.sgml into linux doc project style HTML.</para>

      <screen>
openjade -t sgml -d $SGMLHOME/dsssl/html/ldp.dsl#html test.sgml
      </screen>

      <para>After, processing you should have the following (or similar) in the 
      folder with test.sgml. Look at <ulink url="sample/index.html">index.html</ulink> in a web browser.</para>

<screen>
a23.html  index.html  test.sgml  x20.html
c14.html  ln10.html   x17.html
</screen>


      <para>Try compiling RTF using the following. Examine <ulink url="sample/test.rtf">test.rtf</ulink> in your word processor.</para>
      <screen>
openjade -t rtf -d $SGMLHOME/dsssl/docbook/print/ldp.dsl#print test.sgml
</screen>

      <para>Here's a description of the command line switces:</para>
      <itemizedlist>
    <listitem><para> -t the backend to use (fot|rtf|tex|mif|sgml|xml)</para></listitem>
    <listitem><para> -d the style sheet to use </para></listitem>
      </itemizedlist>

      <para>That's all there is to it. Once you figure out TeX and RTF you can 
      convert to other popular document formats with other tools. You might use 
      TeX, LaTeX, PDF, PDB, or even some unmentioned proprietary formats and 
      tools. </para>
      
    </section>
  </section>

  <section id="dbsgmlqs-7">
    <title>References</title>
    <para>I glommed all this together from mailing lists and documents listed below.</para>

    <itemizedlist>
      <listitem><para><ulink url="http://www.tldp.org/">Linux Documentation Project</ulink></para></listitem>

      <listitem><para><ulink url="http://docbook.godoy.homeip.net:81/">Godoy's Docbook Page</ulink></para></listitem>

      <listitem><para><ulink url="http://www.linuxdoc.org/HOWTO/mini/DocBook-Install/">DocBook Install mini-HOWTO</ulink></para></listitem>

      <listitem><para><ulink url="http://docbook.org/tdg/en/html/docbook.html">DocBook: The Definitive Guide by Norman Walsh</ulink></para></listitem>

      <listitem><para><ulink url="http://adl.opengroup.org/exgr/papers/sgml_setup.html">Setup Instructions For A Coherent SGML/DocBook Environment</ulink></para></listitem>

      <listitem><para><ulink url="http://www.oasis-open.org/cover/walshSystemsIDsNewURL.html">Standard Deviations from Norm: If You Can Name It, You Can Claim It! (Norm Walsh article)</ulink></para></listitem>

      <listitem><para><ulink url="http://www-106.ibm.com/developerworks/library/l-docbk.html?dwzone=linux">A gentle guide to DocBook (IBM article)</ulink></para></listitem>

      <listitem><para><ulink url="http://linuxfocus.saneg.itu.edu.tr/English/May2000/article152.shtml">Making PDF documents with DocBook (An incredibly helpful article)</ulink></para></listitem>

      <listitem><para><ulink url="http://openjade.sourceforge.net">OpenJade home</ulink></para></listitem>
      <listitem><para><ulink url="http://www.oasis-open.org/docbook/">DocBook Technical Commitee</ulink></para></listitem>
      <listitem><para><ulink url="http://docbook.sourceforge.net">DocBook Home at Sourceforge</ulink></para></listitem>
      <listitem><para><ulink url="http://www.jimweller.net">Jim Weller's sleepless notes</ulink>
<itemizedlist>
        <listitem><para><ulink url="http://www.jimweller.net/article.php?sid=26">Title Bout: Jim v. Doctools</ulink></para></listitem>
        <listitem><para><ulink url="http://www.jimweller.net/article.php?sid=27">Using Doctools sgml</ulink></para></listitem>
      </itemizedlist>
</para></listitem>

    </itemizedlist>



  </section>


</article>


