MediaWiki User Guide/Sections and Headings

From Wikibooks, open books for an open world
Jump to: navigation, search

Headings are created using sequences of "=" characters, placed before the heading title and after the heading title, on the same line. The level of headings is determined by the number of "=" characters.

Examples:

Level Example
2. ==Plants==
3. ===Plants===
4. ====Plants====

Start level: 2[edit]

Do not use headings of level 1, such as "=Title="; start with level 2 instead. The heading at level 1 is used for the title of the page.

Maximum level: 6[edit]

The maximum level of a heading is 6, rendered using ======Heading L6======. Entering a heading with 7 equals-signs such as =======Heading L7======= results in the creation of a heading of the level 6, with one equal-sign becoming part of the text of the heading: "=Heading L7=".

Spaces[edit]

Depending on the convention that users and editors adopt, there can be any number of spaces between the "=" characters and the title.

An example without spaces:

==Plants==

An example with spaces:

== Plants ==

Table of contents[edit]

By default, the titles of headings appear in the table of contents, shown at the top of the page. To prevent having a table of contents, put the "__NOTOC__" sequence of characters into the page. To force the presence of table of contents on a specific place of the page, use "__TOC__".

Headings not in TOC[edit]

There is no simple way to make a heading not appear in the table of contents. For a complex way requiring the adjustment of the MediaWiki software, see Meta:Help:Section.

Customizing TOC[edit]

There are various ways how to customize the table of contents. For instance, to place it to the right, use:

<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div>

Editability of sections[edit]

By default, all sections are editable separately, without the need to see the complete text of the page.

To make all the sections on a page non-editable, place __NOEDITSECTION__ anywhere on the page.

There is no simple way to make a single section non-editable, AFAIK.

Bibliography[edit]