Jump to content

Manual: Tabela de Conteúdos

From mediawiki.org
This page is a translated version of the page Manual:Table of contents and the translation is 61% complete.
Esta página é sobre as tabelas de conteúdos nas páginas wiki. Para a página de conteúdos do manual técnico da MediaWiki, consulte Manual: Conteúdos .

Por predefinição, uma tabela de conteúdos (por vezes abreviada para TOC) é gerada automaticamente numa página quando são utilizados mais de três cabeçalhos.

Normalmente, a tabela reproduz e numera estes cabeçalhos.

Todo o HTML nos cabeçalhos é removido na TOC, exceto as seguintes etiquetas:

  • ‎<sup>, ‎<sub>[1]
  • ‎<i>[2]
  • ‎<b>[3]
  • ‎<bdi>[4]
  • <span dir="rtl">, <span dir="ltr">[5]
  • ‎<s>, ‎<strike>[6]
  • ‎<q>[7]

A tabela de conteúdos não é gerada para os cabeçalhos da secção que são encontrados dentro das etiquetas html (Manual:$wgRawHtml ).

Ocultar a TOC

Coloque __NOTOC__ em qualquer parte da página para ocultar a sua TOC.

Using certain templates, such as Template:Compact ToC (found on English Wikipedia), will replace the regular Table of Contents functionality.

Posicionar a TOC

A posição predefinida da TOC é logo diretamente por cima do primeiro cabeçalho da secção. Qualquer texto anterior é colocado antes da TOC. Para a colocar noutra posição, utilize a palavra mágica __TOC__ na posição desejada da página.

O tema poderá remover ou mover a tabela de conteúdos para outra secção da página utilizando Extension:DeToc .

Adicionar a TOC

If you have three or fewer headings but want to have a TOC, write either the magic word __FORCETOC__ anywhere on the page to make it display at the default location, or __TOC__ at the preferred position.

Personalizar a TOC

Profundidade

The maximum level of headings displayed on the TOC is defined in $wgMaxTocLevel . To customize this for individual pages, the TOC can be enclosed in an element with class toclimit-<limit>, if the appropriate CSS rules are defined in the page's CSS.

See Template:TOC and the relevant rules at Template:TOC/limit-styles.css for an example implementation.

Numeração automática

Por predefinição, a TOC numera automaticamente as secções. Os próprios cabeçalhos da secção não são numerados. This behavior of the table of contents can be customised in several ways:

  • It is possible to suppress the auto-generated section numbers in the TOC, if the proper class exists locally at MediaWiki:Common.css, defined as .tocnumber { display: none; }.

To do this selectively, a wrapper element can be placed around the TOC, as in <div class="noautonum">__TOC__</div> on the page, and .noautonum .tocnumber { display: none; } at MediaWiki:Common.css.

It is also possible to add numbering to headings themselves using JavaScript, as explained at Snippets/Auto-number headings .

Internacionalização

Different languages have different ways of expressing TOCs and how its (sub)section numbering is done. Also, the different style guides of many languages differ in what style of TOC and TOC (sub)section numbering scheme they recommend for writers to use.

The different style guides of each language sometimes recommend different typographic conventions to follow.

It's important to note that most languages don't even have any style guide for writing in that language (and many languages don't have a written form entirely), so people usually use the most common style based on existing written convention (not prescribed, but simply 'standard' due to popular usage), which makes the written use of many languages have a sort of 'fluid' punctuation, spelling/orthography and even [personal changes of the very] grammar [of that particular language]. Westernization has influenced alphabet and non-alphabet writing systems, with many languages simply copying or being artificially converted to European-style typographic and punctuational conventions.

An example on how to change the style of a TOC to a localized one is given below:

Some languages put a dot after a (sub)section ordinal number, e.g. they do not use the following TOC style:

Contents
1 Section [1]
1.1 Subsection [1.1]
2 Section [2]
2.1 Subsection [2.1]
3 Section [3]
3.1 Subsection [3.1]
3.1.1 Subsubsection [3.1.1]
3.1.2 Subsubsection [3.1.2]

But use one like so:

Contents
1. Section [1.]
1.1. Subsection [1.1.]
2. Section [2.]
2.1. Subsection [2.1.]
3. Section [3.]
3.1. Subsection [3.1.]
3.1.1. Subsubsection [3.1.1.]
3.1.2. Subsubsection [3.1.2.]

(Notice the addition of dots after ordinal numerals before the section names!)

It's possible to produce that effect using w:CSS. Put the following CSS code in a shared CSS file of your MediaWiki installation and it should work:

.tocnumber:after { content: '.' }

where the symbol between the single quotation marks is the sign after a (sub)section number.

Also, see bugzilla:43494 and bugzilla:33450 for details on related i18n problems of TOCs.

Largura

An extenuating circumstance may require the width of a TOC to be adjusted as a percentage of a page. For example:

{{TOC left|width=30%}}

Flutuar

The TOC can be made to display as a floating element on the page, with text flowing around it.

For this, enclose the TOC in an element with the CSS style float:left; or float:right;.

Consulte Template:TOC para um exemplo da implementação.

Extensões

O comportamento da tabela de conteúdos pode ser ajustada ainda mais utilizando as extensões.

Consulte Categoria: Extensões da TOC para uma lista.

Consultar também

  1. ↑ A partir do MediaWiki 1.11 (setembro de 2007). Consulte phab:T10393.
  2. ↑ A partir do MediaWiki 1.19 (novembro de 2011). Consulte phab:T28375.
  3. ↑ A partir do MediaWiki 1.19 (dezembro de 2011). Consulte phab:T28375.
  4. ↑ Do MediaWiki 1.25/wmf14 (). Consulte phab:T74884.
  5. ↑ Do MediaWiki 1.21/wmf1 (). Consulte phab:T37167.
  6. ↑ Do MediaWiki 1.28/wmf.21 (). Consulte phab:T35715.
  7. ↑ A partir do MediaWiki 1.39.0-wmf.6 (). Consulte phab:T251672.