Template:PseudoHeading

From Wikipedia, the free encyclopedia

Heading
[edit] Template documentation

[edit] Purpose

Creates a pseudo-heading, a line of text which looks similar to the heading of a sub-subsection, and which has an anchor that can be linked to, but which is not included in the standard TOC.

It is intended primarily for use with a compact TOC, such as {{AlphanumericTOC}}.

[edit] Usage

The simplest usage is {{PseudoHeading|heading=A}}, where A is the desired text of the heading. This appears as:

A

When used this way, the anchor of the heading is the same as the heading text, so you could link to this heading using [[#A|Link to pseudo-heading]].

[edit] Parameters

Parameter Description Default
heading The text of the pseudo-heading. Heading
anchor The anchor for the pseudo-heading. The value of the heading parameter.
anchorPrefix Prefix added to the anchor. If both anchorPrefix and anchor are specified, the anchor is formed by concatenating the values of anchorPrefix and anchor. If anchorPrefix is specified but anchor is not, the anchor is formed by concatenating the values of anchorPrefix and heading. Useful in conjunction with AlphanumericTOC's prefixLink parameter. None
headingSuffix Suffix added to the heading text. The value of headingSuffix is not included in the anchor, regardless of the value of anchor. None

[edit] Examples

Code Displayed As Anchor
{{PseudoHeading|heading=A}}
A
A
{{PseudoHeading|heading=Works by Isaac Asimov - A|anchor=AsimovA}}
Works by Isaac Asimov - A
AsimovA
{{PseudoHeading|heading=A|anchorPrefix=Asimov}}
A
AsimovA
{{PseudoHeading|heading=A|headingSuffix=:}}
A:
A
{{PseudoHeading|heading=#|anchor=Numbers|anchorPrefix=Asimov|headingSuffix=:}}
#:
AsimovNumbers

[edit] Example using {{AlphanumericTOC}}

Code:


'''Selected Works by Isaac Asimov'''
{{AlphanumericTOC|notoc=|prefixLink=SelectedAsimov|nobreak=|sections=|}}
{{PseudoHeading|heading=A|anchorPrefix=SelectedAsimov|headingSuffix=:}}
* All the Troubles of the World
* Asimov on Science Fiction
{{PseudoHeading|heading=B|anchorPrefix=SelectedAsimov|headingSuffix=:}}
* Bicentennial Man, The
{{PseudoHeading|heading=C|anchorPrefix=SelectedAsimov|headingSuffix=:}}
* Case of Steel, The
* Complete Robot, The
* Currents of Space, The


Result:

Selected Works by Isaac Asimov

Contents: 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
A:
  • All the Troubles of the World
  • Asimov on Science Fiction
B:
  • Bicentennial Man, The
C:
  • Case of Steel, The
  • Complete Robot, The
  • Currents of Space, The