Podręcznik:Spis treści

From mediawiki.org
This page is a translated version of the page Manual:Table of contents and the translation is 57% complete.
Ta strona dotyczy spisów treści na stronach wiki. Po spis treści podręcznika MediaWiki, zobacz Podręcznik:Spis treści

Domyślnie spis treści (angielski skrót TOC) jest automatycznie generowany, gdy na stronie znajduje się więcej niż trzy nagłówki sekcji.

Zwykle, tabela powtarza je i numeruje.

Cały HTML zawarty w nagłówkach jest usuwany w spisie treści, za wyjątkiem $tags.

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

Spis treści nie jest generowany dla nagłówków, które są zawarte w tagach html (Podręcznik:$wgRawHtml ).

Ukrywanie spisu

Umieść na stronie __NOTOC__ gdziekolwiek chcesz, aby ukryć jej spis treści.

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

Zmiana pozycji spisu

Domyślna pozycja spisu to bezpośrednio nad pierwszym nagłówkiem sekcji. Jakikolwiek wcześniejszy tekst jest umieszczany przed spisem. Każdy wcześniejszy tekst jest umieszczony przed spisem treści. Aby umieścić go gdzieś indziej, użyj magicznego słowa __TOC__ w oczekiwanym miejscu na stronie.

Skórka może usunąć lub przenieść spis treści do innej sekcji strony korzystając z Extension:DeToc .

Dodawanie spisu

Jeżeli masz trzy lub mniej nagłówków, ale chcesz, by mimo to wyświetlał się spis, wpisz magiczne słowo __FORCETOC__ gdziekolwiek w treści strony, aby wyświetlił się w domyślnej lokalizacji, lub __TOC__, aby umieścić go w wybranym miejscu.

Dostosowywanie spisu treści

Szerokość

Okoliczności łagodzące, które mogą wymagać dostosowania szerokość szerokości spisu treści do odsetka strony. Na przykład: {{TOC left|width=30%}}

Głębokość

Maksymalna ilość poziomów nagłówków wyświetlana w spisie treści jest definiowana w $wgMaxTocLevel . Aby dostosować to na poszczególnych stronach, spis treści można zamknąć w elemencie z klasą toclimit-<limit>, jeżeli odpowiednie reguły CSS są zdefiniowane w CSS stron.

Zobacz Template:TOC i odpowiadające reguły w Template:TOC/limit-styles.css jako przykładową implementację.

Automatyczne numerowanie

Domyślnie, w spisie treści sekcje są numerowane. Natomiast same nagłówki sekcji nie są numerowane. To zachowanie spisu treści może być dostosowane na kilka sposobów:

  • Jest możliwe, aby zlikwidować automatycznie wygenerowane numery nagłówków w spisie treści, jeśli odpowiednia grupa lokalnie istnieje w MediaWiki:Common.css, określona jako .tocnumber { display: none; }.

Aby ro zrobić wybiórczo, wokół spisu treści można umieścić element obejmujący, czyli <div class="noautonum">__TOC__</div> na stronie, a .noautonum .tocnumber { display: none; } w MediaWiki:Common.css..

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

Internacjonalizacja

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 w: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]. w:Westernization has influenced alphabet and non-alphabet writing systems, with many languages simply copying or being artificially converted to European-style typographic and w: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.

Oblewanie tekstem

Spis treści może być wyświetlany jako ruchomy element strony, który opływa tekst.

Aby to zrobić, ujmij spis treści w elemencie ze stylem CSS float:left; lub float:right;.

Zobacz Template:TOC aby zobaczyć przykład zaimplementowania.

Rozszerzenia

Zachowanie spisu treści może być dalej dopasowywana za pomocą rozszerzeń.

Zobacz Category:TOC extensions , aby zobaczyć listę.

Linki zewnętrzne

  1. From MediaWiki 1.11 (wrzesień 2007). See phab:T10393.
  2. From MediaWiki 1.19 (listopad 2011). See phab:T28375.
  3. From MediaWiki 1.19 (grudzień 2011). See phab:T28375.
  4. From MediaWiki 1.25/wmf14 (). See phab:T74884.
  5. From MediaWiki 1.21/wmf1 (). See phab:T37167.
  6. From MediaWiki 1.28/wmf.21 (). See phab:T35715.
  7. From MediaWiki 1.39.0-wmf.6 (). See phab:T251672.