HPC-MXM:修订间差异

来自云晞维基
跳到导航 跳到搜索
无编辑摘要
Lee讨论 | 贡献
无编辑摘要
第1行: 第1行:
__TOC__
 
<!--T:49-->
<!--T:49-->
The table of contents is not generated for section headings that are found within html tags (<tvar name=1>{{ll|Manual:$wgRawHtml}}</tvar>).
The table of contents is not generated for section headings that are found within html tags (<tvar name=1>{{ll|Manual:$wgRawHtml}}</tvar>).

2023年12月18日 (一) 17:43的版本

The table of contents is not generated for section headings that are found within html tags (<tvar name=1>模板:Ll</tvar>).

Hiding the TOC

Place <tvar name=1>__NOTOC__</tvar> anywhere you want on the page to hide its TOC.

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

Positioning the TOC

</translate> <translate> The default position of the TOC is directly above the first section heading.</translate> <translate> Any prior text is placed before the TOC.</translate> <translate> To place it elsewhere, use the magic word <tvar name=toc></tvar> at the preferred position on the page.</translate>

<translate> A skin may remove or move the table of contents to another section of the page using <tvar name=ext>模板:Ll</tvar>.

Adding the TOC

If you have three or fewer headings but want to have a TOC, write either the magic word <tvar name=forcetoc>__FORCETOC__</tvar> anywhere on the page to make it display at the default location, or <tvar name=toc></tvar> at the preferred position.

Customizing the TOC

Width

</translate> 模板:Notice <translate> An extenuating circumstance may require the width of a TOC width to be adjusted as a percentage of a page.</translate> <translate> For example:</translate> {{TOC left|width=30%}}

<translate>

Depth

</translate> <translate> The maximum level of headings displayed on the TOC is defined in <tvar name=MaxTocLevel>模板:Ll</tvar>.</translate> <translate> To customize this for individual pages, the TOC can be enclosed in an element with class <tvar name=limit>toclimit-<limit></tvar>, if the appropriate CSS rules are defined in the pages CSS.</translate>

<translate> See <tvar name=toc>模板:Ll</tvar> and the relevant rules at <tvar name=Common>Template:TOC/limit-styles.css</tvar> for an example implementation.

Auto-numbering

</translate> <translate> By default, the TOC automatically numbers the sections.</translate> <translate> The section headings themselves aren't numbered.</translate> <translate> This behavior of the table of contents can be customised in several ways:</translate>

<translate>

  • It is possible to suppress the auto-generated section numbers in the TOC, if the proper class exists locally at <tvar name=Common>MediaWiki:Common.css</tvar>, defined as <tvar name=css><syntaxhighlight lang=css inline>.tocnumber { display: none; }</syntaxhighlight></tvar>.

To do this selectively, a wrapper element can be placed around the TOC, as in <tvar name=noauntonum><syntaxhighlight lang=html inline>

</syntaxhighlight></tvar> on the page, and <tvar name=css><syntaxhighlight lang=css inline>.noautonum .tocnumber { display: none; }</syntaxhighlight></tvar> at <tvar name=Common>MediaWiki:Common.css.</tvar>

It is also possible to add numbering to headings themselves using JavaScript, as explained at <tvar name=1>模板:Ll</tvar>.

Internationalization

</translate> <translate> Different languages have different ways of expressing TOCs and how its (sub)section numbering is done.</translate> <translate> 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.</translate>

<translate> The different w:style guides of each language sometimes recommend different typographic conventions to follow. </translate>

<translate> 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].</translate> <translate> 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.</translate>

<translate> 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: </translate>

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]

<translate> But use one like so: </translate>

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.]

<translate> (Notice the addition of dots after ordinal numerals before the section names!)</translate>

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

<syntaxhighlight lang="CSS"> .tocnumber:after { content: '.' } </syntaxhighlight>

<translate> 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.

Floating

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;.

See <tvar name=1>模板:Ll</tvar> for an example implementation.

Extensions

The behavior of the table of contents can be further adjusted using extensions.

See <tvar name=1>模板:Ll</tvar> for a list.

External links

</translate>

[[Category:MediaWiki components{{#translation:}}]]