Chapter 9. Howto obtain this HOWTO ?

Table of Contents

9.1. HOWTO HOWTO
9.2. style.css file
9.3. Custom HTML output
9.4. Makefile

9.1. HOWTO HOWTO

That's a good question :). Create a directory and put all .xml files in it. install all needed program. doc-docbook.tar.bz2

9.2. style.css file

CSS style of our documentation.

a simple one


<style type="text/css">//<!--
.plop{ text-decoration : none}
a:link    {  color: #3868b8; text-decoration: none }
a:visited   {  color: #28649c; text-decoration: none}
body    { color : black; background-color: #f2f4ff}
table    { background-color: #e7e3e7;
          border: 0px;
          }
pre.programlisting {
  background-color: #e7e3e7 ;
  border: 1px solid black ;
}
pre.screen {
  background-color: #e7e3e7 ;
  border: 1px solid black ;
}
//-->
</style>

9.3. Custom HTML output

Write a simple .xsl file. with new xls parameter.

example.xsl file


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version='1.0'
                xmlns="http://www.w3.org/TR/xhtml1/transitional"
                exclude-result-prefixes="#default">
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets/xhtml/chunk.xsl"/>
<xsl:param name="chunk.section.depth" select="0"/>
<xsl:param name="html.ext" select="'.html'"/>
<xsl:param name="navig.graphics" select="0"/>
<xsl:param name="generate.chapter.toc" select="0"/>
<xsl:param name="toc.section.depth" select="3"/>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<xsl:param name="html.stylesheet.type">text/css</xsl:param>
<xsl:param name="html.stylesheet">style.css</xsl:param>
<xsl:param name="css.decoration">1</xsl:param>
<xsl:param name="callout.defaultcolumn" select="'60'"/>
<xsl:param name="callout.graphics" select="'1'"/>
<xsl:param name="callout.list.table" select="'1'"/>
<xsl:param name="callout.graphics.extension" select="'.gif'"/>
<xsl:param name="callout.graphics.path">images</xsl:param>
</xsl:stylesheet>

    

9.4. Makefile

Makefile to build this doocumentation


#--------- HTML TARGET ---------
WWW="$USER/doc-docbook/html"
WWW_PATH=html/
IMAGES=images

#-------- PDF TARGET --------------
DSL=/usr/share/sgml/docbook/utils-0.6.1?/docbook-utils.dsl
#CATALOG=/etc/sgml/xml-docbook-4.1.2.cat
CATALOG=/etc/sgml/catalog

#-------- ALL TARGETS --------------
BASE=creadocbook
XSL_FILE=${BASE}.xsl
XML_FILE=${BASE}.xml

#------------ MAIN ----------------
      all:clean prepare html_doc pdf_doc

prepare:
      mkdir -p ${WWW_PATH}${IMAGES}
      rm -rf ${WWW_PATH}*.html
      rm -rf ${WWW_PATH}${IMAGES}/*png

clean:
      rm -rf *log
      rm -rf ${BASE}.pdf ${BASE}.tex ${BASE}.fot
      rm -rf *~
      rm -rf ${IMAGES}/.xvpics
      pdf_doc:
      db2pdf -c ${CATALOG} -d ${DSL} ${XML_FILE} 2>&1

html_doc:
      xsltproc ${XSL_FILE} ${XML_FILE}
      mv -f *.html ${WWW_PATH}
      xsltproc one${BASE}.xsl ${XML_FILE}
      mv -f index.html ${WWW_PATH}/${BASE}.html
      cp -av ${IMAGES}/* ${WWW_PATH}/${IMAGES}
      cp -av *.xml ${WWW_PATH}/
      cp -av *.xsl ${WWW_PATH}/
      cp -av Makefile ${WWW_PATH}/
      cp -av style.css ${WWW_PATH}/

make should be enough to generate html and pdf documentation.