Miraheze模板Wiki

From Miraheze Developers Wiki
This page is a translated version of the page Miraheze Developers Wiki and the translation is 31% complete.
Outdated translations are marked like this.


欢迎来到Miraheze模板Wiki!

这是供任何人使用和获取的模板资源库,以用于Miraheze的Wiki。

对于你需要但是这个wiki没有的模板,在Phabricator创建一个任务以列举你需要的模板。

How far into the template rabbit hole do you go?

关于模板

所以什么是模板?

模板是指被嵌入包含(transcluded)在其他页面的页面。这是用在多处的有用文本,编辑模板即可影响所有它出现的实例。

所有模板都在“模板名字空间”中。

For example, create a page called Template:Main with the text

''The main article for this is [[{{{1}}}]]''.

and then inserting the template {{Main|Random page}} where you want the text to appear gives:

The main article for this is Random page.

关于这个Wiki

这个wiki的目的是成为Miraheze模板的中心资源库。

Templates are a headache to disentangle, understand, install and maintain. Miraheze already makes life considerably easier for wiki admins, allowing them to focus on adding content instead of diverting time and energy to keeping up with the upgrade-debug race.

For full functionality MediaWiki ought to ship with templates bundled in but there is no sign of this happening any time soon. Miraheze wiki admins either write their own templates or export them from elsewhere e.g. Wikipedia.org. This is a wasteful dispersion of effort in place of collaboration.

Use the community portal for any meta discussions (about the wiki) or anything relevant to its intended purpose.

如何使用这个wiki

Using templates from this wiki won't prevent you from having unique templates on your wiki. The advantage of using templates from this wiki is that multiple people will have already put in the effort to make highly complex templates suitable for general use.

Writing your own templates.

Icons

Miraheze wikis are Instant Commons enabled, otherwise the images for icons would have to be uploaded locally. A good source for these is Wikimedia Commons' Category:Icons by subject.

模板测试

要预览一个模板,可以做以下事情。

  1. 复制共同前缀下测试的模板。比如,你可以复制Template:FooUser:Example/sandbox/Template:Foo。或者,你也可以创建一个User:Example/sandbox/Template:Foo以重定向到Template:Foo/sandbox
  2. 去往Special:TemplateSandbox。填写要渲染的页面或修订版本,以及你在第1步输入的前缀。你可以通过管道符(竖直线)来间隔多个前缀,比如User:Example/sandbox1|User:Example/sandbox2
  3. 点击查看

编辑栏的底部也有一个文本框,可以允许用户预览该模板生效后的其他页面。

可用的模板

外部链接