This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [docbook-apps] HTMLHelp questions


Some caveats: if you change the toc as Jirka suggests (we did something
similar), then the empty topics will still be in the help project.
Though there's no way to get to them from the chm's toc pane, you'll
still see them if you do a search for a word that's in the chapter title
and they'll still be in the page sequence if you have next/prev links in
the header or footer. 

Our solution was to turn on chapter tocs and turn off navigation
(next/prev) links. That way if you do come upon a phantom topic in a
search, it won't look too weird. Also, if you have content before the
first section or sect1, then that content only shows up on the phantom
topic, so it's effectively out of the help file. 

The ideal solution would be to have the htmlhelp xsls test to see if a
topic--whether a chapter or a section--would be empty (i.e. check to see
if there's content between the title and a following sibling section or
sect#), and to leave it out of the hhc, omit generating an html file,
and still generate correct next/prev links in the surrounding pages.
That's a lot of complicated stuff to mess with tho. 

David

-----Original Message-----
From: Jirka Kosek [mailto:jirka@kosek.cz] 
Sent: Wednesday, June 04, 2003 7:39 AM
To: Kenneth Johansson
Cc: DOCBOOK-APPS
Subject: Re: [docbook-apps] HTMLHelp questions

Kenneth Johansson wrote:

> 2a) Can I remove titles from chapter level? I've currently set
> "chunk.first.sections" to 1 but it only moves the first section and
> leaves the first page of the chapter empty with the chapter title
> intact.
> 
> 2b) I would like to go even further if possible and make my HTMLHelp
> tree view behave exactly like i.e. MS Word. All the book-symbols in
> MS Word are only used like a wrapper which expands and reveals the
> subsections below it. The book-symbol doesn't contain any info. Is it
> possible to customize DocBook HTMLHelp this much?
> 
> I suppose it would require some customization of the Chunking XSL
> stylesheets as well.

Adding following template to your customization layer might work. It is 
untested, but basic idea is to point from ToC entry for chapter directly

  to the first section.

<xsl:template match="chapter"
               mode="hhc">
   <xsl:variable name="title">
     <xsl:if test="$htmlhelp.autolabel=1">
       <xsl:variable name="label.markup">
         <xsl:apply-templates select="." mode="label.markup"/>
       </xsl:variable>
       <xsl:if test="normalize-space($label.markup)">
         <xsl:value-of 
select="concat($label.markup,$autotoc.label.separator)"/>
       </xsl:if>
     </xsl:if>
     <xsl:call-template name="escape-attr">
       <xsl:with-param name="value">
         <xsl:apply-templates select="." mode="title.markup"/>
       </xsl:with-param>
     </xsl:call-template>
   </xsl:variable>

   <xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
     <xsl:text disable-output-escaping="yes">&lt;LI&gt; &lt;OBJECT 
type="text/sitemap"&gt;
       &lt;param name="Name" value="</xsl:text>
           <xsl:value-of select="normalize-space($title)"/>
       <xsl:text disable-output-escaping="yes">"&gt;
       &lt;param name="Local" value="</xsl:text>
           <xsl:call-template name="href.target.with.base.dir">
             <xsl:with-param name="object" select="(section|sect1)[1]"/>
           </xsl:call-template>
       <xsl:text disable-output-escaping="yes">"&gt;
     &lt;/OBJECT&gt;</xsl:text>
   </xsl:if>
   <xsl:if test="section|sect1">
     <xsl:text disable-output-escaping="yes">&lt;UL&gt;</xsl:text>
       <xsl:apply-templates
	select="section|sect1"
	mode="hhc"/>
     <xsl:text disable-output-escaping="yes">&lt;/UL&gt;</xsl:text>
   </xsl:if>
</xsl:template>


-- 
-----------------------------------------------------------------
   Jirka Kosek  	
   e-mail: jirka@kosek.cz
   http://www.kosek.cz

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]