TOC: List of Figures

Jürgen Purtz <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.documentation
Message-ID <[email protected]>
After the integration of figures into the documentation it may be 
helpful to extent the TOC with a 'List of Figures'. Any opinion?

If yes: The same for 'List of Tables' and 'List of Examples'?

There is a simple way to enable this feature: change line 56 of 
stylesheet-html-common.xsl to: "book toc,title,figure,table,example". As 
shown in a previous thread this leads to an ugly swelling of the TOC 
similar to the formerly handling of release notes - especially for 
tables and examples -, see attachment 1.

The alternative is a downshift of the postings by one level, see 
attachment 2. How to realize this behavior is shown in attachment 3.
Screenshot from 2019-07-01 17-26-13.png (image/png, 58 KB) - not displayed
Screenshot from 2019-07-01 17-27-39.png (image/png, 13 KB) - not displayed
toc.patch (text/x-patch, 1.8 KB)
diff --git a/doc/src/sgml/postgres.sgml b/doc/src/sgml/postgres.sgml
index 3e115f1c76..6a1b5228d0 100644
--- a/doc/src/sgml/postgres.sgml
+++ b/doc/src/sgml/postgres.sgml
@@ -281,6 +281,22 @@
 
  </part>
 
+ <part>
+  <title>Lists of Figures, Tables and Examples</title>
+  <appendix id="list-of-figures">
+   <title>List of Figures</title>
+   <para />
+  </appendix>
+  <appendix id="list-of-tables">
+   <title>List of Tables</title>
+   <para />
+  </appendix>
+  <appendix id="list-of-examples">
+   <title>List of Examples</title>
+   <para />
+  </appendix>
+ </part>
+
  &biblio;
  <index id="bookindex"></index>
 
diff --git a/doc/src/sgml/stylesheet-html-common.xsl b/doc/src/sgml/stylesheet-html-common.xsl
index 9edce52a10..eb04549fb9 100644
--- a/doc/src/sgml/stylesheet-html-common.xsl
+++ b/doc/src/sgml/stylesheet-html-common.xsl
@@ -81,6 +81,27 @@ set       toc,title
   </xsl:call-template>
 </xsl:template>
 
+<!--  List of Figures and more  -->
+<xsl:template match="/book/part/appendix[@id='list-of-figures']/para">
+  <xsl:call-template name="list.of.titles">
+    <xsl:with-param name="titles" select="'figure'"/>
+    <xsl:with-param name="nodes" select="//figure"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="/book/part/appendix[@id='list-of-tables']/para">
+  <xsl:call-template name="list.of.titles">
+    <xsl:with-param name="titles" select="'table'"/>
+    <xsl:with-param name="nodes" select="//table"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="/book/part/appendix[@id='list-of-examples']/para">
+  <xsl:call-template name="list.of.titles">
+    <xsl:with-param name="titles" select="'example'"/>
+    <xsl:with-param name="nodes" select="//example"/>
+  </xsl:call-template>
+</xsl:template>
 
 <!-- Put index "quicklinks" (A | B | C | ...) at the top of the bookindex page. -->
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.