Local document customizations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi folks,

Some of our process documents can become somewhat large, which lends
well to the chunked html output.  Taking that a step further we've found
it helpful to have 2 toc settings where the main table of contents only
goes one level deep (chapter).  Once you click on a chapter you then see
the detailed toc for that section.  This has received some good mileage
and seems break up a document into manageable chunks.

To see an example of the output see
http://people.redhat.com/~jlaska/documentation-guide-en/ .  Curious what
folks think about this, is there a way to allow doc writers to make this
customization without modifying main-html.xsl?

Thanks,
James 

-- 
==========================================
 James Laska         -- jlaska@xxxxxxxxxx
 Quality Engineering -- Red Hat, Inc.
==========================================
Index: main-html.xsl
===================================================================
RCS file: /cvs/docs/docs-common/xsl/main-html.xsl,v
retrieving revision 1.8
diff -u -u -r1.8 main-html.xsl
--- main-html.xsl	21 Oct 2005 23:30:40 -0000	1.8
+++ main-html.xsl	28 Oct 2005 13:32:03 -0000
@@ -26,7 +26,7 @@
 <xsl:param name="generate.toc">
 book toc
 article toc
-chapter nop
+chapter toc
 qandadiv toc
 qandaset toc
 sect1 nop
@@ -145,4 +145,25 @@
 <xsl:param name="navig.showtitles">1</xsl:param>
 -->
 
+<!-- TOC -->
+<xsl:template match="preface|chapter|appendix|article" mode="toc">
+    <xsl:param name="toc-context" select="."/>
+    <xsl:choose>
+        <xsl:when test="local-name($toc-context) = 'book'">
+            <xsl:call-template name="subtoc">
+                <xsl:with-param name="toc-context" select="$toc-context"/>
+                <xsl:with-param name="nodes" select="foo"/>
+            </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:call-template name="subtoc">
+                <xsl:with-param name="toc-context" select="$toc-context"/>
+                <xsl:with-param name="nodes"
+                      select="section|sect1|glossary|bibliography|index
+                             |bridgehead[$bridgehead.in.toc != 0]"/>
+            </xsl:call-template>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
 </xsl:stylesheet>
-- 

fedora-docs-list@xxxxxxxxxx
To unsubscribe: 
https://www.redhat.com/mailman/listinfo/fedora-docs-list

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Red Hat 9]     [Yosemite News]     [KDE Users]

  Powered by Linux