[sr-dev] git:master: docbook: Generate TOC for root-level section elements

Jan Janak jan at iptel.org
Mon Jun 1 17:31:02 CEST 2009


Module: sip-router
Branch: master
Commit: 229fd4f9d5685e1f41c790b7e6b69533d2d9e8f0
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=229fd4f9d5685e1f41c790b7e6b69533d2d9e8f0

Author: Jan Janak <jan at iptel.org>
Committer: Jan Janak <jan at iptel.org>
Date:   Mon Jun  1 17:30:37 2009 +0200

docbook: Generate TOC for root-level section elements

Change the configuration of docbook XSL stylesheet so that they
generate the table of contents even for documents whose root-level
element is <section>. This is needed for docbook documentation in
modules that originate from SER.

---

 docbook/html.xsl |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/docbook/html.xsl b/docbook/html.xsl
index 0468528..2551f41 100644
--- a/docbook/html.xsl
+++ b/docbook/html.xsl
@@ -8,4 +8,29 @@
     <!-- Common XHTML customization -->
     <xsl:import href="html.common.xsl"/>
 
+	<!-- Display all subsections in in the toc of READMEs -->
+
+	<!-- Enable TOC for sections -->
+  	<xsl:param name="toc.section.depth">4</xsl:param>
+  	<xsl:param name="generate.section.toc.level">4</xsl:param>
+
+	<!-- This is the default value of generate.toc modified so that we get TOC
+	     in documents whose root element is root, but only for the root
+	     section element. Non-root section or sectX elements have been removed
+		 so that they never generate a TOC. -->
+	<xsl:param name="generate.toc">
+		appendix  toc,title
+		article/appendix  nop
+		article   toc,title
+		book      toc,title,figure,table,example,equation
+		chapter   toc,title
+		part      toc,title
+		preface   toc,title
+		qandadiv  toc
+		qandaset  toc
+		reference toc,title
+		/section   toc
+		set       toc,title
+	</xsl:param>
+
 </xsl:stylesheet>




More information about the sr-dev mailing list