Template:SimpleTOC/doc
This is a documentation subpage for Template:SimpleTOC. It contains usage information, categories and other content that is not part of the original template page. |
This template uses TemplateStyles: |
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.
- {{SimpleTOC/s}}
- {{SimpleTOC line}}
- {{SimpleTOC/e}}
How to use
[edit]- Start the TOC with {{SimpleTOC/s}}
- Each line of the TOC will use {{SimpleTOC line}}, which has two parameters:
- the text that goes on the left (i.e. the chapter title)
- the text that goes on the right (i.e. the page number)
- End the TOC with {{SimpleTOC/e}}
For example:
{{SimpleTOC/s}} {{SimpleTOC line | [[Book Title/Chapter 1|Chapter 1]] | 1 }} {{SimpleTOC line | [[Book Title/Chapter 2|Chapter 2]] | 11 }} {{SimpleTOC line | [[Book Title/Chapter 3|Chapter 3]] | 21 }} {{SimpleTOC line | [[Book Title/Chapter 4|Chapter 4]] | 31 }} {{SimpleTOC/e}}
This gives the following result:
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 cclass
and pclass
to add a CSS class to the chapter or page fields respectively, that can be targeted by your style sheets.
The following classes are included in this template:
cclass=stoc-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.