]> granicus.if.org Git - docbook-dsssl/commitdiff
Add extra LINK elements to the HTML HEAD of chunked output (for enhanced site navigat...
authorNorman Walsh <ndw@nwalsh.com>
Mon, 13 May 2002 13:53:06 +0000 (13:53 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 13 May 2002 13:53:06 +0000 (13:53 +0000)
xsl/html/chunk-common.xsl
xsl/html/param.ent
xsl/html/param.xweb
xsl/params/html.extra.head.links.xml [new file with mode: 0644]

index ed45dcc6ec7d210596dcf1b11d899b8153023ceb..e6d6fc5c6cef99e78ae2090b07a6114b93da3664 100644 (file)
 <xsl:template name="html.head">
   <xsl:param name="prev" select="/foo"/>
   <xsl:param name="next" select="/foo"/>
+  <xsl:variable name="this" select="."/>
   <xsl:variable name="home" select="/*[1]"/>
   <xsl:variable name="up" select="parent::*"/>
 
         </xsl:attribute>
       </link>
     </xsl:if>
+
+    <xsl:if test="$html.extra.head.links != 0">
+      <xsl:for-each select="//part
+                            |//reference
+                            |//chapter
+                            |//article
+                            |//refentry
+                            |//appendix[not(parent::article)]|appendix
+                            |//glossary[not(parent::article)]|glossary
+                            |//index[not(parent::article)]|index">
+        <link rel="{local-name(.)}">
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="object" select="."/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:attribute name="title">
+            <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
+          </xsl:attribute>
+        </link>
+      </xsl:for-each>
+
+      <xsl:for-each select="section|sect1|refsection|refsect1">
+        <link>
+          <xsl:attribute name="rel">
+            <xsl:choose>
+              <xsl:when test="local-name($this) = 'section'
+                              or local-name($this) = 'refsection'">
+                <xsl:value-of select="'subsection'"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="'section'"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="object" select="."/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:attribute name="title">
+            <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
+          </xsl:attribute>
+        </link>
+      </xsl:for-each>
+
+      <xsl:for-each select="sect2|sect3|sect4|sect5|refsect2|refsect3">
+        <link rel="subsection">
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="object" select="."/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:attribute name="title">
+            <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
+          </xsl:attribute>
+        </link>
+      </xsl:for-each>
+    </xsl:if>
   </head>
 </xsl:template>
 
index 545dc0a1a1aa6a244a62857eec88a9bf842e4827..50d6916ec535aa67ec585aafa1b264dd245a97c4 100644 (file)
@@ -52,6 +52,7 @@
 <!ENTITY html.base SYSTEM "../params/html.base.xml">
 <!ENTITY html.cleanup SYSTEM "../params/html.cleanup.xml">
 <!ENTITY html.ext SYSTEM "../params/html.ext.xml">
+<!ENTITY html.extra.head.links SYSTEM "../params/html.extra.head.links.xml">
 <!ENTITY html.longdesc SYSTEM "../params/html.longdesc.xml">
 <!ENTITY html.longdesc.link SYSTEM "../params/html.longdesc.link.xml">
 <!ENTITY html.stylesheet SYSTEM "../params/html.stylesheet.xml">
index 61163852ce9e7c60150f2a15b1bb1d691802f388..1fe2425507dc927f3fe00c4674db4e99ee46b211 100644 (file)
@@ -223,6 +223,7 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 
 <reference><title>Chunking</title>
 &html.ext;
+&html.extra.head.links;
 &root.filename;
 &base.dir;
 &generate.manifest;
@@ -359,6 +360,7 @@ around all these parameters.</para>
 <src:fragref linkend="html.base.frag"/>
 <src:fragref linkend="html.cleanup.frag"/>
 <src:fragref linkend="html.ext.frag"/>
+<src:fragref linkend="html.extra.head.links.frag"/>
 <src:fragref linkend="html.longdesc.frag"/>
 <src:fragref linkend="html.longdesc.link.frag"/>
 <src:fragref linkend="html.stylesheet.frag"/>
diff --git a/xsl/params/html.extra.head.links.xml b/xsl/params/html.extra.head.links.xml
new file mode 100644 (file)
index 0000000..383b376
--- /dev/null
@@ -0,0 +1,26 @@
+<refentry id="html.extra.head.links">
+<refmeta>
+<refentrytitle>html.extra.head.links</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>html.extra.head.links</refname>
+<refpurpose>Toggle extra HTML head link information</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='html.extra.head.links.frag'>
+<xsl:param name="html.extra.head.links" select="1"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If non-zero, extra <sgmltag>link</sgmltag> elements will be
+generated in the <sgmltag>head</sgmltag> of chunked HTML files. These
+extra links point to chapters, appendixes, sections, etc. as supported
+by the <quote>Site Navigation Bar</quote> in Mozilla 1.0 (as of CR1, at least).
+</para>
+
+</refsect1>
+</refentry>