dbfullrelease

Synopsis

dbfullrelease [-d] [-h] [-i name] [-p prefix] [-t] [-u uploaddir] {file}

Description

This script transforms a DocBook document and creates HTML, RTF, TeX, DVI, PostScript, and PDF output in a single run. An optional packing step will create archives of all versions. The script calls dbjade to do the individual transformations.

The -i and -p options are passed to dbjade as described above.

Set the -d switch to pack the output files into archives.

dbfullrelease -h shows a brief usage screen and exits.

Use the -t option for a test run. This will build only the first format in the script and exit. By default this format is RTF, but you can easily rearrange the script to use a different format for the test run.

Use the -u option to specify an upload directory. This option needs the -d option to be effective. All archives, PDF, and HTML files will be copied to the specified directory, which can e.g. be the upload directory for your web page.

Prerequisites

This script uses the following external programs and scripts:

Modify the following variables in the script to your needs:

uploaddir

specify the full path of an upload directory or use an empty string ("") if you don't need this feature.

pack

this is the command to start your packer

packsuffix

this is the suffix, including the dot, that the generated archives should have

Other assumptions are:

Comments

This script can automatically handle DocBook documents which are split into several source files on the chapter level if you follow a simple file naming rule. If the main document is doc.sgml, the subdocuments have to be named doc-chapterX.sgml, where X is an arbitrary string of at least one character. As we want to have the Doctype line in all subdocuments to edit them with PSGML, we have to extract the chapters proper from the subdocuments. To this end, the script uses sgrep and writes the chapters into corresponding files doc-chapterX.sgml.bare. Therefore you have to include the latter form into your main document as external entities.

Note: If you don't want to use sgrep, you may use a perl script instead. As a perl illiterate, I can't offer one here, though.

The script calls dbjade to do the individual transformations.

The output files will be stored in subdirectories of the current directory. The names are /html-release, /ps-release etc. and have a prefix if you specified one with the -p option.

If these subdirectories contain a readme.txt file, this will be included in the archive.

Examples

A useful strategy to work with this script is as follows. After editing your SGML source document, make a test run:

~# dbfullrelease -t foo.sgml

Fix any bugs that show up on the OpenJade output and view the RTF output to spot any errors (you can rearrange the script to use any other format as the test output). Then use:

~# dbfullrelease -d foo.sgml

to create all formats and archives. If the $uploaddir variable is not empty, all archives as well as the HTML and PDF files will be copied to the given directory. You could then use a FTP client to update your website.