2
0
Эх сурвалжийг харах

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.
Jan Janak 16 жил өмнө
parent
commit
229fd4f9d5
1 өөрчлөгдсөн 25 нэмэгдсэн , 0 устгасан
  1. 25 0
      docbook/html.xsl

+ 25 - 0
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>