generate.toc.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <refentry xmlns="http://docbook.org/ns/docbook"
  2. xmlns:xlink="http://www.w3.org/1999/xlink"
  3. xmlns:xi="http://www.w3.org/2001/XInclude"
  4. xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6. version="5.0" xml:id="generate.toc">
  7. <refmeta>
  8. <refentrytitle>generate.toc</refentrytitle>
  9. <refmiscinfo class="other" otherclass="datatype">table</refmiscinfo>
  10. </refmeta>
  11. <refnamediv>
  12. <refname>generate.toc</refname>
  13. <refpurpose>Control generation of ToCs and LoTs</refpurpose>
  14. </refnamediv>
  15. <refsynopsisdiv>
  16. <src:fragment xml:id="generate.toc.frag">
  17. <xsl:param condition="html" name="generate.toc">
  18. appendix toc,title
  19. article/appendix nop
  20. article toc,title
  21. book toc,title,figure,table,example,equation
  22. chapter toc,title
  23. part toc,title
  24. preface toc,title
  25. qandadiv toc
  26. qandaset toc
  27. reference toc,title
  28. sect1 toc
  29. sect2 toc
  30. sect3 toc
  31. sect4 toc
  32. sect5 toc
  33. section toc
  34. set toc,title
  35. </xsl:param>
  36. <xsl:param condition="fo" name="generate.toc">
  37. /appendix toc,title
  38. article/appendix nop
  39. /article toc,title
  40. book toc,title,figure,table,example,equation
  41. /chapter toc,title
  42. part toc,title
  43. /preface toc,title
  44. reference toc,title
  45. /sect1 toc
  46. /sect2 toc
  47. /sect3 toc
  48. /sect4 toc
  49. /sect5 toc
  50. /section toc
  51. set toc,title
  52. </xsl:param>
  53. </src:fragment>
  54. </refsynopsisdiv>
  55. <refsection><info><title>Description</title></info>
  56. <para>This parameter has a structured value. It is a table of space-delimited
  57. path/value pairs. Each path identifies some element in the source document
  58. using a restricted subset of XPath (only the implicit child axis, no wildcards,
  59. no predicates). Paths can be either relative or absolute.</para>
  60. <para>When processing a particular element, the stylesheets consult this table to
  61. determine if a ToC (or LoT(s)) should be generated.</para>
  62. <para>For example, consider the entry:</para>
  63. <screen>book toc,figure</screen>
  64. <para>This indicates that whenever a <tag>book</tag> is formatted, a
  65. Table Of Contents and a List of Figures should be generated. Similarly,</para>
  66. <screen>/chapter toc</screen>
  67. <para>indicates that whenever a document <emphasis>that has a root
  68. of</emphasis> <tag>chapter</tag> is formatted, a Table of
  69. Contents should be generated. The entry <literal>chapter</literal> would match
  70. all chapters, but <literal>/chapter</literal> matches only <tag>chapter</tag>
  71. document elements.</para>
  72. <para>Generally, the longest match wins. So, for example, if you want to distinguish
  73. articles in books from articles in parts, you could use these two entries:</para>
  74. <screen>book/article toc,figure
  75. part/article toc</screen>
  76. <para>Note that an article in a part can never match a <literal>book/article</literal>,
  77. so if you want nothing to be generated for articles in parts, you can simply leave
  78. that rule out.</para>
  79. <para>If you want to leave the rule in, to make it explicit that you're turning
  80. something off, use the value <quote>nop</quote>. For example, the following
  81. entry disables ToCs and LoTs for articles:</para>
  82. <screen>article nop</screen>
  83. <para>Do not simply leave the word <quote>article</quote> in the file
  84. without a matching value. That'd be just begging the silly little
  85. path/value parser to get confused.</para>
  86. <para>Section ToCs are further controlled by the
  87. <parameter>generate.section.toc.level</parameter> parameter.
  88. For a given section level to have a ToC, it must have both an entry in
  89. <parameter>generate.toc</parameter> and be within the range enabled by
  90. <parameter>generate.section.toc.level</parameter>.</para>
  91. </refsection>
  92. </refentry>