OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] How to encode HTMLHelp topic alias: <?dbhh topicname="some_title" topicid="42"?>


> If the current stylesheets do not create a fragment identifier based
> on the ASSUMPTION that the HTML Help Viewer does not support it, 
> perhaps we can change the stylesheets' handling of <?dbhh> PIs.

I made the following customizations:

<!-- Translate hyperlink target
         <?dbhh topicname="foo" topicid="123"/> 
     into 
         <a id="foo"/>
     in .html output 
-->
<xsl:template match="processing-instruction('dbhh')">
  <a 
id="{substring-before(substring-after(.,'topicname=&quot;'),'&quot;')}"/>
</xsl:template>

<!-- Copy of template defined in htmlhelp-common.xsl & 
profile-htmlhelp-common.xsl
     Only change is the addition of:
 
         '#<xsl:value-of select="$topicname"/>'

     near the end, to add fragment identifier to the .html file reference.
-->
<xsl:template match="processing-instruction('dbhh')" mode="hh-alias">
  <xsl:variable name="topicname">
    <xsl:call-template name="pi-attribute">
      <xsl:with-param name="pis"
                      select="."/>
      <xsl:with-param name="attribute" select="'topicname'"/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:variable name="href">
    <xsl:call-template name="href.target.with.base.dir">
      <xsl:with-param name="object" select=".."/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:value-of select="$topicname"/>
  <xsl:text>=</xsl:text>
  <xsl:value-of select="substring-before(concat($href, '#'), 
'#')"/>#<xsl:value-of select="$topicname"/>
  <xsl:text>&#xA;</xsl:text>
</xsl:template>

You can do:

   hh.exe htmlhelp.chm::/index.html#foo

and HTML Help Viewer will open this specific location.

I remember reading somewhere that HTML Help Viewr only takes numbers to
indicate fragments, but at least with hh.exe, that's not the case.

One mystery remains. In this scenario, there's little role for @topicid 
attribute. It seems to exist purely to define 'some' constant value to 
assign the #define'd names in context.h, so that the C++ programs 
do not need to be recompiled each time XSLT gets run to produce the 
HTML Help.

Taro


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]