Help:Wikitext
![本页使用了标题或全文手工转换](https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Zh_conversion_icon_m.svg/35px-Zh_conversion_icon_m.svg.png)
![本页使用了标题或全文手工转换](https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Zh_conversion_icon_m.svg/35px-Zh_conversion_icon_m.svg.png)
![]() |
Wikitext[1],
佈局
[编辑]章節
[编辑]一份頁面的章節應遵循頁面的
章節 標題
[编辑]「= 标题 =
」====== 标题 ======
」
前後 各 一 個 「=」被 規定 為 條目 的 標題 ,不 應用 於條目 內容。標題 的 樣式 由 CSS規範 並 增加 一 個 「[
」編輯 ]連結 。相關 的 CSS語法 請參考 這裡。- 四個以上的章節標題會自動生成章節目錄。
不 得 在 標題 語法 最後 使用 任 何 語法 ,這將會 導 致章節 標題 格式 消失 ,或 是 無法 在 編輯 摘要 中 自動 包含 章節 標題 名稱 。
{{fake heading}}
水平 線
[编辑]
|
|
HTML<hr />
目錄 表
[编辑]- 「
__FORCETOC__
」將 強制 章節 目錄 自動 顯示 於正常 位置 ,無論 章節 標題 數量 為 何 。 - 「
__TOC__
」將 會 使 章節 目錄 從 正常 位置 移動 到 魔術 字 插入 的 位置 。 - 「
__NOTOC__
」將 會 不 顯示 章節 目錄 。 - 「{{TOC limit}}」
可用 於控制 章節 目錄 所 包含 的 章節 層 級 ,當 某 個條 目的 章節 數量 與 層 級 太 多 時 非常 有用 。 - Category:
目錄 模 板 包含 特定 的 章節 目錄 模 板 。
斷行
[编辑]在 條目 內容內顯示 一 個 明 顯 的 斷行 ,請輸入 兩次 ↵ Enter。輸入 一 次 ↵ Enter會 在 標記 式 語 言 編輯 畫面 中 顯示 為 斷行 ,但 輸出 內容中 只 会 形成 一 个空格 。使用 清 單語 法 时例外 。粗 體 或 斜體 等 標記 式 語 言 會 在 斷行 處 終結 。
|
|
HTML<br>
<br />
。
- 「{{break}}」
可 增加 多 個 斷行 。 - 「{{-}}」
與 「{{clear}}」可 增加 樣式 方面 的 斷行 ,以終止 浮動 元素 的 適用 。 - 「{{plainlist}}」
與 「{{unbulleted list}}」兩者 可 增加 一份沒有項目符號的清單。
文字 縮 排
[编辑]
|
Outdent |
區 塊 引言
[编辑]如有
|
|
文字 置 中
[编辑]
|
|
{{center}}<center>...</center>
,
文字 靠 右
[编辑]您可以將
|
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.
|
|
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.
|
|
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.
|
列 表
[编辑]無 序 號 列 表
[编辑]
|
|
有 序 號 列 表
[编辑]
|
|
描述列 表
[编辑]
如果
描述:
」;
」
|
|
|
|
HTML<dl>
<dt>...</dt>
、<dd>...</dd>
</dl>
保留 換 行 與 空白
[编辑]MediaWiki<poem>...</poem>
<blockquote>...</blockquote>
;而{{poemquote}}
<poem style="margin-left: 2em;">
。
|
In Xanadu did Kubla Khan |
lang="xx"
{{Clear|left}}
"float:left;"
<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}}
Frère Jacques, frère Jacques,
Dormez-vous? Dormez-vous?
Sonnez les matines! Sonnez les matines!
Ding, dang, dong. Ding, dang, dong.
賈克
您在
叮,叮,鐺。叮,叮,鐺。
格式
[编辑]文字 格式
[编辑]描述 | ||
---|---|---|
|
如果 |
如果 如果 |
|
<code>int m2()</code> |
|
|
<syntaxhighlight lang="cpp">
#include <iostream>
int m2 (int ax, char *p_ax) {
std::cout <<"Hello World!";
return 0;
}</syntaxhighlight>
<source lang="cpp">
#include <iostream>
int m2 (int ax, char *p_ax) {
std::cout <<"Hello World!";
return 0;
}</source>
|
#include <iostream>
int m2 (int ax, char *p_ax) {
std::cout <<"Hello World!";
return 0;
}
|
|
|
|
|
舉例,如果 |
舉例,如果 |
|
|
|
To prevent two words from becoming separated by a linewrap (e.g. Mr. Smith or 400 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 {{nowrap}} is probably more suitable.) |
Mr.&nbsp;Smith or 400&nbsp;km/h
|
Mr. Smith or 400 km/h |
|
瑪麗{{pad|4.0em}} |
瑪麗 |
特殊 字 元
[编辑]Special characters can often be displayed using numeric character references or character entity references. See Character encodings in HTML for more information. For example, À
and À
both render À (A-grave). Percent-encoding can't be used, as it works only in URLs.
變 音符 號
[编辑]
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ñ Ò Ó Ô Õ Ö Ø Œ Ù Ú Û Ü Ÿ ß à á â ã ä å æ ç è é ê ë ì í î ï ñ ò ó ô õ ö ø œ ù ú û ü ÿ |
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ñ Ò Ó Ô Õ Ö Ø Œ Ù Ú Û Ü Ÿ ß à á â ã ä å æ ç è é ê ë ì í î ï ñ ò ó ô õ ö ø œ ù ú û ü ÿ |
特殊 標 點 符號
[编辑]¿ ¡ § ¶
|
¿ ¡ § ¶ |
† ‡ • – —
|
† ‡ • – — |
‹ › « »
|
‹ › « » |
‘ ’ “ ”
|
‘ ’ “ ” |
' "
|
' " |
Escaping punctuation characters
[编辑]<pre>
、<nowiki>
及<code>
商業 符號
[编辑]™ © ®
|
™ © ® |
¢ € ¥ £ ¤
|
¢ € ¥ £ ¤ |
希 臘字母
[编辑]α β γ δ ε ζ
|
|
Α Β Γ Δ Ε Ζ
|
|
η θ ι κ λ μ ν
|
|
Η Θ Ι Κ Λ Μ Ν
|
|
ξ ο π ρ σ ς
|
|
Ξ Ο Π Ρ Σ
|
|
τ υ φ χ ψ ω
|
|
Τ Υ Φ Χ Ψ Ω
|
埃及 象形 文字
[编辑]WikiHiero<hiero>
舉例:
<hiero>P2</hiero> |
| ||
國際 象棋 符號
[编辑]舉例,「♔」
上 標 與 下 標
[编辑]格式 手 冊 推薦 使用 <sub>
與 <sup>
格式 ,例 如x
。<sub>1</sub>
本格 式 應 使用 於大 多數 情況 。下表 所 列 出 的 第 二種上標與下標方式,不能 用 於絕大 多數 內容,這必需仰賴 Unicode的 支援 ,並 非 所有 使用 者 的 機器 能 正確 顯示 。
描述 | ||
---|---|---|
|
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup> |
x1 x2 x3 x⁰ x¹ x² x³ x⁴ x⁵ x⁶ x⁷ x⁸ x⁹ |
|
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub> |
x1 x2 x3 x₀ x₁ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ |
|
ε<sub>0</sub> = 8.85 × 10<sup>−12</sup> C² / J m 1[[ |
|
私人 使用 區 字 元 以及不可 見 字 元
[编辑]數學 字 元 與 方程式
[编辑]數學 字 元
[编辑]- 請
參考 Wikipedia:数学 符号 、数学 专题與 TeX。
∫ ∑ ∏ √ | ∫ ∑ ∏ √ |
− ± ∞ | − ± ∞ |
≈ ∝ ≡ ≠ | ≈ ∝ ≡ ≠ |
≤ ≥ | ≤ ≥ |
× · ÷ ∂ | × · ÷ ∂ |
′ ″ | ′ ″ |
∇ ‰ ° ∴ ℵ | ∇ ‰ ° ∴ ℵ |
ø | ø |
∈ ∉ ∩ ∪ | ∈ ∉ ∩ ∪ |
⊂ ⊃ ⊆ ⊇ | ⊂ ⊃ ⊆ ⊇ |
¬ ∧ ∨ ∃ ∀ | ¬ ∧ ∨ ∃ ∀ |
⇒ ⇐ ⇓ ⇑ ⇔ | ⇒ ⇐ ⇓ ⇑ ⇔ |
→ ← ↓ ↑ ↔ | → ← ↓ ↑ ↔ |
數學 公式
[编辑]方程式 中 的 數學 字母 (如x)以及運算 符號 (如×
)不 應 使用 普通 字母 ,如x
。請參考 數學 公式 的 排 版 。关于符号 大全 ,以及标签<math>
和 模 板 {{math}}之 间的比 较,参 见 LaTeX vs HTML。<math>
标签的 排 版 使用 了 LaTeX 语法,将 根 据 环境设定作 为一张图片或作为 HTML呈 现。<math>
标签最 适合于独立 行 中 ,以图片 格式 呈 现复杂的行 间公式 。若 需使用 该模板 以置入行 内 公式 ,请置其于<nowrap>
模 板 内部 。<math>
模 板 使用 了 HTML,采 用 自 适应尺寸 的 衬线字体 ,同 时会阻止 通常 的 换行。所有 模 板 都 对符号 =
敏感 ,在 模 板 的 输入过程中 ,谨记以{{=}}
替 换=
,以1=
开始输入。于模板 {{math}}内部 使用 维基标识''
和 '''
与 其他 HTML 实体并无区 别。模 板 {{math}}最 适合用 于行内 公式 。
|
2x × 4y ÷ 6z + 8 − y/z2 = 0
|
單一 數學 方程式 中 插入 空白
[编辑]使用
以预防 换行并无必要 ;模 板 {{math}} 无论如何 都会 阻止 换行;如果需要 在 公式 内部 明 确换行 ,你可以使用 <br />
。
|
It follows that x2 ≥ 0 for real x. |
複雜 方程式
[编辑]参 见Help:数学 公式 以查阅如何 使用 <math>
。- 显示
在 一行中的公式应使用半角冒号(:)字 符 缩进。
|
|
連結 與 網 址
[编辑]維基連結
[编辑][[內部
),豎線[[
)。
連結 至 其他維基百科 條目
[编辑]在 内部 运作中 ,每 个目标页面 的 首 字母 会 被 自 动大写 ,同 时空格 会 用 下 划线(“_”)表示 。(输入下 划线的 效果 會 和 输入空 格 完全 一 樣 ,但 這個做法不 推荐)因 此链接 [[
台北 車 站 (桃園 捷 運 )]]会 指向 这个地 址 :https://zh.wikipedia.org/wiki/
。台北 車 站_(桃園 捷 運 )更 多 详情请参阅Help:链接。
- 红色链接
表示 尚 未 存在 的 页面;点 击进去 可 以创建 这个页面。 指向 自己 頁 面 的 链接只 会 显示为加 粗 文 本 。
|
|
[[Help:Wiki |
重 命名 連結
[编辑]用 於相同 目標 頁 面 但 有 不同 顯示 名稱 的 情 形 。目標 頁 面 文字 應 當 放 在 第 一 個 位置 ,顯示 文字 則 置 於第 二 個 位置 (以「豎線」為 界 )。
|
|
自動 重 新 命名 連結
[编辑]在 一 些情形 下 ,你只要 在 某 個 链接的 後 面 打上 一 個 豎線,系統 會 自動 重 新 命名 這個链接。下 次 你開啟 編輯 方 塊 時 ,你會看 到 修 改 後 的 新 連結 。當 你預 覽 你的編輯 時 ,在 你按下 Save或 是 再 次 按下Edit之 前 ,你都不 會 看 到 修 改 後 的 新 連結 。同樣 的 情 形 ,也會套用在 链接到 同 一 頁 的 某 個 段落 。
|
[[ |
|
[[Seattle, Washington|]]
|
Seattle | |
|
[[Wikipedia: |
|
|
[[Wikipedia:Manual of Style (headings)|]]
|
|
|
[[Wikipedia: |
[[Wikipedia: |
連結 至 條目 的 章節
[编辑]井 號 後 的 部分 可 以連結 到 條目 的 特定 章節 ([[內部
)。連結 #章節 名稱 ]]若 該章節 不 存在 ,則 會 連結 到 該條目的 頂 端 。加 上 豎線,讓 產 生 的 連結 更 好 看 ([[內部
連結 #章節 名稱 |內部連結 ]]或 [[內部
)。連結 #章節 名稱 |章節 名稱 ]]若 欲 連結 至 同 一 個 頁 面 的 特定 章節 ,可 以直接 輸入 井 號 ([[#
)。相 同 頁 面 的 章節 名稱 ]]
[[ |
|
[[# |
|
[[Wikipedia: |
|
建立 紅 鏈
[编辑]
這裡 |
這裡 |
重定 向
[编辑]描述 | |
---|---|
|
#REDIRECT [[ |
|
#REDIRECT [[ |
連結 至 其他命名 空間
[编辑]若 連結 非 條目 ,方 括 號 裡 必須 包括 命名 空間 ,可 以使用 簡稱。
|
|
|
|
|
|
連結 至 同 一 條 目的 不同 語 言 版本 (跨 語 言 連結 )
[编辑]![]() |
- 如果
要 產 生 至 其他語 言 的 對應 頁 面 的 連結 ,請使用 這個格式 :[[
語 言 代 碼:外語 頁 面 名稱 ]] 建議 跨 語 言 連結 放 在 頁 面 內容的 最後 。跨 語 言 連結 不 會 在 內容文 本中 出現 ,而是出現 在 左側 「其他語 言 」區 塊 底 下 。
注意 :上述 方法 除 非 有 特殊 狀況 ,否 則 已 由 維基數 據 取 代 。如果要 在 條目 或 文 本 內容中 建立 任 何 外語 條目 或 內容的 內部連結 ,請見Help:跨 语言链接#出現 在 正文 中 的 連結 並 理解 使用 方法 。
描述 | |
---|---|
「es」 |
[[es:Plancton]] |
其他 |
[[fr:Plancton]] [[de:Plankton]] [[ru:Планктон]] [[simple:Plankton]] |
跨 Wiki連結
[编辑]跨 Wiki連結 可 連結 至 其他Wiki網 站的任 何 頁 面 。維基專 案 間 連結 可 連結 至 其他維基媒體 的 Wiki網 站。- 請
注意 跨 Wiki連結 需使用 內部連結 ,也就是 兩側 放 入 半 形 方 括 號 。 - 請
參考 跨 Wiki地圖 中 所 列 出 的 捷徑 ;如果您想要 連結 的 網 站不在 該列表 中 ,請使用 外部 連結 。 - 也請
參考 姊妹計畫 。
描述 | ||
---|---|---|
| ||
|
[[Wiktionary:hello]]
[[Wiktionary:hello|]]
[[Wiktionary:hello|Hello |
|
| ||
|
[[Wiktionary:fr:bonjour]]
[[Wiktionary:fr:bonjour|]]
[[Wiktionary:fr:bonjour|bonjour]]
|
分類
[编辑]用 [[Category:
分類 名稱 ]]可 以把頁 面 加 到 一 個 分類 中 ,這些連結 應 該一起放在條目的最末處。若 您要在 頁 面 中 顯示 一 個 指向 分類 頁 面 的 連結 ,在 Category前 加 上 一 個 半 形 冒 號 ([[:Category:
)分類 名稱 ]]
描述 | ||
---|---|---|
|
[[Category:维基 |
|
|
[[:Category:维基 |
|
|
[[:Cat:维基 |
|
|
[[:Category:维基 |
外部 連結
[编辑]單 個 方 括 號 用 於定義 外部 連結 。不同 於內部 連結 的 豎線,請使用 半 形 空 格 分 開 URL和 連結 顯示 的 名稱 ([
)。如果網 址 顯示 的 文字 ]方 括 號 內沒有 URL,其依然 可 當 作 普通 符號 使用 ——[像 這樣]。- A URL must begin with a supported URI scheme:
http://
andhttps://
will be supported by all browsers;irc://
,ircs://
,ftp://
,news://
,mailto:
, andgopher://
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 encoded. For example, a space must be replaced by
%20
. Encoding can be achieved by:
space | " | ' | , | ; | < | > | ? | [ | ] |
---|---|---|---|---|---|---|---|---|---|
%20 | %22 | %27 | %2c | %3b | %3c | %3e | %3f | %5b | %5d |
- Or use the {{urlencode:}} magic word. See Help:Magic words in the MediaWiki documentation for more details.
- See External links for style issues, and External link file type templates for indicating the file type of an external link with an icon.
Description | ||
---|---|---|
|
[http://www.wikipedia.org Wikipedia]
|
|
|
[http://www.wikipedia.org]
|
|
|
http://www.wikipedia.org
|
|
|
<span class="plainlinks">[http://www.wikipedia.org Wikipedia]</span>
|
自動 化 連結
[编辑]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 ISBN, which creates a link to
網 路 書 源 . 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.
{{ISBN|022628705X}}
|
|
{{ISBN|0-22-628705-X}}
|
|
Link to a book using [[Special:BookSources/0670037818|alternative text, such as its title]]
|
Link to a book using alternative text, such as its title |
RFC號 碼
[编辑]What you type | What it looks like |
---|---|
Text mentioning an RFC number anywhere, e.g. RFC 4321.
|
Text mentioning an RFC number anywhere, e.g. RFC 4321. |
雜 項
[编辑]「截至」模 板
[编辑]- The 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 {{As of}} documentation.
What you type | What it looks like |
---|---|
{{As of|2009|4|df=us}}
|
截至2009 |
{{As of|2009|4|df=us|lc=y}}
|
截至2009 |
多 媒體 連結
[编辑]- To include links to non image uploads such as sounds, use a "media" link. For images, see next section.
- Some uploaded sounds are listed at Commons:Sound.
What you type | What it looks like |
---|---|
[[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:
描述 | ||
---|---|---|
{{fullurl}} |
[{{fullurl:Help:Wiki markup|action=edit}} |
|
{{Edit}} |
{{edit}}
|
|
部分 文字 斜體 化 的 連結
[编辑]- Linking to a page with a title containing words that are usually italicized, such as the Hindenburg disaster article.
What you type | What it looks like |
---|---|
[[Hindenburg disaster|''Hindenburg'' disaster]]
|
音 标注记
[编辑]很多时候
'''Konjac''' {{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}}
|
Konjac |
'''Konjac''' ({{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}} {{respell|KOHN|yak}})
|
Konjac ( |
''Konjac'' is pronounced {{IPAc-en|ˈ|k|oʊ|n|j|æ|k}} in English.
|
Konjac is pronounced /ˈkoʊnjæk/ in English. |
关于
音樂 符號
[编辑]<score>……</score>
擴展
|
![]() |
圖像
[编辑]The image name, the word thumb then the caption:
[[File:wiki.png|thumb|Wikipedia logo]]
|
The image name, the word thumb then the caption :
![]() |
| |||
A picture: [[File:wiki.png]]
|
A picture: ![]() |
| |||
With alternative text:
[[File:wiki.png|alt=Puzzle globe logo]]
|
With alternative text: |
| |||
With link:
[[File:wiki.png|link=Wikipedia]]
|
With link:
![]() |
| |||
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]]>
|
Forced to the centre of the page using the frame tag (attribute), a centre tag and a caption:
![]() |
| |||
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]]
|
Forced to the left side of the page using the thumb attribute, the left attribute and a caption:
![]() |
| |||
Forced to the right side of the page
''without'' a caption:
[[File:wiki.png|right|Wikipedia encyclopedia]]
|
Forced to the right side of the page without a caption:
![]() |
| |||
A picture resized to 50 pixels...
[[File:wiki.png|50 px|Wikipedia encyclopedia]]
|
A picture resized to 50 pixels... |
| |||
Linking directly to the description page of an image:
[[:File:wiki.png]]
|
Linking directly to the description page of an image: |
| |||
Linking directly to an image without displaying it:
[[Media:wiki.png|Image of jigsaw globe]]
|
Linking directly to an image without displaying it: |
| |||
Example:
<div style="display: inline; width: 220px; float: right;">
[[File:wiki.png|50 px|Wikipedia encyclopedia]][[File:wiki.png|50 px]] </div>
|
Example: |
| |||
Example:
{| align=right
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|}
|
Example: |
|
表 格
[编辑]使用 特殊 的 Wiki標記 式 語 言 (參 見 Help:表 格 )。使用 HTML元素 :<table>
、<tr>
、<td>
或 <th>
。
請
分 栏显示
[编辑]參考 文獻 與 引用 來 源
[编辑]Making a reference citing a printed or online source can be accomplished by using the <ref>...</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.
What it's for | What you type |
---|---|
To create the reference | <ref name="name for reference">Use a closing tag</ref>
|
To cite a book | {{cite book}}
|
To cite a web source | {{cite web}}
|
Book ISBN | |isbn=0-4397-0818-4 (ISBN of the book)
|
Web URL | |url=http://www.wikipedia.org
|
Title | |title=title of source
|
Author | |author=authors, use commas for multiple
|
First name | |first=first name
|
Last name | |last=last name
|
Location | |location=location of publisher
|
Publisher | |publisher=who published the source
|
Date | |date=2007-09-21 (date of source)
|
Year | |year=year of source
|
Accessed date | |accessdate=2008-12-25 (only if url= is included)
|
A complete reference tag | <ref name="WikiMarkup"> {{cite web |url=http://en.wikipedia.org/w/index.php?title=Help:Wiki_markup |title=Help:Wiki markup |publisher=Wikimedia Foundation}} </ref>
|
Referencing this again | <ref name="WikiMarkup" />
|
Citation needed | {{Citation needed|{{subst:DATE}}}}
|
模 板 與 包含 嵌入 頁 面
[编辑]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 {{double braces}}. It is also possible to transclude other pages by using {{:colon and double braces}}.
There are three pairs of 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".
- <noinclude>: the content will not be rendered there. These tags have no effect here.
- <includeonly>: the content will render only there, and will not render here (like invisible ink made visible by means of transclusion).
- <onlyinclude>: 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 "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 <onlyinclude> tags. To append text there, wrap the addition in <includeonly> tags before, within, or after the section. To omit portions of the section, nest <noinclude> tags within it.
If a page is transcluded without transclusion markup, it may cause an unintentional categorization. Any page transcluding it will contain the same category as the original page. Wrap the category markup with <noinclude> tags to prevent incorrect categorization.
Some templates take parameters, as well, which you separate with the pipe character |
.
{{Transclusion demo}} |
|
{{Help:Transclusion demo}} |
|
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}} |
This template takes two parameters, and creates underlined text with a hover box for many modern browsers supporting CSS: Hover your mouse over this text Go to this page to see the H:title template itself: {{H:title}} |
討論 頁 與 計畫 頁 面
[编辑]These are likely to be helpful on talk and project pages.
簽名
[编辑]- The tilde character (~) is used when signing a comment on a talk page. Your username provides a link to your user page.
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. |
|
|
Adding three tildes will add just your user name. |
|
|
Adding five tildes gives the date/time alone. |
|
07:45, 19 7 |
連結 至 某 個 頁 面 的 舊 有 修訂 版本 、修訂 差異 以及特定 歷史 頁 面
[编辑]- 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.
|
|
- If the diff intended to be shown is between an immediately previous revision, the first parameter can be dropped.
|
- For an old revision, you can also use a 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).
|
链入页面和 链入页面变更纪录
[编辑]以下 代 码可以转到相 应页面 查看链入页面和 链入页面变更纪录,如查看 Help:Wiki標記 式 語 言 的 相 关纪录:
|
|
|
使用 者 編輯
[编辑]- Link to a user's contributions page.
描述 | Username (registered users). | [[Special:Contributions/UserName]]
|
Special:Contributions/UserName | ||
---|---|---|---|---|---|
IPv4 address (unregistered users). | [[Special:Contributions/192.0.2.0]]
|
Special:Contributions/192.0.2.0 | |||
IPv6 address (unregistered users). | [[Special:Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329]]
|
Special:Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329 |
將 文字 上 色 或 高 亮 化
[编辑]使用 {{Color}}及{{Font color}}模 板 :
|
|
|
這是 |
範 例 文字
[编辑]The {{xt}}
family of templates can be used on help pages and user pages to highlight example text.
What you type | What you get |
---|---|
This is an {{xt|A correct example}} for comparison {{tick}} | This is an A correct example for comparison ![]() |
this is an {{!xt|An incorrect example}} for example {{cross}} | this is an An incorrect example for example ![]() |
this is an {{mxt|In monospace}} for comparison | this is an In monospace for comparison |
this is an {{!mxt|In monospace}} for comparison | this is an Template:!mxt for comparison |
this is an {{bxt|in bold}} for comparison | this is an Template:Bxt for comparison |
this is an {{!bxt|In bold}} for comparison | this is an Template:!bxt for comparison |
Show deleted or inserted text
[编辑]- 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
<s>...</s>
. - It is best to indicate inserted content using the underline markup
<u>...</u>
.
- It is best to indicate deleted content using the strike-through markup
- 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
<del>...</del>
. - It is best to indicate inserted content using the underline markup
<ins>...</ins>
.
- It is best to indicate deleted content using the strike-through markup
Note: <s></s>
and <u></u>
(speced in HTML 3 & 4) are considerably more popular than <del></del>
and <ins></ins>
(speced in HTML 5) on Wikipedia.
What you type | What it looks like |
---|---|
|
You can |
Alternative markup:
|
You can |
Strike through
[编辑]
This is also possible with the {{strike}}
} template.
What you type | What you get |
---|---|
This is {{strike|A misplaced bit of text}} for comparison | This is A misplaced bit of text for comparison |
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!
What you type | What it looks like |
---|---|
'''<nowiki> tag:''' <nowiki> The nowiki tag ignores [[wiki]] ''markup''. It reformats text by removing newlines and multiple spaces. It still interprets characters specified by &name;: → </nowiki> |
<nowiki> tag: The nowiki tag ignores [[wiki]] ''markup''. It reformats text by removing newlines and multiple spaces. It still interprets characters specified by &name;: → |
'''<pre> tag:''' <pre>The <pre> tag ignores [[wiki]] ''markup'' as does the <nowiki> tag. Additionally, <pre> displays in a mono-spaced font, and does not reformat text spaces. It still interprets special characters: → </pre> |
<pre> tag: The <pre> tag ignores [[wiki]] ''markup'' as does the <nowiki> tag. Additionally, <pre> displays in a mono-spaced font, and does not reformat text spaces. It still interprets special characters: → |
'''[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]. |
[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 Web link. |
'''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;
|
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: → |
無 Wiki模 式
[编辑]In order for the software to interpret wiki markup, its parser first scans the page. When it sees its nowiki tags
<nowiki>...</nowiki>
(escapes all contained wiki markup), and<nowiki />
(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 [[...]]outside
a wikilink, which would otherwise adhere to the wikilink font. They can also add line-spacing in the wikitext. Template editors: tag <nowiki>
works only on its source page, not the target; also {{#tag:nowiki | content}}
, although it wraps that content in nowiki tags, it also does a 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 or MediaWiki special characters.
There is only one meaning for what <nowiki>...</nowiki>
contains, so it needs few examples; but the singular <nowiki />
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 *
, #
, ;
or :
mean something.
# Ordered list |
|
<nowiki /># Ordered list |
# Ordered list |
A [[micro-]]second. |
A micro-second. |
A [[micro-]]<nowiki />second. |
A micro-second. |
a<nowiki> b</nowiki> |
a b |
'<nowiki />'Italics' markup'<nowiki />' |
''Italics' markup'' |
<nowiki>[[Example]]</nowiki> |
[[Example]] |
<nowiki><!-- revealed --></nowiki> |
<!-- revealed --> |
The rest of the section consists of simple, live examples showing how a single nowiki tag escapes entire linkage structures, beyond [[ wikilink ]] and {{ template }}:
- [[ fullpagename | label ]]
- {{ pagename | parameter }}
- [[fullpagename | {{ pagename }} ]]
- {{ pagename | [[ fullpagename ]] }}
- {{ pagename | {{ pagename }} }}
Unless you use the two "balanced" nowiki tags, troubleshooting strip marker errors and template parameter-handling inconsistencies is a risk. Also, a rendering error may arise when two [[...]] square brackets are on the same line, or two {{...}} 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.)
[[ wp:pagename | page name ]] [<nowiki />[ wp:pagename | page name ]] [[<nowiki /> wp:pagename | page name ]] [[ wp:pagename <nowiki />| page name ]] [[ wp:pagename | page name ]<nowiki />]
page name
[[ wp:pagename | page name ]]
[[ wp:pagename | page name ]]
[[ wp:pagename | page name ]]
[[wp:pagename | page name ]]
For nested structures, escaping an inner structure escapes its outer structure too.
[[ wp: {{ 1x | pagename }} ]] [[ wp: {<nowiki />{ 1x | pagename }} ]] [[ wp: {{<nowiki /> 1x | pagename }} ]] [[ wp: {{ 1x <nowiki />| pagename }} ]]
wp: pagename
[[ wp: {{ 1x | pagename }} ]]
[[ wp: {{ 1x | pagename }} ]]
[[ wp: {{ 1x | pagename }} ]]
For two, first pipes, two nowiki tags are required:
[[ wp: pagename | {{ 1x | label }} ]] [[ wp: pagename <nowiki />| {{ 1x <nowiki />| label }} ]] <nowiki>[[ wp: pagename | {{ 1x | label }} ]] </nowiki>
label
[[ wp: pagename | {{ 1x | label }} ]]
[[ wp: pagename | {{ 1x | label }} ]]
Displaying template calls
[编辑]For templates, put nowiki before the first pipe. If a parameter has a wikilink, put it in that, an inmost position.
{<nowiki />{ val | u=> [[ms]] | 49082 }} {{<nowiki /> val | u=> [[ms]] | 49082 }} {{ val <nowiki />| u=> [[ms]] | 49082 }} {{ val | u= > [[ms]] | 49082 }<nowiki />} {{ val | u= > [[ ms ]<nowiki />] | 49082 }}
{{ val | u=> ms | 49082 }}
{{ val | u= > ms | 49082 }}
{{ val | u=> ms | 49082 }}
{{ val | u=> ms | 49082 }}
{{ val | u= > [[ ms ]] | 49082 }}
顯示 魔術 字
[编辑]For input parameters, {{{1}}}, {{{2}}}, just write them out, unless they have a default (which goes behind their pipe): {{<nowiki />{1|default}}} → {{{1|default}}}
For a parser function nowiki goes between bracketing-pair characters, or anywhere before the : colon.
{{ #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 />}
outYes
{{ #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }}
Behavioral switches expect the tag anywhere:
1. __HIDDENCAT__ 2. __HIDDENCAT<nowiki />__
- 1.
- 2. __HIDDENCAT__
Displaying tags
[编辑]<tags>
do not display; they are just markup. If you want them to, insert <nowiki />
after an <
opening angle bracket; it goes only in the very front. Opening tags and closing tags must be treated separately.
<span style=color:blue> Blue </span> <<nowiki />span style=color:blue> Blue <<nowiki />/span> <section end=la<nowiki />bel />
Blue
<span style=color:blue> Blue </span>
bel />
Use template {{tag}} instead of nowiki tags to display parser tags:
Character entities, nowiki cannot escape.
To escape HTML or special character entities, replace &
with &
.
For example, &lt;
→ <
To display a nowiki tag, you can (1) use {{tag}}, (2) replace the < left angle bracket with its HTML character entity, or (3) nest nowiki tags in each other:
{{ tag | nowiki }} <code>< nowiki>...</ nowiki ></code> <code><<nowiki />nowiki>...<<nowiki />/ nowiki ></code>
< nowiki>...</ nowiki >
< nowiki>...</ nowiki >
< nowiki>...</ nowiki >
{{ tag | nowiki | s }} <code>< nowiki /></code> <code><<nowiki /> nowiki /></code> <code><nowiki>< nowiki /></nowiki></code>
< nowiki />
< nowiki />
< nowiki />
< nowiki />
Nowiki tags do not otherwise nest, so it is the second and fourth that displays:
1<nowiki>2<nowiki>3</nowiki>4</nowiki> <nowiki>{{!}}<nowiki></nowiki>{{!}}</nowiki>
12<nowiki>34</nowiki> second and fourth
{{!}}<nowiki>|</nowiki>
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 <pre>...</pre>
.
Pre
[编辑]<pre>
is a parser tag that emulates the HTML <pre>
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.
<pre><!--Comment--> [[wiki]] markup &</pre> |
<!--Comment--> [[wiki]] markup & |
<pre>
formatted text does not wrap, thus text may extend past the browser window:
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.
To resolve this, <pre>
may use CSS styling to add wrapping or a horizontal scrollbar:
- Wrapping:
<pre 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:
<pre style="overflow:auto; width:auto;">
Alternatively, consider using {{pre2}} template or <syntaxhighlight lang="text">……</syntaxhighlight>
.
隱 藏 文字 (註解 )
[编辑]It's uncommon – but on occasion acceptable for notes to other editors – 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 Talk page. The format is to surround the hidden text with "<!--
" and "-->
" and may cover several lines, e.g.:
<!-- An example of hidden comments This won't be visible except in "edit" mode. -->
Another way to include a comment in the wiki markup uses the {{Void}} template, which can be abbreviated as {{^}}. This template "expands" to the empty string, generating no HTML output; it is visible only to people editing the wiki source. Thus {{^|A lengthy comment here}}
operates similarly to the comment <!-- A lengthy comment here -->
. The main difference is that the template version can be nested, while attempting to nest HTML comments produces odd results.
變數
[编辑]{{CURRENTWEEK}} | 29 | |
{{CURRENTDOW}} | 5 |
|
{{CURRENTMONTH}} | 07 | |
{{CURRENTMONTHNAME}} | 7 |
|
{{CURRENTMONTHNAMEGEN}} | 7 |
|
{{CURRENTDAY}} | 19 | |
{{CURRENTDAYNAME}} | ||
{{CURRENTYEAR}} | 2024 | |
{{CURRENTTIME}} | 07:45 | |
{{NUMBEROFARTICLES}} | 1,430,802 | |
{{NUMBEROFPAGES}} | 7,760,356 | |
{{NUMBEROFUSERS}} | 3,549,858 | |
{{PAGENAME}} | Wikitext | |
{{NAMESPACE}} | Help | |
{{REVISIONID}} | - | |
{{REVISIONUSER}} | Perxeonic Acid | |
{{localurl:pagename}} | /wiki/Pagename | |
{{localurl:Wikipedia:Sandbox|action=edit}} | /w/index.php?title=Wikipedia:Sandbox&action=edit | |
{{fullurl:pagename}} | //zh.wikipedia.org/wiki/Pagename | |
{{fullurl:pagename|query_string}} | //zh.wikipedia.org/w/index.php?title=Pagename&query_string | |
{{SERVER}} | //zh.wikipedia.org | |
{{ns:1}} | Talk |
{{ns:index}},如:{{ns:1}} → |
{{SITENAME}} | Wikipedia |
{{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.
{{CURRENTMONTHNAMEGEN}} is the genitive (possessive) grammatical form of the month name, as used in some languages but not in English; {{CURRENTMONTHNAME}} is the nominative (subject) form, as usually seen in English.
In languages where it makes a difference, you can use constructs like {{grammar:case|word}}
to convert a word from the nominative case to some other case. For example, {{grammar:genitive|{{CURRENTMONTHNAME}}}}
means the same as {{CURRENTMONTHNAMEGEN}}
.
HTML
[编辑]參 見
[编辑]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 visual file markup.
- Help:A quick guide to templates: an introduction to templates.
- Help:Substitution: substitution is an alternative way of including templates than transclusion
- Help:Score: how to render musical scores.
- Help:Displaying a formula: displaying mathematical formulae.
|
(
| |
编辑
| |