“Formating”的版本间差异

来自广财百科
跳到导航 跳到搜索
Ypy讨论 | 贡献
 
(未显示2个用户的6个中间版本)
第1行: 第1行:
{{NoteTA
==布局== <!--T:1-->
|G1=IT
|G2=MediaWiki
}}
{{for|Wiki標記式語言在百科全書中的說明|Wiki}}
{{Wikipedia how to|H:MARKUP|H:WIKICODE}}


'''Wiki標記式語言''',又稱'''Wiki語法''',包含了許多參數與關鍵字,可將[[MediaWiki]]軟體內的頁面進行格式的編排。關於如何閱讀這種標記式語言,以及如何儲存編輯,請參考[[Help:編輯]]。一般而言,這些語法可以不用重新撰寫而能夠複製與貼上。[[Wikipedia:備忘單]]列出了關於本語法的相關提示。


除了Wiki標記式語言外,部分[[HTML元素]]也能夠進行格式編排。相關資訊請參考[[Help:HTML]]。
==基本语法== <!--T:1-->
{{TOC limit}}
===标题=== <!--T:2-->
 
<syntaxhighlight line='line'>
==佈局==
==二级标题==
<!--{{VE documentation}} Over prominent and confusing -->
===三级标题===
 
===章節===
 
一份頁面的章節應遵循頁面的[[WP:LEAD|序言章節]]以及(在特定情形下)[[WP:TOC|章節目錄]]規範。
 
====章節標題====
{{see|Help:章節|WP:MOSHEAD}}
 
「<code>=</code>」至「<code>======</code>」標記為章節的標題語法,彼此具有關連性。
* 一個單一的「=」被規定為條目的標題,不應用於條目內容。
* 標題的樣式由[[CSS]]規範並增加一個「<code>[編輯]</code>」連結。相關的CSS語法請[[Help:层叠样式表|參考這裡]]。
* 四個以上的章節標題會自動生成章節目錄。
* 不得在標題語法最後使用'''任何'''語法,這將會導致章節標題格式消失,或是無法在編輯摘要中自動包含章節標題名稱。
 
{{tl|fake heading}}用於模板等說明文件。
 
====水平線====
 
水平線代表章節層級主題的終止。請不要使用於條目內容,因為該語法僅能用於主要章節之後,而且會自動生成。
 
{{markup
|<nowiki>----</nowiki>
|{{crlf2}}
----
}}
 
HTML等效語法:{{tag|hr|s}}
 
====目錄表====
{{see|WP:TOC}}
 
當某個頁面包含4個以上的章節標題時,將會在首段與第一個章節標題之間自動生成章節目錄。章節目錄可由魔術字或模板控制:
* 「<code><nowiki>__FORCETOC__</nowiki></code>」將強制章節目錄自動顯示於正常位置,無論章節標題數量為何。
* 「<code><nowiki>__TOC__</nowiki></code>」將會使章節目錄從正常位置移動到魔術字插入的位置。
* 「<code><nowiki>__NOTOC__</nowiki></code>」將會不顯示章節目錄。
* 「{{tl|TOC limit}}」可用於控制章節目錄所包含的章節層級,當某個條目的章節數量與層級太多時非常有用。
* [[:Category:目錄模板]]包含特定的章節目錄模板。
 
===斷行===
<!--[[Help:Breaks]] links directly here.-->
 
斷行或是產生新行藉由在兩行之間增加空白而生成,例如分開段落。
* 在條目內容內顯示一個明顯的斷行,請輸入兩次{{key press|Enter}}。
* 輸入一次{{key press|Enter}}只會在標記式語言編輯畫面中顯示為斷行,但輸出內容中只会形成一个空格。使用清單語法时例外。
* 粗體或斜體等標記式語言會在斷行處終結。
 
{{markup
|<nowiki>在此處進行一次斷行
不會影響輸出格式。
 
但空出一行代表新段落的開始,
或是某個清單或縮排內容的終止。
</nowiki>
|{{crlf2}}
在此處進行一次斷行
不會影響輸出格式。
 
但空出一行代表新段落的開始,
或是某個清單或縮排內容的終止。
}}
 
HTML等效語法:{{tag|br|o}}或{{tag|br|s}}。
 
模板:
* 「{{tl|break}}」可增加多個斷行。
* 「{{tl|-}}」與「{{tl|clear}}」可增加樣式方面的斷行,以終止浮動元素的適用。
* 「{{tl|plainlist}}」與「{{tl|unbulleted list}}」兩者可增加一份沒有項目符號的清單。
 
===文字縮排===
文字縮排最常用於討論頁面。
 
{{markup
|<nowiki>縮排用於討論頁面的方式:
:每個半形冒號必需顯示於每行的開頭
::這將會使每行產生至少3個字元以上的縮排。
:::(只要不使用換行或斷行,
縮排仍然會存在。)
:::在任何斷行以後,仍可重複縮排。
::::可在每個回應增加一個額外的半形冒號。
:::::就像這樣.....
::::::依此類推.....
{{Outdent|::::::}}Outdent模板可以給予刻意取消縮排的一個視覺指示(此處為刻意取消6層縮排)</nowiki>
|縮排用於討論頁面的方式:
:每個半形冒號必需顯示於每行的開頭
::這將會使每行產生至少3個字元以上的縮排。
:::(只要不使用換行或斷行,
縮排仍然會存在。)
:::在任何斷行以後,仍可重複縮排。
::::可在每個回應增加一個額外的半形冒號。
:::::就像這樣.....
::::::依此類推.....
{{Outdent|::::::}}Outdent模板可以給予刻意取消縮排的一個視覺指示(此處為刻意取消6層縮排)
}}
 
模板:{{tl|outdent}}、{{tl|outdent2}}
 
===區塊引言===
 
如有需要將文字獨立為區塊時可以使用。就如同字面所說,這對於插入一份引言或引用文字而言非常有用。
{{markup
|<nowiki><blockquote>
'''區塊引言'''標籤會在需要時兩邊同時進行縮排,不像半形冒號只針對左方進行縮排。
</blockquote>
</nowiki>
|<blockquote>
'''區塊引言'''標籤會在需要時兩邊同時進行縮排,不像半形冒號只針對左方進行縮排。
</blockquote>
}}
 
===文字置中===
 
{{markup
|<syntaxhighlight lang="html" inline style="border:none; background:transparent;"><div class="center" style="width: auto; margin-left: auto; margin-right: auto;">置中的文字</div></syntaxhighlight>
|2=<div class="center" style="width: auto; margin-left: auto; margin-right: auto;">置中的文字</div>
}}
 
{{tl|center}}模板也能達到上述語法的效果。如果要將表格置中,請參考[[Help:表格#表格居中]]。請不要使用{{tag|center}},因為該標籤已過時。
 
===文字靠右===
 
您可以將靠右的內容放入獨立的容器中:
 
{{markup
|1=<syntaxhighlight lang="html" inline style="border:none; background:transparent;"><div style="text-align: right; direction: ltr; margin-left: 1em;">靠右的文字</div></syntaxhighlight>
|2=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.<div style="text-align: right; direction: ltr; margin-left: 1em;">靠右的文字</div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
}}
 
或者您可以讓文字以浮動方式顯現:
 
{{markup
|1=<syntaxhighlight lang="html" inline style="border:none; background:transparent;"><div class="floatright">靠右的文字</div></syntaxhighlight>
|2=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.<div class="floatright">靠右的文字</div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
 
|3=<nowiki>{{stack|靠右的文字}}</nowiki>
|4=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.{{stack|靠右的文字}}Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
}}
 
===列表===
{{see|Help:列表|WP:LIST}}
 
除非有理由,否則不要在同一列表內的項目之間加入空白行,因為這將會導致MediaWiki軟體判定空白行後面的項目為新列表的開頭。
 
====無序號列表====
 
{{markup
|<nowiki>* 項目1
* 項目2
* 項目3
* 項目4
** 子項目 4 a)
*** 子項目 4 a) 1.
**** 子項目 4 a) 1. i)
**** 子項目 4 a) 1. ii)
** 子項目 4 b)
* 項目5</nowiki>
|{{crlf2}}
* 項目1
* 項目2
* 項目3
* 項目4
** 子項目 4 a)
*** 子項目 4 a) 1.
**** 子項目 4 a) 1. i)
**** 子項目 4 a) 1. ii)
** 子項目 4 b)
* 項目5
}}
 
====有序號列表====
 
{{markup
|<nowiki>
# 項目1
# 項目2
# 項目3
# 項目4
## 子項目 1
### 子子項目
#### 子子子項目
## 子項目 2
# 項目5
</nowiki>
|{{crlf2}}
# 項目1
# 項目2
# 項目3
# 項目4
## 子項目 1
### 子子項目
#### 子子子項目
## 子項目 2
# 項目5
}}
 
===={{Anchor|DL}}描述列表====
{{anchors|定義 lists|Association lists|H:DL}}
{{Shortcut|H:DL}}
 
如果需要列出術語及定義,請使用半形分號在術語之前。接者在定義前面放上半形冒號。這種格式可用於其他目的,例如車輛型號介紹等。
 
'''描述列表'''<!--HTML5 name-->(前稱'''定義列表'''<!--HTML4 name-->,也就是'''關連列表'''<!--draft HTML5 name-->)由群組名稱與對應的值所組成。群組名稱(術語)為粗體,值(定義)則進行縮排。每個群組'''必需'''包含一個以上的定義。對於單一值或第一個值,可將「<code>:</code>」放置於「<code>;</code>」所在行之後──但隨後的值必需各自獨立成一行。
 
{{hatnote-inline|不要將半形分號用於文字粗體化而不使用半形冒號定義一個值。這種用法將會造成[[HTML5]]無效,並會在[[螢幕閱讀器]]上產生問題。}}
 
{{markup
|<nowiki>; 術語 : 定義1</nowiki>
|{{crlf2}}
; 術語 : 定義1
|<nowiki>; 術語
: 定義1
: 定義2
: 定義3
: 定義4</nowiki>
|{{crlf2}}
; 術語
: 定義1
: 定義2
: 定義3
: 定義4
}}
 
HTML等效語法:{{tag|dl|o}} {{tag|dt}}、{{tag|dd}} {{tag|dl|c}}
 
模板:{{tl|defn}}
 
===保留換行與空白===
{{shortcut|H:POEM}}
 
MediaWiki預設無法使用單次換行,並將以空格為開頭的單行文字轉換成虛線文字方塊。HTML則無法使用多個空白。通常詩句、歌詞、格言、誓詞或類似內容會需要保留這些元素。[[mw:Extension:Poem|詩詞]]擴展元素增加了類HTML的{{tag|poem}}標籤來保留換行與空白特色。這對標籤可以用在其他標籤當中,如{{tag|blockquote}};而{{tlx|poemquote}}提供較為方便的使用途徑。本標籤也適用[[H:CSS|CSS風格]],如<code><nowiki><poem style="margin-left: 2em;"></nowiki></code>。
 
{{markup
|<nowiki><poem>
In Xanadu did Kubla Khan
  A stately pleasure-dome decree:
Where Alph, the sacred river, ran
  Through caverns measureless to man
Down to a sunless sea.
 
So twice five miles of fertile ground
  With walls and towers were girdled round:
And there were gardens bright with sinuous rills,
  Where blossomed many an incense-bearing tree;
And here were forests ancient as the hills,
  Enfolding sunny spots of greenery.
</poem></nowiki>
|<poem>
In Xanadu did Kubla Khan
  A stately pleasure-dome decree:
Where Alph, the sacred river, ran
  Through caverns measureless to man
Down to a sunless sea.
 
So twice five miles of fertile ground
  With walls and towers were girdled round:
And there were gardens bright with sinuous rills,
  Where blossomed many an incense-bearing tree;
And here were forests ancient as the hills,
  Enfolding sunny spots of greenery.
</poem>
}}
 
