Saša
Saša

Reputation: 53

How do I generate TOC-only HTML from DocBook?

Given a Docbook-based XML file, how do I extract just the table of contents (TOC) into its own HTML file - preferably without resorting to writing my own XSLT template? I am using xsltproc.

I'm convinced that this must be obviously easy, but for some reason the solution escapes me - after having looked through the DocBook documentation.

As a bonus, I would like the generated toc.html file not to have any html/head/body...body/html wrappers in order to make it simple to embed it within a CMS-powered site.

Any help is appreciated. Thanks.

P.S. My DocBook-content is derived from AsciiDoc, though that should make no difference.

Upvotes: 2

Views: 717

Answers (1)

mzjn
mzjn

Reputation: 50947

Assuming that you are using the SourceForge DocBook stylesheets, you can use chunking with the chunk.tocs.and.lots parameter. This generates a separate TOC file (and the other chunked HTML files as well).

Some options relevant to the bonus question are discussed in this thread: http://www.mail-archive.com/[email protected]/msg09111.html

Upvotes: 1

Related Questions