]> granicus.if.org Git - docbook-dsssl/commitdiff
Added the autotoc.label.in.hyperlink param.
authorMichael Smith <xmldoc@users.sourceforge.net>
Thu, 27 Apr 2006 09:40:33 +0000 (09:40 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Thu, 27 Apr 2006 09:40:33 +0000 (09:40 +0000)
If the value of autotoc.label.in.hyperlink is non-zero, labels are
included in hyperlinked titles in the TOC. If it is instead zero,
labels are still displayed prior to the hyperlinked titles, but
are not hyperlinked along with the titles.

Closes patch #1065868. Thanks to anatoly techtonik for the patch.

xsl/html/autotoc.xsl
xsl/html/param.ent
xsl/html/param.xweb
xsl/params/autotoc.label.in.hyperlink.xml [new file with mode: 0644]

index e9016d37f234fa9ae4e7c924dd80247d00579719..d381694a045208f3314a7ae00f15c45f2a0faf69 100644 (file)
 
  <span>
   <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
+
+  <!-- * if $autotoc.label.in.hyperlink is zero, then output the label -->
+  <!-- * before the hyperlinked title (as the DSSSL stylesheet does) -->
+  <xsl:if test="$autotoc.label.in.hyperlink = 0">
+    <xsl:variable name="label">
+      <xsl:apply-templates select="." mode="label.markup"/>
+    </xsl:variable>
+    <xsl:copy-of select="$label"/>
+    <xsl:if test="$label != ''">
+      <xsl:value-of select="$autotoc.label.separator"/>
+    </xsl:if>
+  </xsl:if>
+
   <a>
     <xsl:attribute name="href">
       <xsl:call-template name="href.target">
       </xsl:call-template>
     </xsl:attribute>
     
+  <!-- * if $autotoc.label.in.hyperlink is non-zero, then output the label -->
+  <!-- * as part of the hyperlinked title -->
+  <xsl:if test="not($autotoc.label.in.hyperlink = 0)">
     <xsl:variable name="label">
       <xsl:apply-templates select="." mode="label.markup"/>
     </xsl:variable>
     <xsl:if test="$label != ''">
       <xsl:value-of select="$autotoc.label.separator"/>
     </xsl:if>
+  </xsl:if>
 
     <xsl:apply-templates select="." mode="titleabbrev.markup"/>
   </a>
index d9211a2937def7ac281b28cbde036e9057d311f6..790aedb8721287677676ec424fe0daf602a76c18 100644 (file)
@@ -7,6 +7,7 @@
 <!ENTITY appendix.autolabel SYSTEM "../params/appendix.autolabel.xml">
 <!ENTITY author.othername.in.middle SYSTEM "../params/author.othername.in.middle.xml">
 <!ENTITY autotoc.label.separator SYSTEM "../params/autotoc.label.separator.xml">
+<!ENTITY autotoc.label.in.hyperlink SYSTEM "../params/autotoc.label.in.hyperlink.xml">
 <!ENTITY base.dir SYSTEM "../params/base.dir.xml">
 <!ENTITY biblioentry.item.separator SYSTEM "../params/biblioentry.item.separator.xml">
 <!ENTITY bibliography.collection SYSTEM "../params/bibliography.collection.xml">
index 020a227944767a67dfe8672c8041204ea0203771..5bf21b2764bc50b775251a11e6c9ee5e3d146bcf 100644 (file)
@@ -83,6 +83,7 @@ stylesheet like this:</para>
 <reference id="toc_index"><title>ToC/LoT/Index Generation</title>
 &annotate.toc;
 &autotoc.label.separator;
+&autotoc.label.in.hyperlink;
 &process.source.toc;
 &process.empty.source.toc;
 &bridgehead.in.toc;
@@ -463,6 +464,7 @@ around all these parameters.</para>
 <src:fragref linkend="appendix.autolabel.frag"/>
 <src:fragref linkend="author.othername.in.middle.frag"/>
 <src:fragref linkend="autotoc.label.separator.frag"/>
+<src:fragref linkend="autotoc.label.in.hyperlink.frag"/>
 <src:fragref linkend="base.dir.frag"/>
 <src:fragref linkend="biblioentry.item.separator.frag"/>
 <src:fragref linkend="bibliography.collection.frag"/>
diff --git a/xsl/params/autotoc.label.in.hyperlink.xml b/xsl/params/autotoc.label.in.hyperlink.xml
new file mode 100644 (file)
index 0000000..15f93d0
--- /dev/null
@@ -0,0 +1,24 @@
+<refentry id="autotoc.label.in.hyperlink">
+<refmeta>
+<refentrytitle>autotoc.label.in.hyperlink</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>autotoc.label.in.hyperlink</refname>
+<refpurpose>Include lable in hyperlinked titles in TOC?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='autotoc.label.in.hyperlink.frag'><xsl:param name="autotoc.label.in.hyperlink" select="1"/></src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If the value of
+<parameter>autotoc.label.in.hyperlink</parameter> is non-zero, labels
+are included in hyperlinked titles in the TOC. If it is instead zero,
+labels are still displayed prior to the hyperlinked titles, but
+are not hyperlinked along with the titles.</para>
+
+</refsect1>
+</refentry>