詩詞以及其翻譯可以用兩側對照方式呈現,其對譯語言以<code>lang="xx"</code>標明。在最後一個兩側對照區段以後,必需使用{{tlx|Clear|left}}模板來取消<code>"float:left;"</code>並回復成正常模式。請注意本方法不需要使用[[#表格|表格]],此法將會自己生成多個翻譯對照的欄位。
 
'''程式碼'''
<pre><nowiki><poem lang="fr" style="float:left;">Frère Jacques, frère Jacques,
Dormez-vous? Dormez-vous?
Sonnez les matines! Sonnez les matines!
Ding, dang, dong. Ding, dang, dong.</poem>
<poem style="margin-left:2em; float:left;">賈克修士,賈克修士,
您在睡覺嗎?您在睡覺嗎?
快去敲做日課的鐘!快去敲做日課的鐘!
叮,叮,鐺。叮,叮,鐺。</poem>{{Clear|left}}</nowiki></pre>
'''效果'''
<poem lang="fr" style="float:left;">Frère Jacques, frère Jacques,
Dormez-vous? Dormez-vous?
Sonnez les matines! Sonnez les matines!
Ding, dang, dong. Ding, dang, dong.</poem>
<poem style="margin-left:2em; float:left;">賈克修士,賈克修士,
您在睡覺嗎?您在睡覺嗎?
快去敲做日課的鐘!快去敲做日課的鐘!
叮,叮,鐺。叮,叮,鐺。</poem>{{Clear|left}}
 
==格式==
 
===文字格式===
 
{| class="wikitable"
|- style="vertical-align: top;"
!style="width:34%;"| 描述
!style="width:33%;"| 輸入內容
!style="width:33%;"| 輸出結果
 
<!---------- italics, bold, smallcaps ----------->
|- id="emph" style="vertical-align: top;"
|
''斜體''、'''粗體'''、小型大寫字體({{smallcaps|small caps}})
|
<pre>
如果要''將文字斜體化'',請在文字兩側放上2個連續的半形撇號。
 
兩側放上3個半形撇號將會'''使文字變粗體'''。
 
兩側放上5個連續半形撇號(2個撇號為斜體,3個撇號為粗體)將會形成'''''粗斜體'''''。
 
'''''粗體與斜體格式'''''只能在單行以內正確顯示。
 
如果要產生小型大寫字體({{smallcaps|small caps}}),請使用{{tl|smallcaps}}模板。
</pre>
|
如果要''將文字斜體化'',請在文字兩側放上2個連續的半形撇號。
 
兩側放上3個半形撇號將會'''使文字變粗體'''。
 
兩側放上5個連續半形撇號(2個撇號為斜體,3個撇號為粗體)將會形成'''''粗斜體'''''。
 
'''''粗體與斜體格式'''''只能在單行以內正確顯示。
 
如果要產生小型大寫字體({{smallcaps|small caps}}),請使用{{tl|smallcaps}}模板。
 
如果要在粗體或斜體文字中還原為正常格式,請使用{{tl|nobold}}與{{tl|noitalic}}。
 
<!------------- inline source code -------------->
|-
|
單行普通文字當中的一小句[[原始碼]]。
 
原始碼會採用[[等寬字體]]顯示。
|
<pre><nowiki><code>int m2()</code>功能很好。</nowiki></pre>
|
<code>int m2()</code>功能很好。
 
<!------------ syntax highlighting -------------->
|- style="vertical-align:top;"
|
針對原始碼進行[[mw:Extension:SyntaxHighlight|突顯參數]]。
 
電腦原始碼具有上色文字以及更嚴謹的格式。舉例,函數<code>int m2()</code>會有其自身的上色定義。
 
對於所有支援此功能的程式語言列表,請參考[https://github.com/wikimedia/mediawiki-extensions-SyntaxHighlight_GeSHi/blob/master/SyntaxHighlight.lexers.php 這裡],其語言-{zh-hant:代碼;zh-hans:代码;}-需放置在<code>lang="????"</code>。
|
<pre><nowiki><syntaxhighlight lang="cpp">
#include <iostream>
int m2 (int ax, char *p_ax) {
  std::cout <<"Hello World!";
  return 0;
}</syntaxhighlight></nowiki></pre>
或是(產生效果實際上一模一樣)
<pre><nowiki><source lang="cpp">
#include <iostream>
int m2 (int ax, char *p_ax) {
  std::cout <<"Hello World!";
  return 0;
}</source></nowiki></pre>
|
<syntaxhighlight lang="cpp">
#include <iostream>
int m2 (int ax, char *p_ax) {
  std::cout <<"Hello World!";
  return 0;
}</syntaxhighlight>
 
<!---------------- <small> text ----------------->
|-
|
<small>小型字</small>
|
<syntaxhighlight lang="html">
只能在有需要時使用<small>小型字</small>標籤。
</syntaxhighlight>
</syntaxhighlight>
|
只能在有需要時使用<small>小型字</small>標籤。


<!---------------- <small> span ----------------->
===换行=== <!--T:2-->
|-
<syntaxhighlight lang="html" line='line'>
|
<br />
<small style="font-size:87%;">一段<nowiki><small></nowiki>標籤的跨度</small>
|
<syntaxhighlight lang="html">
舉例,如果要符合{{le|Help:視覺檔案標記語言#圖說|Help:Visual file markup#Caption|圖像說明}}的文字大小,其「small」標籤也可以用於
<small style="font-size:87%;">縮減文字大小至原來的87%</small>
</syntaxhighlight>
</syntaxhighlight>
|
舉例,如果要符合{{le|Help:視覺檔案標記語言#圖說|Help:Visual file markup#Caption|圖像說明}}的文字大小,其「small」標籤也可以用於<small style="font-size:87%;">縮減文字大小至原來的87%</small>。


<!----------------- <big> text ------------------>
===删除线=== <!--T:2-->
|-
<syntaxhighlight lang="html" line='line'>
|
<s>删除的文字</s>
<big>大型字</big>
|
<syntaxhighlight lang="html">
最好不要使用<big>大型字</big>,除非用於<small>一段<big>小型字</big>當中</small>
</syntaxhighlight>
</syntaxhighlight>
|
最好不要使用<big>大型字</big>,除非用於<small>一段<big>小型字</big>當中</small>。
<!-------------------- nbsp --------------------->
|-
|
To prevent two words from becoming separated by a [[linewrap]] (e.g. ''Mr.&nbsp;Smith'' or ''400&nbsp;km/h'') a '''[[non-breaking space]]''', sometimes also called a "non-printing character", may be used between them. (For three or more words, the template {{tl|nowrap}} is probably more suitable.)
|
<pre>Mr.&amp;nbsp;Smith or 400&amp;nbsp;km/h</pre>
|
Mr.&nbsp;Smith or 400&nbsp;km/h
<!------------------- {{pad}} ------------------->
|-
|
在文字中實現'''額外間距''',通常最好的方法是使用{{tl|pad}}模板。
|
<pre><nowiki>瑪麗{{pad|4.0em}}有隻小綿羊。</nowiki></pre>
|
瑪麗{{pad|4.0em}}有隻小綿羊。
<!---------- (<kbd>)
|-
|
'''Typewriter text'''<br><br>
(Also works beyond the end of a paragraph.)
|
<pre><nowiki><kbd>right arrow    →</kbd>
<kbd>''italics'', '''bold'''</kbd>
<kbd>[[wikilink]]
New paragraph </kbd>started here.</nowiki></pre>
|
<pre><kbd>right arrow    →</kbd>
<kbd>''italics'', '''bold'''</kbd>
<kbd>[[wikilink]]
New paragraph </kbd>started here.</pre>
----->
|}
===特殊字元===
{{See also|Help:特殊字母與符號|XML與HTML字符實體引用列表}}
Special characters can often be displayed using [[Numeric character reference|numeric character references]] or [[List of XML and HTML character entity references|character entity references]]. See [[Character encodings in HTML]] for more information. For example, <code>&amp;Agrave;</code> and <code>&amp;#xC0;</code> both render [[&Agrave;]] (A-[[Grave accent|grave]]). [[Percent-encoding]] can't be used, as it works only in [[URL]]s.
====變音符號====
[[Diacritic]] marks, using character entity references.
{| class="wikitable"
! What you type
! What it looks like
|-
|
<pre><nowiki>&amp;Agrave; &amp;Aacute; &amp;Acirc; &amp;Atilde; &amp;Auml; &amp;Aring; &amp;AElig;
&amp;Ccedil; &amp;Egrave; &amp;Eacute; &amp;Ecirc; &amp;Euml;
&amp;Igrave; &amp;Iacute; &amp;Icirc; &amp;Iuml; &amp;Ntilde;
&amp;Ograve; &amp;Oacute; &amp;Ocirc; &amp;Otilde; &amp;Ouml; &amp;Oslash; &amp;OElig;
&amp;Ugrave; &amp;Uacute; &amp;Ucirc; &amp;Uuml; &amp;Yuml; &amp;szlig;
&amp;agrave; &amp;aacute; &amp;acirc; &amp;atilde; &amp;auml; &amp;aring; &amp;aelig; &amp;ccedil;
&amp;egrave; &amp;eacute; &amp;ecirc; &amp;euml;
&amp;igrave; &amp;iacute; &amp;icirc; &amp;iuml; &amp;ntilde;
&amp;ograve; &amp;oacute; &amp;ocirc; &amp;otilde; &amp;ouml; &amp;oslash; &amp;oelig;
&amp;ugrave; &amp;uacute; &amp;ucirc; &amp;uuml; &amp;yuml;</nowiki></pre>
|
À Á Â Ã Ä Å Æ
Ç È É Ê Ë
Ì Í Î Ï Ñ
Ò Ó Ô Õ Ö Ø Œ
Ù Ú Û Ü Ÿ ß
à á â ã ä å æ ç
è é ê ë
ì í î ï ñ
ò ó ô õ ö ø œ
ù ú û ü ÿ
|}
====Punctuation special characters====
Using character entity references.
{| class="wikitable"
! What you type
! What it looks like
|-
|<code>&amp;iquest; &amp;iexcl; &amp;sect; &amp;para;</code>
|¿ ¡ § ¶
|-
|<code>&amp;dagger; &amp;Dagger; &amp;bull; &amp;ndash; &amp;mdash;</code>
|† ‡ • &ndash; &mdash;
|-
|<code>&amp;lsaquo; &amp;rsaquo; &amp;laquo; &amp;raquo;</code>
|‹ › « »
|-
|<code>&amp;lsquo; &amp;rsquo; &amp;ldquo; &amp;rdquo;</code>
|&lsquo; &rsquo; &ldquo; &rdquo;
|-
|<code>&amp;apos; &amp;quot;</code>
|&apos; &quot;
|}
====Escaping punctuation characters====
The [[#Pre|{{tag|pre|o}}]], [[#Nowiki|{{tag|nowiki|o}}]], and  [[#Code|{{tag|code|o}}]]  markup tags are also available, for writing <nowiki>"[", "{", "&", "}", "]"</nowiki> for example. These tags prevent these characters from being recognised as wiki markup, which is a possibility in some circumstances.
====商業符號====
使用下列的字元來引用商業符號。
{| class="wikitable"
! 輸入內容
! 輸出結果
|-
|<code>&amp;trade; &amp;copy; &amp;reg; </code>
|™ © ®
|-
|<code>&amp;cent; &amp;euro; &amp;yen; &amp;pound; &amp;curren;</code>
|¢ € ¥ £ ¤
|}
====希臘字母====
使用下列的字元來引用希臘字母。
{| class="wikitable"
! 輸入內容
! 輸出結果
|-
|<code>&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta; </code>
|α β γ δ ε ζ
|-
|<code>&amp;Alpha; &amp;Beta; &amp;Gamma; &amp;Delta; &amp;Epsilon; &amp;Zeta;</code>
|Α Β Γ Δ Ε Ζ
|-
|<code>&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu;</code>
|η θ ι κ λ μ ν
|-
|<code>&amp;Eta; &amp;Theta; &amp;Iota; &amp;Kappa; &amp;Lambda; &amp;Mu; &amp;Nu; </code>
|Η Θ Ι Κ Λ Μ Ν
|-
|<code>&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;</code>
|ξ ο π ρ σ ς
|-
|<code>&amp;Xi; &amp;Omicron; &amp;Pi; &amp;Rho; &amp;Sigma; </code>
|Ξ Ο Π Ρ Σ
|-
|<code>&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;</code>
|τ υ φ χ ψ ω
|-
|<code>&amp;Tau; &amp;Upsilon; &amp;Phi; &amp;Chi; &amp;Psi; &amp;Omega; </code>
|Τ Υ Φ Χ Ψ Ω
|}
====埃及象形文字====
{{main|Help:WikiHiero語法教學}}
WikiHiero是一種軟體擴充元件,可以使用{{xtag|hiero}}標籤來產生[[埃及象形文字]]的PNG圖片。
舉例:
{{markup
|<nowiki><hiero>P2</hiero></nowiki>
|<hiero>P2</hiero>
}}
====國際象棋符號====
{{main|{{le|Unicode中的國際象棋符號|Chess symbols in Unicode}}}}
舉例,「&amp;#9812;」將會產生&#9812;。
====上標與下標====
* [[Wikipedia:格式手册/数学#上下标|格式手冊]]推薦使用{{tag|sub|o}}與{{tag|sup|o}}格式,例如 <code>x{{tag|sub|content=1}}</code>。本格式應使用於大多數情況。
* 下表所列出的第二種上標與下標方式,不能用於絕大多數內容,這必需仰賴Unicode的支援,並非所有使用者的機器能正確顯示。
{| class="wikitable"
! 描述
! 輸入內容
! 輸出結果
|-
|
上標
|
<pre><nowiki>
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub> 或
x&amp;#8320; x&amp;#8321; x&amp;#8322; x&amp;#8323; x&amp;#8324;
x&amp;#8325; x&amp;#8326; x&amp;#8327; x&amp;#8328; x&amp;#8329;
</nowiki></pre>
|
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub> 或
x₀ x₁ x₂ x₃ x₄
x₅ x₆ x₇ x₈ x₉
|-
|
下標
|
<pre><nowiki>
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup> 或
x&amp;#8304; x&amp;sup1; x&amp;sup2; x&amp;sup3; x&amp;#8308;
x&amp;#8309; x&amp;#8310; x&amp;#8311; x&amp;#8312; x&amp;#8313;
</nowiki></pre>
|
x<sup>1</sup> x<sup >2</sup > x<sup >3</sup > or
x⁰ x¹ x² x³ x⁴
x⁵ x⁶ x⁷ x⁸ x⁹
|-
|
合併使用
|
<pre>
&amp;epsilon;<sub>0</sub> = 8.85 &amp;times; 10<sup>&amp;minus;12</sup> C&amp;sup2; / J m
1[[公頃]] = [[1 E+4 m&amp;sup2;]]
</pre>
|
&epsilon;<sub>0</sub> = 8.85 &times; 10<sup>&minus;12</sup> C&sup2; / J m
1[[公頃]] = [[1 E+4 m&sup2;]]
|}
====私人使用區字元以及不可見字元====
不可見與[[私人使用區]]字元,如有可能應盡量避免使用。如果仍然需要使用,應當使用其六進位代碼值(如「&#(x)...;」)。這將會使不可見字元變為可見以利手動編輯,並且能夠讓[[Wikipedia:AutoWikiBrowser|AWB]]處理有私人使用區字元的頁面。私人使用區字元還應當要加上{{tl|PUA}}模板,以利後續追蹤與維護。
===數學字元與方程式===
====數學字元====
* 請參考[[Wikipedia:数学符号]]、[[Wikipedia:数学专题|数学专题]]與[[TeX]]。


===表格=== <!--T:2-->
代码:
<syntaxhighlight line='line'>
{| class="wikitable"
{| class="wikitable"
! 輸入內容
|+ 标题文本
! 輸出結果
|-
|-
|<kbd>&amp;int; &amp;sum; &amp;prod; &amp;radic;</kbd>||&int; &sum; &prod; &radic;
! 标题文字 !! 标题文字 !! 标题文字
|-
|-
|<kbd>&amp;minus; &amp;plusmn; &amp;infin;</kbd>||&minus; &plusmn; &infin;
| 示例 || 示例 || 示例
|-
|-
|<kbd>&amp;asymp; &amp;prop; &amp;equiv; &amp;ne;</kbd>||&asymp; &prop; &equiv; &ne;
| 示例 || 示例 || 示例
|-
|-
|<kbd>&amp;le; &amp;ge;</kbd>||&le; &ge;
| 示例 || 示例 || 示例
|-
|<kbd>&amp;times; &amp;middot; &amp;divide; &amp;part;</kbd>||&times; &middot; &divide; &part;
|-
|<kbd>&amp;prime; &amp;Prime;</kbd>||&prime; &Prime;
|-
|<kbd>&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;alefsym;</kbd>||&nabla; &permil; &deg; &there4; &alefsym;
|-
|<kbd>&amp;oslash;</kbd>||&oslash;
|-
|<kbd>&amp;isin; &amp;notin; &amp;cap; &amp;cup;</kbd>||&isin; &notin; &cap; &cup;
|-
|<kbd>&amp;sub; &amp;sup; &amp;sube; &amp;supe;</kbd>||&sub; &sup; &sube; &supe;
|-
|<kbd>&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall;</kbd>||&not; &and; &or; &exist; &forall;
|-
|<kbd>&amp;rArr; &amp;lArr; &amp;dArr; &amp;uArr; &amp;hArr;</kbd>||&rArr; &lArr; &dArr; &uArr; &hArr;
|-
|<kbd>&amp;rarr; &amp;larr; &amp;darr; &amp;uarr; &amp;harr;</kbd>||&rarr; &larr; &darr; &uarr; &harr;
|}
|}
====數學公式====
{{main|Help:数学公式}}
* 方程式中的數學字母(如{{math|x}})以及運算符號(如<code>×</code>)不應使用普通字母,如<code>x</code>。請參考[[Wikipedia:格式手册/数学#数学公式的排版|數學公式的排版]]。For a comprehensive set of symbols, and comparison between {{tag|math|o}} tags and the {{tl|math}} template see section [[Help:Displaying_a_formula#TeX_vs_HTML|''TeX vs HTML'']].
* The {{tag|math|o}} tag typesets using [[MOS:MATH#Typesetting_of_mathematical_formulae|LaTeX markup]], which may render as an image or as HTML, depending on environmental settings. The {{tag|math|o}} tag is best for the complex formula on its own line in an image format. If you use this tag to put a formula in the line with text, put it in the {{tl|nowrap}} template.
* The {{tl|math}} template [[MOS:MATH#Using_HTML|uses HTML]], and will size-match a serif font, and will also prevent line-wrap. All templates are sensitive to the <code>=</code> sign, so remember to replace <code>=</code> with <code>{{tl|{{=}}}}</code> in template input, or start the input with <code>1=</code>. Use wikimarkup <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code> inside the {{tl|math}} template, as well as other [[Wikipedia:Mathematical_symbols|HTML entities]]. The {{tl|math}} template is best for typeset formulas in line with the text.
{{markup
|<syntaxhighlight lang="tex" inline>
<math>2x \times 4y \div 6z + 8 - \frac {y}{z^2} = 0</math>
</syntaxhighlight>
<syntaxhighlight lang="html" inline>
{{math|2''x'' &times; 4''y'' &divide; 6''z'' + 8 &minus; {{sfrac|''y''|''z''<sup>2</sup>}} {{=}} 0}}
</syntaxhighlight>
<syntaxhighlight lang="tex" inline>
<math>\sin 2\pi x + \ln e</math>
</syntaxhighlight>
<nowiki>
{{math|sin 2&amp;pi;''x'' + ln ''e''}}
</nowiki>
|<math>2x \times 4y \div 6z + 8 - \frac {y}{z^2} = 0</math>
{{crlf|}}
{{math|2''x'' &times; 4''y'' &divide; 6''z'' + 8 &minus; {{sfrac|''y''|''z''<sup>2</sup>}} {{=}} 0}}
<math>\sin 2\pi x + \ln e</math>{{crlf|}}
{{math|sin 2π''x'' + ln ''e''}}
}}
====單一數學方程式中插入空白====
* Using '''<code>&amp;nbsp;</code>''' to prevent line break is not needed; the {{tl|math}} template will prevent line breaks anyway; you can use {{tag|br|s}} if you need an explicit line break inside a formula.
{{markup
|<syntaxhighlight lang="html" inline>
It follows that {{math|''x''<sup>2</sup> &ge; 0}} for real {{mvar|x}}.
</syntaxhighlight>
|2=
It follows that {{math|''x''<sup>2</sup> &ge; 0}} for real {{mvar|x}}.
}}
====複雜方程式====
* See [[Help:Displaying a formula]] for how to use {{tag|math|o}}.
* A formula displayed on a line by itself should probably be indented by using the colon (:) character.
{{markup
|<syntaxhighlight lang="latex" inline>
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math>
</syntaxhighlight>
</syntaxhighlight>
|2={{crlf2}}
效果:
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math>
}}
 
==連結與網址==
{{main|Help:Link}}
 
===自由連結===
 
In [[Wikipedia]] and some other [[wiki]]s, '''free links''' are used in [[wikitext]] markup to produce [[internal link]]s between pages, as opposed to the concept of [[CamelCase]] for the same purpose, which was used in the early days of Wikipedia – see [[Wikipedia:CamelCase and Wikipedia|CamelCase and Wikipedia]].
 
In [[Wikipedia:How to edit a page#Wiki markup|Wikipedia's markup language]], you create free links by putting double square brackets around text designating the title of the page you want to link to. Thus, <code><nowiki>[[Texas]]</nowiki></code> will be rendered as [[Texas]]. Optionally, you can use a [[vertical bar]] (|) to customize the link title. For example, typing <code><nowiki>[[Texas|Lone Star State]]</nowiki></code> will produce [[Texas|Lone Star State]], a link that is displayed as "<u>Lone Star State</u>" but in fact links to [[Texas]].
 
====連結至其他維基百科條目====
 
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).
* Thus the link hereafter is to the Web address <code>en.wikipedia.org/wiki/Public_transport</code>, which is the Wikipedia article with the name "Public transport". See also [[Help:Link#Conversion to canonical form|Canonicalization]].
* [[Intentionally permanent red link|A red link]] is a page that doesn't exist yet; it can be created by clicking on the link.
* [[Help:Self link|A link to its own page]] will appear only as bold text.
 
{{markup
|<nowiki>倫敦有[[公共交通]]。</nowiki>
|倫敦有[[公共交通]]。
 
|<nowiki>Link to this article: "[[Help:Wikitext]]" will appear only as bold text.</nowiki>
|Link to this article: "[[Help:Wikitext]]" will appear only as bold text.
 
}}
 
====重命名連結====
 
* 用於相同目標頁面但有不同顯示名稱的情形。
* 目標頁面文字應當放在'''第一個位置''',顯示文字則置於'''第二個位置'''(以「[[豎線]]」為界)。
 
{| class="wikitable"
{| class="wikitable"
! 程式碼
|+ 标题文本
! 效果
|-
|-
|
! 标题文字 !! 标题文字 !! 标题文字
<code><nowiki>紐約也有[[公共交通|大眾運輸]]。</nowiki></code>
|
紐約也有[[公共交通|大眾運輸]]。
|}
 
====自動重命名連結====
 
* Simply typing the pipe character | after a link will automatically rename the link in certain circumstances. The next time you open the edit box you will see the expanded piped link. When [[Help:Show preview|previewing]] your edits, you will not see the expanded form until you press '''Save''' and '''Edit''' again. The same applies to [[#link-to-section|links to sections within the same page]].
* See [[Help:Pipe trick|Pipe trick]] for details.
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
自動隱藏括弧中的文字
|
<code><nowiki>[[界 (生物)|]]</nowiki></code>
|
[[界 (生物)|界]]
|-
|-
| 自动隐藏英文逗号后的文字(中文维基不常用)
| 示例 || 示例 || 示例
| <code><nowiki>[[Seattle, Washington|]]</nowiki></code>
| [[Seattle, Washington|Seattle]]
|-
|-
|
| 示例 || 示例 || 示例
自動隱藏命名空間名稱
|
<code><nowiki>[[Wikipedia:互助客棧|]]</nowiki></code>
|
[[Wikipedia:互助客棧|互助客棧]]
|-
|-
|
| 示例 || 示例 || 示例
或者同時隱藏
|
<code><nowiki>[[Wikipedia:Manual of Style (headings)|]]</nowiki></code>
|
[[Wikipedia:Manual of Style (headings)|Manual of Style]]
|-
|
<b>但無法隱藏章節名稱連結</b>
|
<code><nowiki>[[Wikipedia:Manual of Style#Links|]]</nowiki></code>
|
[[Wikipedia:Manual of Style#Links|]]
|}
|}
====Blend link====
* Endings are blended into the link.
** ''Exception'': a trailing [[apostrophe]] (') and any characters following the apostrophe are ''not'' blended.
* Preferred style is to use this instead of a piped link, if possible.
* Blending can be suppressed by using the [[#Nowiki|{{tag|nowiki|s}}]] tag, which may be desirable in some instances.
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
| rowspan=2 | ''Blending active''
|
<code><nowiki>San Francisco also has [[public transport]]ation. Examples include [[bus]]es, [[taxicab]]s, and [[tram]]s.</nowiki></code>
| San Francisco also has [[public transport]]ation. Examples include [[bus]]es, [[taxicab]]s, and [[tram]]s.
|-
| <code><nowiki>A [[micro-]]second</nowiki></code>
| A [[micro-]]second
|-
|
''Blending suppressed''
|
<code><nowiki>A [[micro-]]<nowiki />second.</nowiki></code>
|
A [[micro-]]<nowiki />second
|}
====Link to a section of a page====
* The part after the hash sign (#) must match a [[Section_editing#Creation_and_numbering_of_sections|section heading]] on the page. Matches must be exact in terms of spelling, case, and punctuation. Links to non-existent sections are not broken; they are treated as links to the beginning of the page.
* Include "| link title" to create a stylish ([[WP:Piping|piped]]) link title.
* If sections have the same title, add a number to link to any but the first. [[#Example section 3]] goes to the third section named "Example section". You can use the pipe and retype the section title to display the text without the # symbol.
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[Wikipedia:Manual of Style#Italics]] is a link to a section within another page.</nowiki></code>
|
[[Wikipedia:Manual of Style#Italics]] is a link to a section within another page.
|-
|
<code><nowiki>[[#Links and URLs]] is a link to another section on the current page. [[#Links and URLs|Links and URLs]] is a link to the same section without showing the # symbol.</nowiki></code>
|
[[#Links and URLs]] is a link to another section on the current page. [[#Links and URLs|Links and URLs]] is a link to the same section without showing the # symbol.
|-
|
<code><nowiki>[[Wikipedia:Manual of Style#Italics|Italics]] is a piped link to a section within another page.</nowiki></code>
|
[[Wikipedia:Manual of Style#Italics|Italics]] is a piped link to a section within another page.
|}
====Create a page link====
* To create a new page:
*# Create a link to it on some other (related) page.
*# Save that page.
*# Click on the link you just made. The new page will open for editing.
* For more information, see [[Wikipedia:Starting an article|starting an article]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].
* Please do not create a new article without linking to it from at least one other article.
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''Links to pages that don’t exist yet look red.''
|
<code><nowiki>The article about [[cardboard sandwiches]] doesn't exist yet.</nowiki></code>
|
The article about [[cardboard sandwiches]] doesn't exist yet.
|}
===重定向===
{{main|Help:重定向}}
* [[Wikipedia:Redirect|Redirect]] one article title to another by placing a directive like the one shown to the right on the ''first'' line of the article (such as at a page titled "[[USA]]").
* It is possible to redirect to a section. For example, a redirect to [[United States#History]] will redirect to the History section of the [[United States]] page, if it exists.
{| class="wikitable" border=1
! Description
! What you type
|-
|
''Redirect to an article''
|
<code><nowiki>#REDIRECT [[United States]] </nowiki></code>
|-
|
''Redirect to a section''
|
<code><nowiki>#REDIRECT [[United States#History]]</nowiki></code>
|}
===連結至其他[[Help:命名空間|命名空間]]===
*The full page name should be included in double square brackets.
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>See the [[Wikipedia:Manual of Style]].</nowiki></code>
|
See the [[Wikipedia:Manual of Style]].
|}
===連結至同一條目的不同語言版本(跨語言連結)===
{{main|Help:跨語言連結|Wikipedia:Complete list of language wikis available}}
{{notice|在[[Wikipedia:維基數據|維基數據]]啟用後,會透過這個資料庫添加跨語言連結。在條目中的跨語言連結應只用於特殊目的,例如某個語言的條目中要特別標明有另外兩種語言的名稱或條目內容。}}
* 如果要產生至其他語言的對應頁面的連結,請使用這個格式:<code><nowiki>[[</nowiki>語言代碼:外語頁面名稱<nowiki>]]</nowiki></code>。
* 建議跨語言連結放在頁面內容的最後。
* 跨語言連結不會在內容文本中出現,而是出現在左側「其他語言」區塊底下。
* '''注意''':上述方法除非有特殊狀況,否則已由[[Wikipedia:維基數據|維基數據]]取代。如果要在條目或文本內容中建立'''任何'''外語條目或內容的'''內部連結''',請見[[Help:跨语言链接#出現在正文中的連結]]並理解使用方法。
{| class="wikitable"
! 描述
! 輸入內容
|-
|
在英語條目「Plankton」建立西班牙語條目[[:es:Plancton|「Plancton」]]的連結。
「es」是[[西班牙語]]的語言代碼,對應於「{{lang|es|español}}」。
|
<pre>
[[es:Plancton]]
</pre>
|-
|
其他例子:法語(<code>fr</code>對應於{{lang|fr|français}})、德語(<code>de</code>對應於{{lang|de|Deutsch}})、俄語(<code>ru</code>)與簡單英語(<code>simple</code>)。
|
<pre>
[[fr:Plancton]]
[[de:Plankton]]
[[ru:Планктон]]
[[simple:Plankton]]
</pre>
|}
===跨Wiki連結===
* [[跨Wiki連結]]可連結至其他Wiki網站的任何頁面。[[Wikipedia:维基项目间链接|維基專案間連結]]可連結至其他維基媒體的Wiki網站。
* 請注意跨Wiki連結需使用內部連結,也就是兩側放入半形方括號。
* 請參考[[MetaWikiPedia:Interwiki_map|跨Wiki地圖]]中所列出的捷徑;如果您想要連結的網站不在該列表中,請使用[[#外部連結|外部連結]]。
* 也請參考[[Wikipedia:姊妹计划|姊妹計畫]]。
{| class="wikitable"
! 描述
! 輸入內容
! 輸出結果
|-
| colspan="3"|
連結至另一個英語Wiki網站的頁面。
下列三種格式將會直接導向<em>http://en.wiktionary.org/wiki/hello</em>網址。
|-
|
簡單連結
去除前綴字元
將連結命名
|
<code><nowiki>[[Wiktionary:hello]]</nowiki></code>
<code><nowiki>[[Wiktionary:hello|]]</nowiki></code>
<code><nowiki>[[Wiktionary:hello|Hello在英語維基辭典的定義]] </nowiki></code>
|
[[Wiktionary:hello]]
[[Wiktionary:hello|hello]]
[[Wiktionary:hello|Hello在英語維基辭典的定義]]
|-
| colspan="3"|
連結至其他語言Wiki網站中的頁面。
下列三種格式將會直接導向<em>http://fr.wiktionary.org/wiki/bonjour</em>網址。
|-
|
簡單連結
去除前綴字元
將連結命名
|
<code><nowiki>[[Wiktionary:fr:bonjour]]</nowiki></code>
<code><nowiki>[[Wiktionary:fr:bonjour|]]</nowiki></code>
<code><nowiki>[[Wiktionary:fr:bonjour|bonjour]]</nowiki></code>
|
[[Wiktionary:fr:bonjour]]
[[Wiktionary:fr:bonjour|fr:bonjour]]
[[Wiktionary:fr:bonjour|bonjour]]
|}
===分類===
* To put an article in a [[Wikipedia:Categorization|category]], place a link like <code><nowiki>[[Category:Example]]</nowiki></code> into the article. As with interlanguage links, placing these links at [[WP:FOOTERS|the end of the article]] is recommended.
* To link to a category page without putting the article into the category, use a colon prefix (":Category") in the link.
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''Categorize an article.''
|
<code><nowiki>[[Category:Character sets]]</nowiki></code>
|
|-
|
''Link to a category.''
|
<code><nowiki>[[:Category:Character sets]]</nowiki></code>
|
[[:Category:Character sets]]
|-
|
''Without prefix.''
|
<code><nowiki>[[:Category:Character sets|]]</nowiki></code>
|
[[:Category:Character sets|Character sets]]
|}
===外部連結===
<!-- linked from [[Wikipedia:External links]] -->
*Single square brackets indicate an external link. Note the use of a ''space'' (not a pipe |) to separate the URL from the link text in a named link. Square brackets may be used as normal punctuation when not linking to anything – [like this].
*A [[Uniform Resource Locator|URL]] must begin with a supported [[URI scheme]]: <code>http://</code> and <code>https://</code> will be supported by all browsers; <code>irc://</code>, <code>ircs://</code>, <code>ftp://</code>, <syntaxhighlight inline>news://</syntaxhighlight>, <code>mailto:</code>, and <code>gopher://</code> will require a plugin or an external application. IPv6 addresses in URLs are currently not supported.
*A URL containing certain characters will display and link incorrectly unless those characters are [[Percent-encoding|percent encoded]]. For example, a space must be replaced by <code>%20</code>. Encoding can be achieved by:
:*Use the link button [[File:Vector toolbar insert link button.png]] on the enhanced editing toolbar to encode the link; this tool will add the bracket markup and the linked text, which may not always be desirable.
:*Or manually encode the URL by replacing these characters:
{| class="wikitable" style="margin-left: 5em"
! ''space'' !! " !! ' !! , !! ; !! < !! > !! ? !! [ !! ]
|-
| %20 || %22 || %27 || %2c || %3b || %3c || %3e || %3f || %5b || %5d
|}
:*Or use the <nowiki>{{urlencode:}}</nowiki> magic word. See [[:mw:Help:Magic words#URL data|Help:Magic words]] in the MediaWiki documentation for more details.
* See [[Wikipedia:External links|External links]] for style issues, and [[:Category:External link file type templates|External link file type templates]] for indicating the file type of an external link with an icon.
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''Named link'' with an [[Help:external link icons|external link icon]]
|
<code><nowiki>[http://www.wikipedia.org Wikipedia]</nowiki></code>
|
[http://www.wikipedia.org Wikipedia]
|-
|
''Unnamed link''
''(Used only within article body for footnotes)''
|
<code><nowiki>[http://www.wikipedia.org]</nowiki></code>
|
[http://www.wikipedia.org]
|-
|
''Bare URL''
''(Bad style)'' 
use <nowiki><nowiki></nowiki></nowiki> to keep this bad style from showing
|
<code><nowiki>http://www.wikipedia.org</nowiki></code>
|
http://www.wikipedia.org
|-
|
''Link without arrow''
''(Not often used)''
|
<code><nowiki><span class="plainlinks">[http://www.wikipedia.org Wikipedia]</span></nowiki></code>
|
<span class="plainlinks"> [http://www.wikipedia.org Wikipedia]</span>
|}
===自動化連結===
{{main|Help:Magic links}}
Magic links are automatic links for certain unique identifiers that require no markup. They can be used for ISBN numbers, RFC numbers, and PMID numbers.
====書籍來源====
* Link to books using their [[Wikipedia:ISBN|ISBN]], which creates a link to [[Special:BookSources]]. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors. However, if one bookstore or online service provides additional free information, such as table of contents or excerpts from the text, then a link to that source will aid the user and is recommended. ISBN links do not need any extra markup, provided you use one of the indicated formats.
* To create a link to [[Special:BookSources]] using alternative text (e.g. the book's title), use the internal link style with the appropriate namespace.
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>{{ISBN|022628705X}}</nowiki></code>
|
{{ISBN|022628705X}}
|-
|
<code><nowiki>{{ISBN|0-22-628705-X}}</nowiki></code>
|
{{ISBN|0-22-628705-X}}
|-
|
<code><nowiki>Link to a book using [[Special:BookSources/0670037818|alternative text, such as its title]]</nowiki></code>
|
Link to a book using [[Special:BookSources/0670037818|alternative text, such as its title]]
|}
====RFC號碼====
* Link to an [[Internet Engineering Task Force]] [[Request for Comments|Request for Comments (RFC)]].
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>Text mentioning an RFC number anywhere, e.g. RFC 4321.</nowiki></code>
|
Text mentioning an RFC number anywhere, e.g. RFC 4321.
|}
===雜項===
====「截至」模板====
* The ''[[Wikipedia:As of|As of]]'' template generates phrases like "As of April 2009" or "as of April 2009", and categorize information that will need updating. For an explanation of the parameters see the {{tl|As of}} documentation.
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>{{As of|2009|4|df=us}}</nowiki></code>
|
{{As of|2009|4|df=us}}
|-
|
<code><nowiki>{{As of|2009|4|df=us|lc=y}}</nowiki></code>
|
{{As of|2009|4|df=us|lc=y}}
|}
====多媒體連結====
* To include links to non image uploads such as sounds, use a "media" link. For images, [[#Images|see next section]].
* Some uploaded sounds are listed at [[Commons:Sound]].
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[media:Classical guitar scale.ogg|Sound]]</nowiki></code>
|
[[media:Classical guitar scale.ogg|Sound]]
|}
====直接連結至編輯模式====
*These create links that directly go to the edit or view source tab. For example, to create links to the edit tab for this page, either of the following works:
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
Using the {{tl|fullurl}} template
|
<code><nowiki>[{{fullurl:Help:Wiki markup|action=edit}} edit]</nowiki></code>
|
[{{fullurl:Help:Wiki markup|action=edit}} edit]
|-
|
Using the {{tl|Edit}} template
|
<code><nowiki>{{edit}}</nowiki></code>
|
{{edit}}
|}
====部分文字斜體化的連結====
*Linking to a page with a title containing words that are usually italicized, such as the [[Hindenburg disaster|''Hindenburg'' disaster]] article.
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[Hindenburg disaster|''Hindenburg'' disaster]]</nowiki></code>
|
[[Hindenburg disaster|''Hindenburg'' disaster]]
|}
==Pronunciation aids==
It is often desirable to provide an aid to pronunciation for a word. The [[Template:IPAc-en|''IPAc-en'']] and [[Template:Respell|''Respell'']] templates can be of assistance.
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>'''Konjac''' {{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}}</nowiki></code>
|
'''Konjac''' {{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}}
|-
|
<code><nowiki>'''Konjac''' ({{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}} {{respell|KOHN|yak}})</nowiki></code>
|
'''Konjac''' ({{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}} {{respell|KOHN|yak}})
|-
|
<code><nowiki>''Konjac'' is pronounced {{IPAc-en|ˈ|k|oʊ|n|j|æ|k}} in English.</nowiki></code>
|
''Konjac'' is pronounced {{IPAc-en|ˈ|k|oʊ|n|j|æ|k}} in English.
|}
Refer to [[Wikipedia:Manual of Style (pronunciation)]] for more information.
==音樂符號==
{{main|Help:樂譜}}
音樂符號可以使用{{xtag|score|p}}擴展標籤予以增加。舉例:
:
{{markup
|<nowiki><score>\relative c' { fis d fis a d f e d c cis d e a g f ees }</score></nowiki>
|<score>\relative c' { fis d fis a d f e d c cis d e a g f ees }</score>
}}
==圖像==
{{Main|Help:Visual file markup|Wikipedia:圖像}}
只有上傳至維基百科或[[commons:main|維基共享資源]]的圖像才能夠使用。如果要上傳圖像,自行拍攝的圖像請使用[[:commons:Special:UploadWizard|維基共享資源的上傳精靈]];如果要上傳的圖像有任何著作權問題,請使用[[Wikipedia:上传|上傳精靈]]。您可以在[[Special:Imagelist|圖像列表]]當中找到已經上傳的圖像。
有關維基百科內的圖像方針,請見[[Wikipedia:檔案使用守則|檔案使用守則]]。
For further help on images, including some more versatile abilities, see the [[WP:PIC|picture tutorial]] and [[Wikipedia:Extended image syntax|extended image syntax]].
{| class="wikitable"
|-
! 程式碼
! 效果
! 註解
|- style="vertical-align:top;"
| <pre style="white-space: pre-wrap;">The image name, the word thumb then the caption :
<nowiki>[[File:wiki.png|thumb|Wikipedia logo]]</nowiki></pre>
| The image name, the word thumb then the caption :
[[File:wiki.png|thumb|alt=Puzzle globe|Wikipedia logo]] {{clear}}
|
* The thumb tag automatically allows the image to be enlarged and positions it (floats) automatically to the right of the page.
* An enlarge icon is placed in the lower right corner.
* See note below about adding an [[#alt tag|alt tag]]
* This is the basic markup for most images
|- style="vertical-align: top;"
| <pre>A picture: <nowiki>[[File:wiki.png]]</nowiki></pre>
| A picture: [[File:wiki.png]]
|
* The picture name alone places the image in the text, or on the next line if there is insufficient space.
* Embedding the image in the text is only possible for very small images.
* Embedding the image will affect the vertical formatting of text.
|- style="vertical-align: top;"
| <pre>With alternative text:
<nowiki>[[File:wiki.png|alt=Puzzle globe logo]]</nowiki></pre>
| With alternative text:
[[File:wiki.png|alt=Puzzle globe logo]]
|
* {{anchor|alt tag}}Alternative text, used when the image is unavailable or when the image is loaded in a text-only browser, or when spoken aloud, is '''strongly''' encouraged. See [[Wikipedia:Alternative text for images|Alternative text for images]] for help on choosing it.
|- style="vertical-align:top;"
| <pre>With link:
<nowiki>[[File:wiki.png|link=Wikipedia]]</nowiki></pre>
| With link:
[[File:wiki.png|link=Wikipedia]] {{clear}}
|
* The link directs to the Wikipedia page, [[Wikipedia]], instead of the image file page.
|- style="vertical-align:top;"
| <pre style="white-space: pre-wrap;">Forced to the centre of the page
using the ''frame'' tag (attribute), a ''centre'' tag and a caption:
<nowiki>[[File:wiki.png|frame|centre|alt=Puzzle globe|Wikipedia logo]]</nowiki></pre>
| Forced to the centre of the page using the ''frame'' tag (attribute), a ''centre'' tag and a caption:
[[File:wiki.png|frame|centre|alt=Puzzle globe|Wikipedia logo]] {{clear}}
|
* The frame tag automatically floats the image right.
* The frame tag is only of use with very small images or ones using the [[#px tag|px tag]]
* The attributes left, center or centre override this, and places the image to the left or the centre of the page. {{anchor|upright tag}}
* The last parameter is the caption that appears below the image.
|- style="vertical-align:top;"
| <pre style="white-space: pre-wrap;">Forced to the left side of the page
using the ''thumb'' attribute, the ''left'' attribute  and a caption:
<nowiki>[[File:wiki.png|thumb|left|alt=Puzzle globe|Wikipedia logo]]</nowiki></pre>
| Forced to the left side of the page using the ''thumb'' attribute, the ''left'' attribute  and a caption:
[[File:wiki.png|thumb|left|alt=Puzzle globe|Wikipedia logo]] {{clear}}
|
* The thumb tag automatically floats the image right.
* An enlarge icon is placed in the lower right corner.
* The attributes left, center or centre override this, and places the image to the left or the centre of the page.
|- style="vertical-align:top;"
| <pre style="white-space: pre-wrap;">Forced to the right side of the page
''without'' a caption:
<nowiki>[[File:wiki.png|right|Wikipedia encyclopedia]]</nowiki></pre>
| Forced to the right side of the page ''without'' a caption:
[[File:wiki.png|right|Wikipedia encyclopedia]]
|
* Captions are only displayed when the thumb or frame attributes are present
* The [[WP:PIC|picture tutorial]] explains more options.
|- style="vertical-align:top;"
| <pre>A picture resized to 50 pixels...
<nowiki>[[File:wiki.png|50 px|Wikipedia encyclopedia]]</nowiki></pre>
| A picture resized to 50 pixels...
[[File:wiki.png|50 px|Wikipedia encyclopedia]]
|
* {{anchor|px tag}}The [[WP:PIC|picture tutorial]] explains more options.
* This should be used very sparingly, thumb images are always of the same width.
* There is an [[#upright tag|''upright'' attribute]] that can be used to display tall images. These tags are optimised for both laptop and mobile phone screens.
|- style="vertical-align:top;"
| <pre>Linking directly to the description page of an image:
<nowiki>[[:File:wiki.png]]</nowiki></pre>
| Linking directly to the description page of an image:
[[:File:wiki.png]]
|
* Clicking on an image displayed normally on a page also leads to the description page.
|- style="vertical-align:top;"
| <pre>Linking directly to an image without displaying it:
<nowiki>[[Media:wiki.png|Image of jigsaw globe]]</nowiki></pre>
| Linking directly to an image without displaying it:
[[Media:wiki.png|Image of jigsaw globe]]
|
* To include links to images shown as links instead of drawn on the page, use a "media" link.
|- style="vertical-align:top;"
|
<syntaxhighlight lang="html">Example:
<div style="display: inline; width: 220px; float: right;">
[[File:wiki.png|50 px|Wikipedia encyclopedia]][[File:wiki.png|50 px]] </div></syntaxhighlight>
|
Example:
<div style="display: inline; width: 220px; float: right;">
[[File:wiki.png|50 px|Wikipedia encyclopedia]][[File:wiki.png|50 px]] </div>
|
* Using the [[span and div|<code>span</code> or <code>div</code> elements]] to separate images from text (note that this may allow images to cover text).
|- style="vertical-align:top;"
|
<pre><nowiki>Example:
{| align=right
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|}</nowiki></pre>
|
Example:
{| align=right
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|}
|
*Using wiki markup to make a table in which to place a vertical column of images (this helps edit links match headers, especially in Firefox browsers).
|}
==表格==
{{main|Help:表格}}
建立表格有兩種方式:
* 使用特殊的Wiki標記式語言(參見[[Help:表格]])。
* 使用HTML元素:{{tag|table|o}}、{{tag|tr|o}}、{{tag|td|o}}或{{tag|th|o}}。
請參考[[Wikipedia:格式手冊/表格#適當使用|表格的適用時機]]。
==Columns==
{{main|Help:Columns}}
Use {{tl|colbegin}} and {{tl|colend}} to produce columns.
==References and citing sources==
{{main|Wikipedia:Citing sources|Help:Footnotes}}
{{see also|APA style|The Chicago Manual of Style{{!}}Chicago style|Harvard style|MLA style}}
Making a reference citing a printed or online source can be accomplished by using the {{tag|ref}} tags. Inside these tags details about the reference are added.
Details about the citation can be provided using a structure provided by various templates; the table below lists some typical citation components.
{| class="wikitable"
|-
! What it's for !! What you type
|-
| {{Nowrap|To create the reference}} || {{tag|ref|params=name="name for reference"|content=Use a closing tag}}
|-
| To cite a book || {{Tlx|cite book}}
|-
| To cite a web source || {{Tlx|cite web}}
|-
| Book ISBN || {{para|isbn|0-4397-0818-4}} (ISBN of the book)
|-
| Web URL || {{para|url|ht<nowiki />tp://www.wikipedia.org}}
|-
| Title || {{para|title|title of source}}
|-
| Author || {{para|author|authors, use commas for multiple}}
|-
| First name || {{para|first|first name}}
|-
| Last name || {{para|last|last name}}
|-
| Location || {{para|location|location of publisher}}
|-
| Publisher || {{para|publisher|who published the source}}
|-
| Date || {{para|date|2007-09-21}} (date of source)
|-
| Year || {{para|year|year of source}}
|-
| Accessed date || {{para|accessdate|2008-12-25}} (only if url= is included)
|-
| A complete reference tag || {{tag|ref|o|params=name="WikiMarkup"}}<code><nowiki>{{cite web |url=http://en.wikipedia.org/w/index.php?title=Help:Wiki_markup |title=Help:Wiki markup |publisher=Wikimedia Foundation}}</nowiki></code>{{tag|ref|c}}
|-
| Referencing this again || {{tag|ref|s|params=name="WikiMarkup"}}
|-
| Citation needed || {{tlx|Citation needed|{{tls|DATE}}}}
|}
==模板與包含嵌入頁面==
{{main|Wikipedia:Transclusion}}
{{see also|Help:Template#Noinclude, includeonly, and onlyinclude}}
模板舉例:<nowiki>{{pad|...}}, {{math|...}}, {{as of|...}}, {{edit}}</nowiki>
'''[[Help:Template|Templates]]''' are segments of wiki markup that are meant to be copied automatically ("transcluded") into a page.
You add them by putting the template's name in <nowiki>{{double braces}}</nowiki>. It is also possible to transclude other pages by using <nowiki>{{:colon and double braces}}</nowiki>.
There are three pairs of [[html element|tags]] that can be used in [[wikitext]] to control how transclusion affects parts of a template or article.
They determine whether or not wikitext renders, either in its own article, which we will call "'''here'''", or in another article where it is transcluded, which we will call "'''there'''".
* '''<nowiki><noinclude></nowiki>: ''' the content '''will not be rendered ''there'''''. These tags have no effect ''here''.
* '''<nowiki><includeonly></nowiki>: ''' the content  '''will render only ''there''''', and  '''will not render ''here''''' (like [[invisible ink]] made visible by means of transclusion).
* '''<nowiki><onlyinclude></nowiki>: ''' the content '''will render ''here''''' and '''will render ''there''''', but it will only render ''there'' what is between these tags.
There can be several such section "[[HTML#Elements|elements]]". Also, they can be nested. All possible renderings are achievable. For example, to render ''there'' one or more sections of the page ''here'' use '''<nowiki><onlyinclude></nowiki>''' tags. To append text ''there'', wrap the addition in '''<nowiki><includeonly></nowiki>''' tags before, within, or after the section. To omit portions of the section, nest '''<nowiki><noinclude></nowiki>''' tags within it.
If a page is transcluded without transclusion markup, it may cause an unintentional [[Help:Category#Putting_pages_in_categories|categorization]]. Any page transcluding it will contain the same category as the original page. Wrap the category markup with '''<nowiki><noinclude></nowiki>''' tags to prevent incorrect categorization.
{{anchor|hovertext}}
Some templates take ''parameters'', as well, which you separate with the pipe character <code>|</code>.
{| class="wikitable"
!width="500"| What you type
!width="1000"| What it looks like
|-
|
<pre>{{Transclusion demo}}</pre>
|
{{Transclusion demo}}
|-
|
<pre>{{Help:Transclusion demo}}</pre>
|
{{Help:Transclusion demo}}
|-
|
<pre>
This template takes two parameters,
and creates underlined text with a
hover box for many modern browsers
supporting CSS:
{{SetTitle|This is the hover text|
Hover your mouse over this text}}
Go to this page to see the H:title
template itself: {{tl|H:title}}
</pre>
|
This template takes two parameters,
and creates underlined text with a
hover box for many modern browsers
supporting CSS:
{{SetTitle|This is the hover text|
Hover your mouse over this text}}
Go to this page to see the H:title
template itself: {{tl|H:title}}
|}
==討論頁與計畫頁面==
These are likely to be helpful on [[Help:Using talk pages|talk]] and [[Wikipedia:Project namespace|project pages]].
===簽名===
*The  ''[[tilde]]'' character (~) is used when signing a comment on a talk page. Your username provides a link to your [[Wikipedia:user page|user page]].
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''You should sign your comments by appending four tildes to the comment, which adds your user name plus date/time.''
|
<code><nowiki>~~~~</nowiki></code>
|
[[Special:Mypage|Username]] ([[Special:Mytalk|talk]]) {{CURRENTTIME}}, {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} (UTC)
|-
|
''Adding three tildes will add just your user name.''
|
<code><nowiki>~~~</nowiki></code>
|
[[Special:Mypage|Username]] ([[Special:Mytalk|talk]])
|-
|
''Adding five tildes gives the date/time alone.''
|
<code><nowiki>~~~~~</nowiki></code>
|
{{CURRENTTIME}}, {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} (UTC)
|}
===連結至某個頁面的舊有修訂版本、修訂差異以及特定歷史頁面===
*The external link function is mainly used for these. Open an old revision or diff, and copy the [[URL]] from the address bar, pasting it where you want it.
{| class="wikitable"
! 程式碼
! 效果
|-
|
<code><nowiki>[//zh.wikipedia.org/w/index.php?title=Help:Wiki_markup&diff=330350877&oldid=330349143 Diff between revisions 330349143 and 330350877]</nowiki></code>
|
[//zh.wikipedia.org/w/index.php?title=Help:Wiki標記式語言&diff=330350877&oldid=330349143 Diff between revisions 330349143 and 330350877]
|}
*您可以使用[[Help:Diff#Internal links|內部修訂差異連結]]。'''不同於{{tl|diff}}模板,這種連結方式甚至可以用於撰寫編輯摘要。'''
{| class="wikitable"
! 程式碼
! 效果
|-
|
<code><nowiki>[[Special:Diff/330349143/330350877|修訂版本330349143與330350877之間的差異]]</nowiki></code>
|
[[Special:Diff/330349143/330350877|修訂版本330349143與330350877之間的差異]]
|}
*If the diff intended to be shown is between an immediately previous revision, the first parameter can be dropped.
{| class="wikitable"
! 程式碼
! 效果
|-
|
<code><nowiki>[[Special:Diff/330350877|Diff between revisions 330349143 and 330350877]]</nowiki></code>
|
[[Special:Diff/330350877|Diff between revisions 330349143 and 330350877]]
|} 
*For an old revision, you can also use a [[Help:Permanent link|permalink]]. Though here only the main text is guaranteed to be retained (images and templates will be shown as they are today, not as they were at the time).
{| class="wikitable"
! 程式碼
! 效果
|-
|
<code><nowiki>[[Special:Permalink/330350877|Revision 330350877]]</nowiki></code>
|
[[Special:Permalink/330350877|Revision 330350877]]
|}
===What links here, and recent changes linked===
*The following markup can be used. For example, for the article [[Beetroot]]:
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[Special:WhatLinksHere/Beetroot]]</nowiki></code>
|
[[Special:WhatLinksHere/Beetroot]]
|-
|
<code><nowiki>[[Special:RecentChangesLinked/Beetroot]]</nowiki></code>
|
[[Special:RecentChangesLinked/Beetroot]]
|}
===使用者編輯===
*Link to a user's [[Help:User contributions|contributions page]].
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
| ''Username (registered users).''
| <code><nowiki>[[Special:Contributions/UserName]]</nowiki></code>
| [[Special:Contributions/UserName]]
|-
| ''[[IPv4]] address (unregistered users).''
| <code><nowiki>[[Special:Contributions/192.0.2.0]]</nowiki></code>
| [[Special:Contributions/192.0.2.0]]
|-
| ''[[IPv6]] address (unregistered users).''
| <code><nowiki>[[Special:Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329]]</nowiki></code>
| [[Special:Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329]]
|}
===將文字上色或高亮化===
*使用{{tl|Color}}及{{tl|Font color}}模板:
{| class="wikitable"
! 程式碼
! 效果
|-
|
<code><nowiki>我將會在這個句子{{color|blue|中間}}改變顏色。</nowiki></code>
|
我將會在這個句子{{color|blue|中間}}改變顏色。
|-
|
<code><nowiki>這是如何{{Font color||yellow|高亮某個句子一部份}}的方法。</nowiki></code>
|
這是如何{{Font color||yellow|高亮某個句子一部份}}的方法。
|}
===範例文字===
The {{tlx|xt}} family of templates can be used on help pages and user pages to highlight e'''x'''ample te'''x'''t.
{{!bxt|It does not work in mainspace, that is articles. }}
{| class=wikitable
!What you type
!What you get
|-
|<kbd><nowiki>This is an {{</nowiki>'''xt'''<nowiki>|A correct example}} for comparison {{tick}}</nowiki></kbd>
|This is an {{xt|A correct example}} for comparison {{tick}}
|-
|<kbd><nowiki>this is an {{</nowiki>'''!xt'''<nowiki>|An incorrect example}} for example {{cross}}</nowiki></kbd>
|this is an {{!xt|An incorrect example}} for example {{cross}}
|-
|<kbd><nowiki>this is an {{</nowiki>'''mxt'''<nowiki>|In monospace}} for comparison</nowiki></kbd>
|this is an {{mxt|In monospace}} for comparison
|-
|<kbd><nowiki>this is an {{</nowiki>'''!mxt'''<nowiki>|In monospace}} for comparison</nowiki></kbd>
|this is an {{!mxt|In monospace}} for comparison
|-
|<kbd><nowiki>this is an {{</nowiki>'''bxt'''<nowiki>|in bold}} for comparison</nowiki></kbd>
|this is an {{bxt|In bold}} for comparison
|-
|<kbd><nowiki>this is an {{</nowiki>'''!bxt'''<nowiki>|In bold}} for comparison</nowiki></kbd>
|this is an {{!bxt|In bold}} for comparison
|}
===Show deleted or inserted text===
{{details|Wikipedia:Talk page guidelines}}
*When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted content:
**It is best to indicate deleted content using the strike-through markup {{tag|s}}.
**It is best to indicate inserted content using the underline markup {{tag|u}}.
*When editing regular Wikipedia articles, just make your changes, and do not mark them up in any special way. However, when the article itself discusses deleted or inserted content, such as an amendment to a statute:
**It is best to indicate deleted content using the strike-through markup {{tag|del}}.
**It is best to indicate inserted content using the underline markup {{tag|ins}}.
Note: {{tag|s|content=}} and {{tag|u|content=}} (speced in HTML 3 & 4) are considerably more popular than {{tag|del|content=}} and {{tag|ins|content=}}  (speced in HTML 5) on Wikipedia.
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>You can <del>strike out deleted material</del> and <ins>underline new material</ins>.</nowiki></code>
|
You can <del>strike out deleted material</del> and <ins>underline new material</ins>.
|-
|
Alternative markup:
<code><nowiki>You can <s>strike out deleted material</s> and <u>underline new material</u>.</nowiki></code>
|
You can <s>strike out deleted material</s> and <u>underline new material</u>.
|}
===Strike through===
{{anchor|Strikethrough}}
This is also possible with the {{tlx|strike}}} template.
{| class=wikitable
!What you type
!What you get
|-
|<kbd><nowiki>This is {{</nowiki>'''strike'''<nowiki>|A misplaced bit of text}} for comparison</nowiki></kbd>
|This is {{strike|A misplaced bit of text}} for comparison
|}
=={{anchor|Limiting formatting}} Limiting formatting / escaping wiki markup==
A few different kinds of formatting will tell the wiki to display things as you typed them – what you see is what you get!
{| class="wikitable" style="margin-right:0em;"
|-
!What you type
!What it looks like
|-
|
<pre>'''&amp;lt;nowiki&amp;gt; tag:'''
&lt;nowiki&gt;
The nowiki tag ignores [[wiki]]
''markup''. It reformats text by
removing newlines and multiple
spaces. It still interprets
characters specified by
&amp;name;: &amp;rarr;
&lt;/nowiki&gt;</pre>
|
'''&lt;nowiki&gt; tag:'''
<nowiki>
The nowiki tag ignores [[wiki]]
''markup''. It reformats text by
removing newlines and multiple
spaces. It still interprets
characters specified by
&amp;name;: &rarr;
</nowiki>
|-
|
<pre>'''&amp;lt;pre&amp;gt; tag:'''
&lt;pre&gt;The &lt;pre&gt; tag ignores [[wiki]]
''markup'' as does the &lt;nowiki&gt;
tag. Additionally, &lt;pre&gt; displays
in a mono-spaced font, and does
not  reformat    text    spaces.
It still interprets special
characters: &amp;rarr;
&lt;/pre&gt;</pre>
|
'''&lt;pre&gt; tag:'''
<pre>The &lt;pre&gt; tag ignores [[wiki]]
''markup'' as does the &lt;nowiki&gt;
tag. Additionally, &lt;pre&gt; displays
in a mono-spaced font, and does
not  reformat    text    spaces.
It still interprets special
characters: &rarr;</pre>
|-
|
<pre>'''[Text without a URL]:'''
Single square brackets holding
[text without a HTTP URL] are
preserved, but single square
brackets containing a URL are
treated as being an external
[http://example.com/ Web link].</pre>
|
'''[Text without a URL]:'''
Single square brackets holding
[text without a HTTP URL] are
preserved, but single square
brackets containing a URL are
treated as being an external
[http://example.com/ Web link].
|-
|
<syntaxhighlight lang="moin">'''Leading space:'''
Leading spaces are another way
to preserve formatting.
Putting a space at the
beginning of each line
stops the text  from
being reformatted.
It still interprets [[wiki]]
''markup'' and special characters: &amp;rarr;</syntaxhighlight>
|
'''Leading space:'''
Leading spaces are another way
to preserve formatting.
Putting a space at the
beginning of each line
stops the text  from
being reformatted.
It still interprets [[wiki]]
''markup'' and special characters: &rarr;
|}
===無Wiki模式===
{{shortcut|Help:NOWIKI|WP:NOWIKI}}
In order for the software to interpret wiki markup, its parser first scans the page. When it sees its nowiki tags
:{{tag|nowiki}} ([[escape character|escape]]s all contained wiki markup), and
:{{tag|nowiki|s}} (escapes the interpretations it is designed to "break"),
it escapes its wikicode, so editors can document its markup ''using'' its markup.
Article editors can normalize the font of characters trailing <code>[<nowiki />[...]]outside</code> a wikilink, which would otherwise adhere to the wikilink font. They can also add line-spacing in the wikitext. Template editors: tag {{tag|nowiki|o}} works only on its source page, not the target; also <code>{{#tag<nowiki />:nowiki&nbsp;|&nbsp;''content''}}</code>, although it wraps that content in nowiki tags, it also does a [[mw:Manual:Tag extensions#How do I render wikitext in my extension?|pre-save transform]] on that content, which is entirely at odds with the intended purpose of nowiki for templates, subst, signatures, and the pipe-trick.
The two kinds of nowiki operate in different ways to target content, but they both remove meaning (subtract rendering) of wiki markup, then disappear into the background font. Nowiki does nothing toward rendering, but it can add newlines to wikitext (for readability), just like the HTML comment (the preferred method) can. Unlike it does for wiki markup, nowiki does not remove the meaning of ''character entities'', either [[HTML character entities|HTML]] or MediaWiki [[#Special characters|special ''characters'']].
There is only one meaning for what {{tag|nowiki}} contains, so it needs few examples; but the singular {{tag|nowiki|s}} tag "contains" ''many'' linkage structures, where it is expected between bracketing-pair characters or in the keyword area.  So this section has ''many'' examples and few mis-examples.
For example, only at the beginning of a line (bol of wikitext, bol in a transclusion, or beginning of a table cell), do {{code|*}}, {{code|#}}, {{code|;}} or {{code|:}} mean something.
{{markup
|<nowiki># Ordered list</nowiki>
|{{crlf2}}
# Ordered list
|<nowiki><nowiki /># Ordered list</nowiki>
|{{crlf2}}
<nowiki /># Ordered list
|<nowiki>A [[micro-]]second.</nowiki>
|A [[micro-]]second.
|<nowiki>A [[micro-]]<nowiki />second.</nowiki>
|A [[micro-]]<nowiki />second.
|<nowiki>a<nowiki>
</nowiki>b</nowiki>
|a<nowiki>
</nowiki>b
|<nowiki>'<nowiki />'Italics' markup'<nowiki />'</nowiki>
|'<nowiki />'Italics' markup'<nowiki />'
|<nowiki><nowiki>[[Example]]</nowiki></nowiki>
|<nowiki>[[Example]]</nowiki>
|&lt;nowiki>&lt;!-- revealed -->&lt;/nowiki>
|  <nowiki>  <!-- revealed -->    </nowiki>
}}
The rest of the section consists of simple, live examples showing how a single nowiki tag escapes entire linkage structures, beyond [[&nbsp;wikilink&nbsp;<nowiki />]] and {{&nbsp;template&nbsp;<nowiki />}}:
:[[ ''[[wp:fullpagename|fullpagename]]'' <nowiki />| ''label'' ]]
:{{ ''pagename'' <nowiki />| ''parameter'' }}
:[[ ''fullpagename'' | {{ ''pagename'' }<nowiki />} ]<nowiki />]
:{{ ''pagename'' | [[ ''fullpagename'' ]<nowiki />] }}
:{{ ''pagename'' <nowiki />| {{ ''pagename'' }<nowiki />} }}
Unless you use the two "balanced" nowiki tags, troubleshooting [[help:strip markers|strip marker]] errors and template parameter-handling inconsistencies is a risk. Also, a rendering error may arise when two <kbd>[<nowiki />[...]]</kbd> square brackets are on the same line, or two <kbd>{<nowiki />{...}}</kbd> curly brackets are in the same section, but only when the two have the nowiki markup placed inconsistently.
====Displaying wikilinks====
(These are all live examples.)
<pre>
[[ wp:pagename | page name ]]
[<nowiki />[ wp:pagename | page name ]]
[[<nowiki /> wp:pagename | page name ]]
[[ wp:pagename <nowiki />| page name ]]
[[ wp:pagename | page name ]<nowiki />]</pre>
<poem>
:[[ wp:pagename | page name ]]
:[<nowiki />[ wp:pagename | page name ]]
:[[<nowiki /> wp:pagename | page name ]]
:[[ wp:pagename <nowiki />| page name ]]
:[[ wp:pagename | page name ]<nowiki />]
</poem>
For '''nested structures''', escaping an inner structure escapes its outer structure too.
<pre>
[[ wp: {{ 1x | pagename }} ]]
[[ wp: {<nowiki />{ 1x | pagename }} ]]
[[ wp: {{<nowiki /> 1x | pagename }} ]]
[[ wp: {{ 1x <nowiki />| pagename }} ]]</pre>
<poem>
:[[ wp: {{ 1x | pagename }} ]]
:[[ wp: {<nowiki />{ 1x | pagename }} ]]
:[[ wp: {{<nowiki /> 1x | pagename }} ]]
:[[ wp: {{ 1x <nowiki />| pagename }} ]]
</poem>
For '''two, first pipes''', two nowiki tags are required:
<pre>
[[ wp: pagename | {{ 1x | label }} ]]
[[ wp: pagename <nowiki />| {{ 1x <nowiki />| label }} ]]
&lt;nowiki>[[ wp: pagename | {{ 1x | label }} ]] &lt;/nowiki></pre>
<poem>
:[[ wp: pagename | {{ 1x | label }} ]]
:[[ wp: pagename <nowiki />| {{ 1x <nowiki />| label }} ]]
:<nowiki>[[ wp: pagename | {{ 1x | label }} ]] </nowiki>
</poem>
====Displaying template calls====
{{See also|Template:tl}}
For templates, put nowiki before the first pipe.
If a parameter has a wikilink, put it in that, an inmost position.
<pre>
{<nowiki />{ val | u=&amp;gt; [[ms]] | 49082 }}
{{<nowiki /> val | u=&amp;gt; [[ms]] | 49082 }}
{{ val <nowiki />| u=&amp;gt; [[ms]] | 49082 }}
{{ val | u= &gt; [[ms]] | 49082 }<nowiki />}
{{ val | u= &gt; [[ ms ]<nowiki />] | 49082 }} </pre>
<poem>
:{<nowiki />{ val | u=&gt; [[ms]] | 49082 }}
:{{ val | u= &gt; [[ms]] | 49082 }<nowiki />}
:{{<nowiki /> val | u=&gt; [[ms]] | 49082 }}
:{{ val <nowiki />| u=&gt; [[ms]] | 49082 }}
:{{ val | u= &gt; [[ ms ]<nowiki />] | 49082 }} {{OK}}
</poem>
====顯示魔術字====
{{Further|Help:魔術字|Help:Parser function}}
For input '''parameters''', {{{1}}}, {{{2}}}, just write them out, unless they have a default (which goes behind their pipe):
{{&lt;nowiki />{1|default}}} &rarr; {{<nowiki />{1|default}}}
For a '''parser function''' nowiki goes between bracketing-pair characters, or anywhere before the : colon.
<pre>
{{ #ifeq: inYes | inYes | outYes | outNo }}
{<nowiki />{ #ifeq: inYes | inYes | outYes | outNo }}
{{<nowiki /> #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq<nowiki />: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }<nowiki />}</pre>
<poem>
:{{ #ifeq: inYes | inYes | outYes | outNo }}
:{<nowiki />{ #ifeq: inYes | inYes | outYes | outNo }}
:{{<nowiki /> #ifeq: inYes | inYes | outYes | outNo }}
:{{ #ifeq<nowiki />: inYes | inYes | outYes | outNo }}
:{{ #ifeq: inYes | inYes | outYes | outNo }<nowiki />}
</poem>
'''Behavioral switches''' expect the tag anywhere:
<pre>
1. __HIDDENCAT__
2. __HIDDENCAT<nowiki />__</pre>
:1. __HIDDENCAT__{{break}}
:2. __HIDDENCAT<nowiki />__
====Displaying tags====
{{tag|tags|o}} do not display; they are just markup. If you want them to, insert {{tag|nowiki|s}} after an {{code|<}} opening angle bracket; it goes only in the very front. Opening tags and closing tags must be treated separately.
<pre>
<span style=color:blue> Blue </span>
<<nowiki />span style=color:blue> Blue <<nowiki />/span>
<section end=la<nowiki />bel /> </pre>
<poem>
:<span style=color:blue> Blue </span>
:<<nowiki />span style=color:blue> Blue <<nowiki />/span>
:<section end=la<nowiki />bel /> {{cross}}
</poem>
Use template {{tl|tag}} instead of nowiki tags to display parser tags:
'''Character entities''', nowiki cannot escape. 
To escape HTML or special character entities, replace <code>&</code> with <code>&amp;amp;</code>.
For example, <code>&amp;amp;lt;</code> &rarr; <code>&amp;lt;</code>
To '''display a nowiki tag''', you can (1) use {{tl|tag}}, (2) replace the < left angle bracket with its HTML character entity, or (3) nest nowiki tags in each other:
<pre>
{{ tag | nowiki }}
<code>&amp;lt; nowiki>...&amp;lt;/ nowiki ></code>
<code><<nowiki />nowiki>...<<nowiki />/ nowiki ></code></pre>
<poem>
:{{ tag | nowiki }}
:<code>&lt; nowiki>...&lt;/ nowiki ></code>
:<code><<nowiki /> nowiki>...<<nowiki />/ nowiki ></code>
</poem>
<pre>
{{ tag | nowiki | s }}
<code>&amp;lt; nowiki /></code>
<code>&lt;&lt;nowiki /> nowiki /></code>
<code>&lt;nowiki>&lt; nowiki />&lt;/nowiki></code></pre>
<poem>
:{{ tag | nowiki | s }}
:<code>&lt; nowiki /></code>
:<code><<nowiki /> nowiki /></code>
:<code><nowiki>< nowiki /></nowiki></code>
</poem>
Nowiki tags do not otherwise nest, so it is the second and fourth that displays:
<pre>
1&lt;nowiki>2&lt;nowiki>3</nowiki>4</nowiki>
&lt;nowiki>{{!}}&lt;nowiki></nowiki>{{!}}</nowiki>
</pre>
<poem>
:1<nowiki>2<nowiki>3</nowiki>4</nowiki> {{spaces|5}} ''{{small|second and fourth}}''
:<nowiki>{{!}}<nowiki></nowiki>{{!}}</nowiki>
</poem>
These simply scan from left to right.
The paired tags cannot overlap, because the very first pair-match nullifies any intervening tags inside. Unbalanced tags always display.
Nowiki tags do not display table markup, use {{tag|pre}}.
===Pre===
{{shortcut|WP:PRE}}
{{tag|pre|o}} is a parser tag that emulates the HTML {{tag|pre|o}} tag. It defines preformatted text that is displayed in a fixed-width font and is enclosed in a dashed box. HTML and wiki markups are escaped and spaces and line breaks are preserved, but HTML entities are parsed.
{{markup|title={{tag|pre|o}} examples
|<nowiki><pre><!--Comment-->
[[wiki]] markup &amp;amp;</pre></nowiki>
|<pre><!--Comment-->
[[wiki]] markup &amp;</pre>
}}
{{tag|pre|o}} formatted text does not wrap, thus text may extend past the browser window:
<pre>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</pre>
To resolve this, {{tag|pre|o}} may use CSS styling to add wrapping or a horizontal scrollbar:
* Wrapping: {{tag|pre|o|params=style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;"}}
* Scroll bar: {{tag|pre|o|params=style="overflow:auto; width:auto;"}}
Alternatively, consider using {{tl|pre2}} template or {{xtag|syntaxhighlight|p|params=lang="text"}}.
==隱藏文字(註解)==
{{see also|Help:Hidden text}}
It's uncommon{{spaced ndash}}but on occasion acceptable for notes to other editors{{spaced ndash}}to add a hidden comment within the text of an article. These comments are visible only when editing or viewing the source of a page. Most comments should go on the appropriate [[Wikipedia:Talk page|Talk page]]. <!-- This is an example of text that is not visible except in "edit" mode. --> The format is to surround the hidden text with "<code>&lt;!--</code>" and "<code>--&gt;</code>" and may cover several lines, e.g.:
<nowiki><!-- An example of hidden comments
This won't be visible except in "edit" mode. --></nowiki>
Another way to include a comment in the wiki markup uses the {{tl|Void}} template, which can be abbreviated as {{tl|^}}. This template "expands" to the empty string, generating no HTML output; it is visible only to people editing the wiki source. Thus {{nowrap|1=<code>{{tlp|^|A lengthy comment here}}</code>}} operates similarly to the comment {{nowrap|1=<code>&lt;!-- A lengthy comment here --&gt;</code>}}. The main difference is that the template version can be nested, while attempting to nest HTML comments produces odd results.
==變數==
{{seealso| Help:Magic_words#Variables}}
{| style="text-align:center" class="wikitable"
|-
! 原始碼
! 效果
! 註解
|-
| <nowiki>{{CURRENTWEEK}}</nowiki> || {{CURRENTWEEK}}
|
|-
| <nowiki>{{CURRENTDOW}}</nowiki> || {{CURRENTDOW}}
|
星期一 = 1、星期二 = 2,依此類推,但星期日 = 0
|-
| <nowiki>{{CURRENTMONTH}}</nowiki> || {{CURRENTMONTH}}
|
|-
| <nowiki>{{CURRENTMONTHNAME}}</nowiki>
| {{CURRENTMONTHNAME}}
|
|-
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki>
| {{CURRENTMONTHNAMEGEN}}
|
|-
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}
|
|-
| <nowiki>{{CURRENTDAYNAME}}</nowiki> || {{CURRENTDAYNAME}}
|
|-
| <nowiki>{{CURRENTYEAR}}</nowiki> || {{CURRENTYEAR}}
|
|-
| <nowiki>{{CURRENTTIME}}</nowiki> || {{CURRENTTIME}}
|
|-
| <nowiki>{{NUMBEROFARTICLES}}</nowiki>
| {{NUMBEROFARTICLES}}
|
|-
| <nowiki>{{NUMBEROFPAGES}}</nowiki>
| {{NUMBEROFPAGES}}
|
|-
| <nowiki>{{NUMBEROFUSERS}}</nowiki>
| {{NUMBEROFUSERS}}
|
|-
| <nowiki>{{PAGENAME}}</nowiki> || {{PAGENAME}}
|
|-
| <nowiki>{{NAMESPACE}}</nowiki> || {{NAMESPACE}}
|
|-
| <nowiki>{{REVISIONID}}</nowiki> || {{REVISIONID}}
|
|-
| <nowiki>{{REVISIONUSER}}</nowiki> || {{REVISIONUSER}}
|
|-
| <nowiki>{{localurl:pagename}}</nowiki>
| {{localurl:pagename}}
|
|-
| <nowiki>{{localurl:</nowiki>''Wikipedia:Sandbox''<nowiki>|action=edit}}</nowiki>
| {{localurl:Wikipedia:Sandbox|action=edit}}
|
|-
| <nowiki>{{fullurl:pagename}}</nowiki>
| {{fullurl:pagename}}
|
|-
| <nowiki>{{fullurl:pagename|</nowiki>''query_string''<nowiki>}}</nowiki>
| {{fullurl:pagename|query_string}}
|
|-
| <nowiki>{{SERVER}}</nowiki> || {{SERVER}}
|
|-
| <nowiki>{{ns:1}}</nowiki> || {{ns:1}}
|
<nowiki>{{ns:</nowiki>''index''<nowiki>}},如:{{ns:1}}</nowiki>  &rarr;  名字空間全名
|-
| <nowiki>{{SITENAME}}</nowiki> || {{SITENAME}}
|
|}
'''{{tlf|NUMBEROFARTICLES}}''' is the number of pages in the main namespace that contain a link and are not a redirect. This includes full articles, stubs containing a link, and disambiguation pages.
'''{{tlf|CURRENTMONTHNAMEGEN}}''' is the genitive (possessive) grammatical form of the month name, as used in some languages but not in English; '''{{tlf|CURRENTMONTHNAME}}''' is the nominative (subject) form, as usually seen in English.
In languages where it makes a difference, you can use constructs like <code><nowiki>{{grammar:case|word}}</nowiki></code> to convert a word from the nominative case to some other case. For example, <code><nowiki>{{grammar:genitive|{{CURRENTMONTHNAME}}}}</nowiki></code> means the same as <code><nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki></code>. <!-- Is there a reference for this, other than the source code (for example, phase3/languages/Lnaguage*.php) ? -->
==HTML==
{{main|Help:HTML}}
許多[[HTML]]標籤可用於Wiki標記式語言。You can check your HTML by using [[Help:Markup validation|markup validation]].
==參見==
{{Help desk}}
See the 'Coding wiki markup' section of the Help navigation navbox below for additional links.
*[[Help:Magic links]]: magic links are automatic links for certain unique identifiers that require no markup.
*[[Wikipedia:Extended image syntax]]: advanced [[Help:Visual file markup|visual file markup]].
*[[Help:A quick guide to templates]]: an introduction to [[Help:Template|templates]].
*[[Help:Substitution]]: substitution is an alternative way of including templates than [[Wikipedia:Transclusion|transclusion]]
*[[Help:Score]]: how to render musical scores.
*[[Help:Displaying a formula]]: displaying mathematical formulae.
{{Help navigation}}
{{Tools |state=collapsed}}
[[Category:维基百科指南]]
[[Category:Wikipedia editor help]]
[[Category:維基百科文字幫助文檔]]

2021年12月21日 (二) 02:16的最新版本

布局

基本语法

标题

<syntaxhighlight line='line'>

二级标题

三级标题

</syntaxhighlight>

换行

<syntaxhighlight lang="html" line='line'>
</syntaxhighlight>

删除线

<syntaxhighlight lang="html" line='line'> 删除的文字 </syntaxhighlight>

表格

代码: <syntaxhighlight line='line'>

标题文本
标题文字 标题文字 标题文字
示例 示例 示例
示例 示例 示例
示例 示例 示例

</syntaxhighlight> 效果:

标题文本
标题文字 标题文字 标题文字
示例 示例 示例
示例 示例 示例
示例 示例 示例