2023年政策修订增补工作正在进行中,欢迎参与!
  • Moegirl.ICU:萌娘百科流亡社群 581077156(QQ),欢迎对萌娘百科运营感到失望的编辑者加入
  • Moegirl.ICU:账号认领正在试运行,有意者请参照账号认领流程

Help:使用插件

萌娘百科,万物皆可萌的百科全书!转载请标注来源页面的网页链接,并声明引自萌娘百科。内容不可商用。
跳转到导航 跳转到搜索
Commons-emblem-notice.svg
这个页面“Help:使用插件”是萌娘百科的帮助文档
  • 本文用于介绍萌娘百科中一些特定功能的操作方法;
  • 本文仅是一篇论述,不属于方针或指引。如果本指南与相关方针或指引发生冲突或存在不一致的情况,请以方针或指引的条文为准。

插件(extensions)是对萌娘百科所使用的MediaWiki系统所进行的功能扩充的方式。不同的插件对功能有不同的扩充,使用方法也有所不同。

下面列出一些常用插件的使用方法。但本页内容可能随更新有所变化。


Poem

Poem插件增加了<poem></poem>标签,该标签允许其中包裹的内容可以实现“一次编辑换行=一次实际换行”。这为歌词等内容提供了方便。

例如,当写下:

<poem>
大家好
大家好
大家好
大家好
</poem>

时,则会显示为:

大家好
大家好
大家好
大家好

如果不使用该标签,则会变为: 大家好 大家好 大家好 大家好

InputBox

InputBox插件提供了标签<inputbox></inputbox>。利用该标签,您可以在任一页面创建一个输入框。该功能主要用于修改、新建、搜索页面。

示例

创建一篇新文章的输入框。

Wiki代码

<inputbox>
type=create
break=no
</inputbox>

输出结果


完整参数

输入框像这样构造:

<inputbox>
type=
bgcolor=
width=
page=
default=
preload=
editintro=
buttonlabel=
hidden=
searchbuttonlabel=
fulltextbutton=
labeltext=
break=
namespaces=
prefix=
placeholder=
minor=
nosummary=
summary=
id=
inline=
dir=
preloadparams[]=
searchfilter=
useve=
arialabel=
</inputbox>

type参数必须输入。 而其他所有参数均为可选。 preloadparams[]可以出现不止一次。

输入框类型

默认情况下提交按钮位于输入框的下面。

通过设置换行参数可将“提交”按钮移至右侧:break=no

将“提交”按钮移至右侧对于使用搜索框时搜索建议覆盖了下方搜索按钮的情况很有用。

类型 例子 描述
type=search
创建的搜索框的默认宽度为50字符。 输入的内容为要搜索的关键字。
type=create

创建新页面。 输入的内容为要编辑的页面名称。
type=comment

在输入框指定的页面下增加一个新段落。
type=commenttitle

以输入框中输入的标题增加一个新段落。 标题可以用default=参数指定。页面必须用page=参数指定。
type=fulltext
仅显示全文搜索按钮,不显示“前往”按钮。
type=move

将页面移动至另一个名字。

对于type=search2,默认的搜索按钮位置在右侧。 目前,似乎无法将其他参数添加到这种类型的输入框中。 这种搜索框将搜索其所在的整个维基。

类型 例子
type=search2
 

参数

参数 描述 适用范围 例子 结果
bgcolor= 设置表格背景色(HTML颜色值)。 不要使用引号。 所有类型
<inputbox>
type=search
bgcolor=#eeeeff
</inputbox>
width= 设置输入框的宽度,单位为字符。 所有类型
<inputbox>
type=create
width=24
</inputbox>

default= 输入框中的默认文本。 所有类型
<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>

preload= 当创建新页面时,此标题的页面将会被预先载入进空白编辑框。 create, comment, commenttitle
<inputbox>
type=create
preload=Template:页面格式/音乐
</inputbox>

在上面或下面的输入框示例中输入一个不存在的页面标题,并分别点击“创建页面”或“新段落”按钮来测试此功能。
editintro= 通过这一参数指定的页面将会作为编辑指引显示在编辑窗口上方
create, comment
<inputbox>
type=comment
editintro=Template:Info
</inputbox>

buttonlabel= 此参数将作为表单主按钮显示的文字。 所有类型
<inputbox>
type=comment
buttonlabel=添加新的传言
</inputbox>

hidden= 此参数指定不显示输入框。

这需要与参数“default”配合使用,但此参数现在不是默认值,而是作为页面标题的固定值。

create, comment
<inputbox>
type=comment
hidden=yes
default=Help_talk:使用插件
buttonlabel=在讨论页留言
</inputbox>

searchbuttonlabel= 此参数将作为表单“搜索全文”按钮显示的文字。 search, fulltext
<inputbox>
type=search
searchbuttonlabel=深入探索
</inputbox>
fulltextbutton= 在“search2”表单上显示全文搜索按钮。 search2
<inputbox>
type=search2
searchbuttonlabel=深入探索
fulltextbutton=true
</inputbox>
labeltext= 在左侧显示的文字。 search2
<inputbox>
type=search2
searchbuttonlabel=深入探索
labeltext=查找: 
</inputbox>
 
break= 是否在输入框和按钮之间插入换行。 默认为yes(使用换行)。 所有类型
<inputbox>
type=create
width=24
break=no
</inputbox>
namespaces= 在全文搜索中支持选择命名空间。

使用“Main**”以默认选中主命名空间。

search, fulltext
<inputbox>
type=search
namespaces=Main**,Help
</inputbox>
prefix=
  • 指定搜索以特定前缀开头的页面来缩小范围。 注意这仅兼容特定的搜索后端,目前仅有扩展:CirrusSearch。 默认为空(搜索所有页面)。
  • 创建一个以特定前缀开头的页面。
  • 在type=move中,前缀将加在默认参数前。

注:下划线不等同于空格。

search, fulltext, create
<inputbox>
type=search
prefix={{FULLPAGENAME}}/Archive
</inputbox>

下面的按钮以Special:Mypage/作为前缀。


placeholder= 设置当输入框为空时的占位文字。 所有类型
<inputbox>
type=search
placeholder=搜索此维基
</inputbox>
page= 要发表评论或要移动的页面。 comment, move
<inputbox>
type=comment
page=Project:Sandbox
</inputbox>

summary= 编辑摘要或移动理由。 create, move
<inputbox>
type=create
default=Special:Mypage/inputbox test
summary=Foo
</inputbox>

id= <form>的id属性。 所有类型
<inputbox>
type=comment
page=Project:Sandbox
summary=Foo
id=bar
</inputbox>

inline= 将输入框作为inline元素(在开头不换行)。 search2
在此输入: <inputbox>
type=search2
inline=true
width=10
</inputbox>
在此输入:
 
dir= 书写方向从右到左(rtl)或从左到右(ltr)。 默认与页面语言的方向相同。 所有类型
<inputbox>
dir=rtl
type=comment
page=Project:Sandbox
summary=Foo
</inputbox>

preloadparams[]= 设置预载文本的参数。 create, comment, commenttitle
<inputbox>
type=create
preload=Log
preloadparams[]=param1
preloadparams[]=param2
</inputbox>

searchfilter= 指定在搜索中追加的参数。 search
<inputbox>
type=search
searchfilter=insource:foo
</inputbox>

对于已存在的页面使用create只会跳转到编辑界面。 在这种情况下preload被忽略。 对新页面使用comment是有效的。