Module:TOC/doc

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

CodeDiscussionEditHistoryLinksLink count Subpages:DocumentationTestsResultsSandboxLive code All modules

This is the documentation page for Module:TOC

Usage

[edit]

{{#invoke:TOC|letters}}

Creates lists of anchors for {{CategoryTOC}}. Specify list items using numbered parameters. You can specify alternate display titles for each items using the "...T" paramters (|1T=, |2T=, |3T=, etc) based on the position in the list, or the "...L" parameters (|AL=, |BL=, |CL=, etc.) based on the name of each list item.

If you are specifying a range of numbers, instead of listing each item, you can use |start= and |end=, e.g. {{#invoke:TOC|letters|start=1|end=100}} (these values will be ignored if they are not numbers), and an optional increment |by= (whose default is 1). All number will be 0-padded to the length of the longest number, but display without 0-padding (see second example below).

You can also specify an optional |prefix= (default is empty) to the sort keys used for indexing the categories members and to navigate to them from the generated links list.

Examples

[edit]
  1. "{{#invoke:TOC|letters}}" → ""
  2. "{{#invoke:TOC|letters|0|1|2|3|4|5|6|7|8|9}}" → ""
  3. "{{#invoke:TOC|letters|A|B|C|1T=First|2T=Second|3T=Third}}" → ""
  4. "{{#invoke:TOC|letters|start=1|end=31}}" → ""
  5. "{{#invoke:TOC|letters|start=1|end=31|by=2}}" → ""
  6. "{{#invoke:TOC|letters|start=1900|end={{CURRENTYEAR}}|by=10|prefix=+}}" → ""
  7. "{{#invoke:TOC|letters|start=7|end=12|01L={{Int:January}}|02L={{Int:February}}|03L={{Int:March}}|04L={{Int:April}}|05L={{Int:May}}|06L={{Int:June}}|07L={{Int:July}}|08L={{Int:August}}|09L={{Int:September}}|10L={{Int:October}}|11L={{Int:November}}|12L={{Int:December}}}}" → ""