Chapter 7. HTML output options

Table of Contents

Single HTML file
Processing part of a document
Chunking into multiple HTML files
Chunk filenames
Chunked files output directory
Fast chunking
Table of contents chunking
Controlling what gets chunked
Output encoding for chunk HTML
Specifying the output DOCTYPE
Indenting HTML elements
Single file options with onechunk
Name the file using an id
Putting the file elsewhere
Specify the output encoding and DOCTYPE
Using CSS to style HTML
Styling section headings with CSS
Styling displays with CSS
Adding custom class attributes
Generating id attributes
Chapter and section numbering
Depth of section numbering
Docbook icon graphics
Admonition graphics
Navigational icons
Callout icons
Date and time

This chapter describes some common options for HTML output. These options can all be specified on the command line and do not require a customization file for the XSL stylesheets. A much larger set of options that include stylesheet customizations is described in Chapter 12, HTML customizations

Single HTML file

The DocBook stylesheet html/docbook.xsl produces a single HTML file from your DocBook XML input file. The stylesheet itself does not name the file, so you have to supply the output filename. You can do this with the specific output option of your XSL processor, or you can simply redirect the output of the processor to a file.

xsltproc  --output  myfile.html  docbook.xsl  myfile.xml
xsltproc  docbook.xsl  myfile.xml  >  myfile.html

If you want the output to appear in another directory, then use a relative or absolute pathname instead of just the filename. For example

xsltproc  --output  /usr/apache/htdocs/myfile.html  docbook.xsl  myfile.xml

Several other options for single-file output are described in the section “Single file options with onechunk”.