9. Customizing your HTML files

9.1. HTML file names

By default, when separate HTML files are made, the SGML processor will assign arbitrary names to the resulting files. This can be confusing to readers who may bookmark a page only to have it change. Whatever your reasoning, here's how to make separate files named the way you want:

In your first <article> tag (which should be the only one) include an id parameter and call it index. This will make your tag look like this:

<article id="index"> 

Do not modify the first <chapter> tag, as it's usually an introduction and you want that on the first page. For each other <section> tag, include the id parameter and name it. A name should include only alphanumeric characters, and it should be short enough to understand what it is.

 
	<chapter id="tips"> 

Pick section IDs intelligently

We all know that Cool URIs Don't Change. This means your ids should not change either. Unless of course the content for the id has changed substantially and the id name is no longer relevant.

HTML file name generation using Jade

If you are using Jade to transform your DocBook into HTML you must use the following parameter: -V %use-id-as-filename%.

9.2. Headers and Footers

There is no easy way to add headers and footers to your document. If you are using DocBook XSL and doing your own document transformations you may customize the XSL template to suit your needs. For more information read http://www.sagehill.net/docbookxsl/HTMLHeaders.html.