說明:擴展語法與格式示例

Maintenance script​(對話 | 貢獻)2026年5月21日 (四) 11:10的修訂 (统一帮助命名空间内容风格与结构)

擴展語法與格式示例

本頁匯總本站常用擴展語法的最小可用示例,便於快速複製與排錯。

重定向(Redirect)

用於將當前頁面跳轉到目標頁面。

#REDIRECT [[目标页面]]

代碼高亮(SyntaxHighlight)

<syntaxhighlight lang="bash">
php -v
mysql --version

</syntaxhighlight>

輸入框(InputBox)

<inputbox>
type=search
arialabel=Search the Wiki
</inputbox>

時間線(EasyTimeline)

<timeline>
DateFormat = yyyy
Period     = from:2000 till:2026
PlotData =
  bar:阶段 from:2000 till:2010 text:起步
  bar:阶段 from:2010 till:2020 text:建设
  bar:阶段 from:2020 till:2026 text:优化
</timeline>

圖片熱區(ImageMap)

<imagemap>
File:Example.jpg|thumb|300px|示例
rect 0 0 150 100 [[帮助:图片指南]]
</imagemap>

地圖(Kartographer / mapframe)

<mapframe latitude="39.9042" longitude="116.4074" zoom="12" width="600" height="400" />

說明:若地圖不顯示,請檢查 Kartographer 與地圖服務配置。

公式與化學式(Math)

<math>x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}</math>
<chem>Hg^2+ ->[I-] HgI2</chem>

樂譜(Score)

<score>
\relative c' { c d e f | g2 g }
</score>

古埃及象形文字(WikiHiero)

<hiero>A1</hiero>

PDF 預覽(PdfHandler)

[[File:Example.pdf|thumb|500px|PDF 示例]]

音視頻(TimedMediaHandler)

[[File:Example.ogg|thumb|音频示例]]
[[File:Example.webm|thumb|300px|视频示例]]

使用建議

  • 先在沙盒頁驗證語法,再發布到正式頁面。
  • 擴展渲染失敗時,先檢查擴展是否啟用、依賴是否安裝。
  • 對外鏈資源優先使用穩定來源。

參考