A page can be divided into sections, using the section header syntax.
Contents |
[edit] Creation and numbering of sections
Sections are created by creating their headers, as below:
==Section== ===Subsection=== ====Sub-subsection====
Please do not use only one equals sign on a side (=text here=); this causes a title the size of the page name, which is taken care of automatically.
With the preference setting Auto-number headings sections can be numbered automatically.
[edit] Table of contents (TOC)
For each page with more than three headings, a table of contents (TOC) is automatically generated from the section headings, unless:
- (for a user) preferences are set to turn it off
- (for an article) in the edit box the magic word __NOTOC__ is added
With __FORCETOC__ or __TOC__ in the wikitext a TOC is added even if the page has fewer than four headings.
With __FORCETOC__, the TOC is put before the first section header. With __TOC__, it is put at the position of this code. This allows any positioning (e.g., on the right, in a table cell) and even allows multiple occurrence.
[edit] Section linking
It is possible to link directly to a section. The Table of Contents does this automatically (i.e., if you click on a section name in the TOC it will take you to the appropriate section on the page).
To link to a section manually, you use a typical internal link but add #section name after the page name. For example, a link to this section (Section Linking) looks like this:
[[Help:Section#Section_linking|Section Linking]]
If the section link is to a section on the same page, you don't need to include the page name. For example, to link to this section you could just type [[#Section_linking|Section Linking]] to get this: Section Linking.
An underscore and number are appended to duplicate section names. E.g. for three sections named "Example", the names (for section linking) will be "Example", "Example_2" and "Example_3".
Note that using the date formatting feature in section headers complicates section linking.
[edit] Section linking and redirects
When you link to a section of a redirected page, the link will take you to the top of the page, but not the specific section. For this reason, you should link to the original page (not the redirect page) when linking to sections.
If a section is renamed, links that point to it will no longer work. Instead, a person will be taken to the top of the appropriate page.
[edit] "See also" line or section
If a page consists of sections and a "see also" refers to the whole page, then make it a separate section. This is to avoid it becoming part of the prior section, to make it visible in the TOC, and to make it easily accessible through the TOC.
Alternatively, a "see also" line is sometimes put at the beginning.
A "see also" belonging to just one section can be put in that section: within a paragraph, as a separate paragraph, or as a subsection.
[edit] Sections vs. separate pages
Advantages of separate pages:
- separate edit histories
- automatic redirect on renaming
- redirect to a section is not possible
- loading a small page is faster than loading a large page
- can separately be put in categories or linked to from other pages
Advantages of one large page with sections:
- loading one large page is faster and more convenient than loading several small ones
- searching within one large page (the page itself or the wikitext) with a local search function is faster and in some respects better than searching several pages (for which one has to search the whole project); also the TOC provides for convenient navigation.
- enforces the cohesion of a concept that while having several definitions needs independent editing.
[edit] Section related preferences
The following personal preferences can be set.
[edit] Editing Tab Preferences
- Enable section editing via [edit] links. If this is checked then sections within a page can be edited (by clicking on the [edit] link to the right of the section header.
- Enable section editing by right clicking on section titles (JavaScript). Requires that your browser supports JavaScript.
[edit] Misc Tab Preferences
- Auto-number headings. When checked you will see numbers before each page section. They will match those that are in the Table of Contents.
- Show table of contents (for articles with more than 3 headings).
GIST Support Wiki