Jump to content

Template:SimpleTOC3/doc

From Wikisource

This is an attempt to create a TOC template system that is as stripped-down as possible. It is intended to use for very long tables of contents or indexes, to try and keep them under the template expansion limit. It is a 3-column variant of the 2-column SimpleTOC template, and is still undergoing some minor fine tuning regarding cell padding.

How to use

[edit]
  1. Start the TOC with {{SimpleTOC3/s}}
  2. Each line of the TOC will use {{SimpleTOC3 line}}, which has three parameters:
    1. the text that goes in the first column (e.g. chapter number), default right aligned - note that a width (2em) is set by default for this column, although users may wish to override this on index-specific style sheets
    2. the text that goes in the second column (e.g. the chapter title)
    3. the text that goes in the third column (e.g. the page number)
  3. End the TOC with {{SimpleTOC3/e}}

For example:

{{SimpleTOC3/s}}
{{SimpleTOC3 line | I. | Chapter 1 | 1 }}
{{SimpleTOC3 line | II. | Chapter 2 | 11 }}
{{SimpleTOC3 line | III. | Chapter 3 | 21 }}
{{SimpleTOC3 line | IV. | Chapter 4 | 31 }}
{{SimpleTOC3/e}}

This gives the following result:

I.
Chapter 1
1
II.
Chapter 2
11
III.
Chapter 3
21
IV.
Chapter 4
31

Styling

[edit]

This template deliberately avoids parameters for inline CSS (which will make the template too unwieldy for long tables). Instead, use TemplateStyles and Index-specific style sheets to control the layout and appearance of this template.

You can use the parameters nclass, cclass and pclass to add a CSS class to the chapter number, chapter title and page fields respectively, that can be targeted by your style sheets.

The following classes are included in this template:

  • cclass=stoc3-nodots - removes the dot leaders

Note to template editors

[edit]

You may be tempted to expand this template to support more complex tables of contents. While this is a desirable aim, please ensure that the templates remain as small as possible or else you may break some very long indices that are already using this template.