Hi,
Looking at the output messages, it appears that you have an article whose id attribute
value is "index". When you set the stylesheet parameter 'use.id.as.filename' to 1,
then that id is used for the filename. That's where the first index.html comes from.
The second index.html is the default filename for the chunk that corresponds to the
root element. That just follows the long standing convention of naming the starting
point for a directory of HTML files "index.html". Unfortunately, the stylesheet does
not check that the two names conflict, so one overwrites the other. I would consider
that a bug. In the interim, as David suggests, you can use the 'root.filename'
parameter to change the name of that file to something else to avoid the conflict with
the article filename.
The root index.html file is used to contain the title page for the document root
element, and the TOC if generate.toc specifies it. So turning off the TOC for set and
book would not turn off those chunk files.
There is no stylesheet parameter to suppress the book and set level chunks. There are
a couple of methods that could be used to eliminate the output of those chunks, but
the complication comes from the "Previous" link that would be generated in the files
left behind. The HTML file for the first article in a book would display a Prev link
to the book level, which would not work if there is no book HTML file. Customizing
Next and Previous for exceptions like this has never been easy in DocBook XSL.
However, if your style is to turn off the standard navigational headers and footers
(and eliminate the Next and Previous problem), then on Windows you can suppress the
output by adding a dbhtml filename processing instruction set to "NUL". On Windows,
that is a special filename that disappears the output sent to it. If you put this
after the opening tag of book and set, then those chunks will not appear in the
output.
<?dbhtml filename="NUL"?>
I'm not sure what other complications might arise from using this trick, though.
Bob Stayton
Sagehill Enterprises
[email protected]
----- Original Message -----
From: "David Cramer" <[email protected]>
To: "Tao Wang" <[email protected]>; "Robert Fekete" <[email protected]>
Cc: <[email protected]>
Sent: Thursday, May 13, 2010 6:25 AM
Subject: RE: [docbook-apps] How to output html without TOC?
You might try setting root.filename to something other than index:
http://docbook.sourceforge.net/release/xsl/current/doc/html/root.filenam
e.html
I believe that controls the file name of the generated toc file. This
still isn't exactly what you want, which is no toc file and no "prev"
link in the header of the first non-toc file linking to the toc.
Now that you mention it, it's surprising that the file can't easily be
completely suppressed. Bob or someone will have to chime in.
David
-----Original Message-----
From: Tao Wang [mailto:[email protected]]
Sent: Thursday, May 13, 2010 1:34 AM
To: Robert Fekete
Cc: [email protected]
Subject: Re: [docbook-apps] How to output html without TOC?
I tried set 'nop' for my root element and others, and it
doesn't stop generating 'index.html'.
I set the param as
----------------------------------
<xsl:param name="generate.toc">
set nop
set/book nop
</xsl:param>
----------------------------------
And the output is
=========================
Writing ../html/index.html for article(index) Writing
../html/books.html for article(books) Writing
../html/bugs.html for article(bugs) Writing
../html/commercial_support.html for
article(commercial_support) Writing ../html/developers.html
for article(developers) Writing ../html/documentation.html
for article(documentation) Writing ../html/download.html for
article(download) Writing ../html/extra.html for
article(extra) Writing ../html/git.html for article(git)
Writing ../html/license.html for article(license) Writing
../html/mailinglist.html for article(mailinglist) Writing
../html/news.html for article(news) Writing ../html/bk01.html
for book Writing ../html/index.html for set =========================
as you saw in the output, '../html/index.html' is generated
twice, the first one is the one I want, and it overwrite by
the second one, which is the TOC for set.
If I set 'nop' to 'set', it doesn't stop generating the file,
instead, it just generate an empty 'index.html' without TOC inside.
I do not want to generate 'bk01.html' for <book> and
'index.html' for <set> above, how can I do that?
On Thu, May 13, 2010 at 12:38 AM, Robert Fekete
<[email protected]> wrote:
> Hi,
>
> I think that you will need to customize the generate.toc
template, and
> possibly set nop for your root element:
>
> http://www.sagehill.net/docbookxsl/TOCcontrol.html
>
> Robert
>
> Tao Wang wrote:
>
>> Hi,
>>
>> I'm using docbook 4.5 (xhtml/trunk.xsl) to generate html
files for a
>> website. The problem is I don't want the Table of Content being
>> output, especially as the file 'index.html'.
>>
>> I wrote a index file as an <article> in a <book>, which id is
>> 'index', and it's supposed to be generated as
'index.html'. However,
>> the default TOC will overwrite the 'index.html' file, so I
cannot get
>> my 'index.html'.
>>
>> And, actually, the TOC is meaning less for my usage, so I
just want
>> to turn the TOC off. How can I do that?
>>
>
>
--
Regards
Tao Wang
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]