Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
How To
Syntax
FAQ
License

Table of content configuration



It is possible to configure if and how the table of content is shown in the html output for each article.

By default a table of content is shown for an article in if this article has at least 3 chapters or titles in the article.

General configuration of the table of content

Several command-line or configuration file properties allow to configure the table of content for each article:
  • hasTOC: specifies if the table of content must be presented. If set to false, no table of content will be presented on articles, regardless of their number of titles
  • ocMaxLevel: specifies the maximum level of the table of content for the articles
  • tocThreshold: specifies the threshold of the number of titles for articles on html. By default an article must have at least 3 titles to have a table of content
For example:
      java -jar docGenerator.jar -input=wiki/input -output=wiki/output -hasTOC=false
will not present any table of content for any article.

      java -jar docGenerator.jar -input=wiki/input -output=wiki/output -tocThreshold=5
will only show table of content for articles which have at least 5 titles.

      java -jar docGenerator.jar -input=wiki/input -output=wiki/output -toxMaxLevel=2
will only present in the articles table of content titles up to level 2.

The toc attribute for an article overrides the global hasTOC property. The tocMaxLevel attribute for an article overrides the global tocMaxLevel property.


The tocMaxLevel property it used for html articles, whereas the tocLevel property is used for PDF generation, or Word generation. The reason why these global attributes are different is because the default value for this option is different in html and in pdf or word.

Configuring the table of content for one article

  • The toc attribute for an article specifies that this article will not have a table of content regardless of the general configuration (it can only have the false value if present)
  • The tocMaxLevel attribute indicates the maximum level of titles to show in the Table of content
The following example will not show the Table of content at all:
   <article desc="an article without a toc" toc="false">
   ...
   </article>
The following example will only show the Table of content up to level 1:
   <article desc="an article with a toc limited at level 1" tocMaxLevel="1">
   ...
   </article>

See also


Categories: Configuration

docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.