打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

帮助:扩展语法与格式示例:修订间差异

来自陋室
删除的内容 添加的内容
XP-jia留言 | 贡献
添加内容
Maintenance script留言 | 贡献
帮助命名空间规范化:移除一级标题并修正渲染安全写法
 
(未显示4个用户的27个中间版本)
第1行: 第1行:
本页汇总本站常用扩展语法的最小可用示例,便于快速复制与排错。
== 乐谱 ==
=== 义勇军进行曲 ===
<score vorbis="1">


== 重定向(Redirect) ==
\relative g' {
用于将当前页面跳转到目标页面。
<syntaxhighlight lang="wikitext">
#REDIRECT [[目标页面]]
</syntaxhighlight>


== 代码高亮(SyntaxHighlight) ==
\key g \major \time 2/4
<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="bash">
php -v
mysql --version
</syntaxhighlight>
</syntaxhighlight>


== 输入框(InputBox) ==
g8. b16 d8 d8 \bar "|" e4 d4 \bar "|" b8. g16 \times 2/3 {d'8 d d} \bar "|" b4 g4 \bar "|" \times 2/3 {d8 d d} \times 2/3 {d8 d d} \bar "|" g4 r8 d8 \bar "|" \break
<syntaxhighlight lang="wikitext">
<inputbox>
type=search
arialabel=Search the Wiki
</inputbox>
</syntaxhighlight>


== 时间线(EasyTimeline) ==
g4. g8 \bar "|" g8. g16 d8 e16 fis16 \bar "|" g4 g4 \bar "|" r8 b8 g8 a16 b16 \bar "|" d4 d4 \bar "|" \break
<syntaxhighlight lang="wikitext">
<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>
</syntaxhighlight>


== 图片热区(ImageMap) ==
b8. b16 g8. b16 \bar "|" d8. b16 a4 \bar "|" a2 \bar "|" e'4^> d4^> \bar "|" a4^> b4^> \bar "|" \break
<syntaxhighlight lang="wikitext">
<imagemap>
File:Example.jpg|thumb|300px|示例
rect 0 0 150 100 [[帮助:图片指南]]
</imagemap>
</syntaxhighlight>


== 地图(Kartographer / mapframe) ==
d8^> b8^> r8 d8 \bar "|" b8 a16 b16 g4 \bar "|" b4 r4 \bar "|" d,8. e16 g8 g8 \bar "|" b8. b16 d8 d8 \bar "|" \break
<syntaxhighlight lang="wikitext">
<mapframe latitude="39.9042" longitude="116.4074" zoom="12" width="600" height="400" />
</syntaxhighlight>
说明:若地图不显示,请检查 Kartographer 与地图服务配置。


== 公式与化学式(Math) ==
a8 a16 a16 e4 \bar "|" a4. d,8 \bar "|" ^\< g4. g8 \bar "|" b4. b8 \! \bar "|" d2 \bar "|" \break
<syntaxhighlight lang="wikitext">

<math>x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}</math>
g,8. b16 d8 d8 \bar "|" e4 d4 \bar "|" b8. g16 \times 2/3 {d'8 d d} \bar "|" b8 r8 g8 r8 \bar "|" d4^> g4^> \bar "|" \break
<chem>Hg^2+ ->[I-] HgI2</chem>

</syntaxhighlight>
b8. g16 \times 2/3 {d'8 d d} \bar "|" b8 r8 g8 r8 \bar "|" d4^> g4^> \bar "|" d4^> g4^> \bar "|" d4^> g4^> \bar "|" g4^> r4 \bar "|."

}

\addlyrics {

                                        起

来! 不 愿 做 奴 隶 的 人 们! 把 我 们 的 血 肉,

筑 成 我 们 新 的 长 城! 中 华 民 族

到 了 最 危 险 的 时 候, 每 个 人 被 迫 着 发 出

最 后 的 吼 声。 起 来! 起 来! 起 来!

我 们 万 众 一 心, 冒 着 敌 人 的 炮 火 前 进!

冒 着 敌 人 的 炮 火 前 进! 前 进! 前 进! 进!

}


== 乐谱(Score) ==
<syntaxhighlight lang="wikitext">
<score>
\relative c' { c d e f | g2 g }
</score>
</score>
</syntaxhighlight>


== 古埃及象形文字(WikiHiero) ==
=== 参见 ===
<syntaxhighlight lang="wikitext">
* [https://www.mediawiki.org/wiki/Extension:Score Extension:Score]
<hiero>A1</hiero>
* [https://lilypond.org/doc/v2.24/Documentation/web/manuals LilyPond 2.24.4 手册]
</syntaxhighlight>
* [https://zh.wikipedia.org/wiki/义勇军进行曲 义勇军进行曲 - 维基百科,自由的百科全书]


== PDF 预览(PdfHandler) ==
== 时间线 ==
<syntaxhighlight lang="wikitext">
=== 苏联领导人 ===
[[File:Example.pdf|thumb|500px|PDF 示例]]
<timeline>
</syntaxhighlight>
# All measures are in pixels


== 音视频(TimedMediaHandler) ==
ImageSize = width:160 height:550
<syntaxhighlight lang="wikitext">
PlotArea = left:50 right:0 bottom:10 top:10
[[File:Example.ogg|thumb|音频示例]]
AlignBars = justify
[[File:Example.webm|thumb|300px|视频示例]]
</syntaxhighlight>


== 使用建议 ==
DateFormat = yyyy
* 先在沙盒页验证语法,再发布到正式页面。
Period = from:1917 till:1991
* 扩展渲染失败时,先检查扩展是否启用、依赖是否安装。
TimeAxis = orientation:vertical
* 对外链资源优先使用稳定来源。
ScaleMajor = unit:year increment:5 start:1920


== 参考 ==
# there is no automatic collision detection,
* https://www.mediawiki.org/wiki/Category:Extensions
# so shift texts up or down manually to avoid overlap
* https://www.mediawiki.org/wiki/Help:Formatting

Define $dx = 25 # shift text to right side of bar

PlotData=
bar:Leaders color:red width:25 mark:(line,white) align:left fontsize:S

from:start till:1924 shift:($dx,15) text:Vladimir~Ilyich~[[Special:MyLanguage/Lenin|Lenin]]
from:1924 till:1953 shift:($dx,5) text:[[Special:MyLanguage/Stalin|Josef~Stalin]]
from:1953 till:1964 shift:($dx,5) text:Nikita~[[Special:MyLanguage/Khrushchev|Khrushchev]]
from:1964 till:1982 shift:($dx,5) text:Leonid~[[Special:MyLanguage/Brezhnev|Brezhnev]]
from:1982 till:1984 shift:($dx,-12) text:Yuri~[[Special:MyLanguage/Andropov|Andropov]]
from:1984 till:1985 shift:($dx,4) text:Konstantin~[[Special:MyLanguage/Chernenko|Chernenko]] fontsize:XS
from:1985 till:end shift:($dx,10) text:Mikhail~[[Special:MyLanguage/Gorbachev|Gorbachev]]
</timeline>


{{Template:站点帮助文档}}
=== 参见 ===
[[Category:帮助文档]]
* https://www.mediawiki.org/wiki/Extension:EasyTimeline

2026年5月21日 (四) 11:18的最新版本

本页汇总本站常用扩展语法的最小可用示例,便于快速复制与排错。

重定向(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|视频示例]]

使用建议

  • 先在沙盒页验证语法,再发布到正式页面。
  • 扩展渲染失败时,先检查扩展是否启用、依赖是否安装。
  • 对外链资源优先使用稳定来源。

参考