Difference between revisions of "NetHackWiki:Templates"

From NetHackWiki
Jump to navigation Jump to search
m (Wikihack:Templates moved to Fikihack:Templates)
(Hacks: Template:! no longer exists, delete section)
 
(28 intermediate revisions by 11 users not shown)
Line 1: Line 1:
 
{{community}}
 
{{community}}
 +
The intention of this page is to document each template at this wiki. This page only describes what each template does; for tips on styling an article, try [[NetHackWiki:Style guide|Style guide]].
  
The intention of this page is to document every template at this wiki. The template at the top of this page is [[Template:Community]].
+
The box at the top-right of this page is [[Template:Community]].
  
== Wiki administration ==
+
==Pages needing attention==
{|style="width: 90%;" border="1"
+
 
|'''What appears'''
+
===Todo===
|'''What you type'''
+
{| class="wikitable"
 +
! What appears
 +
! What you type
 
|-
 
|-
|{{delete|insert reason}}
+
| {{todo|This page needs X doing.}}
|<nowiki>{{delete|insert reason}}</nowiki>
+
| <nowiki>{{todo|This page needs X doing.}}</nowiki>
 +
|}
 +
 
 +
The {{tl|todo}} template marks a page with a message about what needs to be done. It also adds the page to [[:Category:Todo]].
 +
 
 +
=== Deletion ===
 +
{| class="wikitable"
 +
! What appears
 +
! What you type
 
|-
 
|-
|{{stub}}
+
| {{delete|insert reason}}
|<nowiki>{{stub}}</nowiki>
+
| <nowiki>{{delete|insert reason}}</nowiki>
 
|}
 
|}
  
For more information about these templates, read the categories:
+
The {{tl|delete}} template adds a page to [[:Category:Candidates for deletion]] so that [[NetHackWiki:administrators|administrators]] can consider deleting it.
* [[:Category:Candidates for deletion]]
 
* [[:Category:Stubs]]
 
  
== [[Template:Monster]] ==
+
=== Merging ===
[[Template:Monster]] is an experiment in progress; see [[soldier ant]] for a call of this template.
+
{| class="wikitable"
 
+
! What appears
== Linking ==
+
! What you type
=== Linking to templates ===
 
{|style="width: 90%;" border="1"
 
|'''What appears'''
 
|'''What you type'''
 
 
|-
 
|-
|Use the {{tl|monster}} template.
+
| {{merge|insert reason}}
|<nowiki>Use the {{tl|monster}} template</nowiki>.
+
| <nowiki>{{merge|insert reason}}</nowiki>
 
|}
 
|}
  
Origin:
+
The {{tl|merge}} template adds a notice that the page should be merged with another, or several others. It also adds the page to [[:Category:Pages to be merged]].
* [[Wikibooks:Template:tl]] -> {{tl|tl}}
+
 
 +
If you see a merge notice, try merging the pages!
  
=== Generic project link ===
+
=== Stubs ===
{|style="width: 90%;" border="1"
+
{| class="wikitable"
|'''What appears'''
+
! What appears
|'''What you type'''
+
! What you type
 +
|-
 +
| {{stub}}
 +
| <nowiki>{{stub}}</nowiki>
 
|-
 
|-
|{{generic project link| project=Gameinfo| image=fair-use-gameinfo-logo.png| text=[[Gameinfo:Main Page|Gameinfo]] has a category for:| link=[[Gameinfo:Category:Battle for Wesnoth|Category:Battle for Wesnoth]]}}
+
| {{stub|Is this artifact better than [[Frost Brand]]?}}
|<nowiki>{{generic project link| project=Gameinfo| image=fair-use-gameinfo-logo.png| text=[[Gameinfo:Main Page|Gameinfo]] has a category for:| link=[[Gameinfo:Category:Battle for Wesnoth|]]}}</nowiki>
+
| <nowiki>{{stub|Is this artifact better than [[Frost Brand]]?}}</nowiki>
 
|}
 
|}
  
{{generic project link| project=Gameinfo| image=fair-use-gameinfo-logo.png| text=[[Gameinfo:Main Page|Gameinfo]] has a category for:| link=[[Gameinfo:Category:Battle for Wesnoth|Category:Battle for Wesnoth]]}}
+
The {{tl|stub}} template appeals for someone to click the "edit" link and add more information to an article. It also lists the article in [[:Category:Stubs]].
This template provides a box which floats to the right, as shown here. It can substitute for the specific project link when the specific template is unavailable. In this example, we use the template to reach a category at Gameinfo.
 
  
Origin:
+
== Color templates ==
* [[Gameinfo:Template:wikipedia]] -> {{tl|wikipedia}} -> {{tl|generic project link}}
+
The function templates of [[:Category:Function templates]] allow you to show monsters or objects in any of the 16 [[color]]s that NetHack uses. Witness, for example:
  
=== Specific project link ===
+
{| class="wikitable"
{|style="width: 90%;" border="1"
+
!Object represented!!What you type!!Result
|'''What appears'''
 
|'''What you type'''
 
 
|-
 
|-
|{{wikipedia}}
+
|| [[newt]]|| <nowiki>{{yellow|:}}</nowiki> (or <nowiki>{{monsym|newt}}</nowiki>)|| {{yellow|:}}
|<nowiki>{{wikipedia}}</nowiki>
 
 
|-
 
|-
|{{wikipedia2|Mythology and fiction in NetHack}}
+
|| [[lichen]] || <nowiki>{{brightgreen|F}}</nowiki> (or <nowiki>{{monsym|lichen}}</nowiki>)|| {{brightgreen|F}}
|<nowiki>{{wikipedia2|Mythology and fiction in NetHack}}</nowiki>
 
 
|-
 
|-
|{{wikibooks}}
+
|| lit and unlit [[corridor]]|| <nowiki>{{white|#}}{{white|#}}{{lightgray|#}}{{lightgray|#}}</nowiki>|| {{white|#}}{{white|#}}{{lightgray|#}}{{lightgray|#}}
|<nowiki>{{wikibooks}}</nowiki>
 
 
|-
 
|-
|{{wikibooks2|NetHack/Building}}
+
|| pool of [[lava]]|| <nowiki>{{red|&amp;#125;}}</nowiki>|| {{red|&#125;}}
|<nowiki>{{wikibooks2|NetHack/Building}}</nowiki>
 
 
|-
 
|-
|{{gameinfo}}
+
|| [[grave]]|| <nowiki>{{lightgray|&amp;#124;}}</nowiki>|| {{lightgray|&#124;}}
|<nowiki>{{gameinfo}}</nowiki>
+
|}
 +
 
 +
To display monster symbols you should use [[Template:Monsym]] instead, unless the monster symbol you want to display is dependant on the NetHack version and shouldn't change even if it changes in future NetHack versions.
 +
 
 +
See '''[[:Category:Function templates]]''' for details.
 +
 
 +
== Infoboxes ==
 +
We have templates for information boxes to be put on each [[item]] and [[monster]] page; see '''[[NetHackWiki:Style guide#Item pages]]''' and '''[[Template:Monster]]''' respectively.
 +
 
 +
We now also have a '''[[Template:Patch]]''' for pages about a [[patch]].
 +
 
 +
== Template link ==
 +
{| class="wikitable"
 +
! '''What appears'''
 +
! '''What you type'''
 
|-
 
|-
|{{gameinfo2|NetHack}}
+
| Use {{tl|stub}} to mark stubs.
|<nowiki>{{gameinfo2|NetHack}}</nowiki>
+
| <nowiki>Use {{tl|stub}} to mark stubs.</nowiki>
 +
|}
 +
 
 +
Origin:
 +
* [[Wikibooks:Template:tl]] -> {{tl|tl}}
 +
 
 +
== Links ==
 +
{{main|Category:Link templates}}
 +
 
 +
The [[:Category:Link templates]] contains boxes that float to the right and show links to other websites, mostly wiki projects. This is most frequently used to link to Wikipedia:
 +
 
 +
{| class="wikitable"
 +
! '''What appears'''
 +
! '''What you type'''
 
|-
 
|-
|{{novelas}}
+
| {{wikipedia|Samurai}}
|<nowiki>{{novelas}}</nowiki>
+
| <nowiki>{{wikipedia|Samurai}}</nowiki>
 +
|}
 +
 
 +
We also have one that links to [[Unix]] manual pages:
 +
 
 +
{| class="wikitable"
 +
! '''What appears'''
 +
! '''What you type'''
 
|-
 
|-
|{{novelas2|NetHack/Nutter}}
+
| {{man|make}}
|<nowiki>{{novelas2|NetHack/Nutter}}</nowiki>
+
| <nowiki>{{man|make}}</nowiki>
 
|}
 
|}
  
{{wikibooks2|NetHack}}
+
== Source code references ==
As shown here, these boxes float to the right.
+
[[Template:Refsrc]] references individual lines in the source code. In a similar way, [[Template:Reffunc]] references a named entity (most often a function, hence the name) in the source code.
  
Here are links to each template:
+
[[Template:Sourcecode]] and [[Template:Function]] work almost the same way, but they don't wrap the link in <nowiki><ref></nowiki> tags so they can be used to simply link to the source.
* {{tl|wikipedia}}, {{tl|wikibooks}}, {{tl|gameinfo}}, {{tl|novelas}}
 
* {{tl|wikipedia2}}, {{tl|wikibooks2}}, {{tl|gameinfo2}}, {{tl|novelas2}}
 
  
The templates currently use {{tl|generic project link}} to implement themselves.
+
== Links to SLASH'EM source ==
 +
'''[[Template:Semsrc]]''' helps one generate links into [[SLASH'EM]]'s CVS repository, especially to the HEAD. Note that this is no longer necessary for [[SLASH'EM 0.0.7E7F2]] because we can now use local links, for example using [[Template:Sourcecode]] and [[Template:Refsrc]] which both support a version parameter.
  
 
== Licensing ==
 
== Licensing ==
{|style="width: 90%;" border="1"
+
{| style="border: 1px #aaa solid; border-collapse: collapse;"
|'''What appears'''
+
! What appears
|'''What you type'''
+
<hr style="margin: 0.5em 25%;" />
 +
What you type
 +
|-
 +
| style="border: 1px #aaa solid; padding: 0.5em 0;" |
 +
{{DOD}}
 +
<hr style="margin: 0.5em 25%;" />
 +
{{tl|DOD}} on articles based on Hugo/O'Donnell spoilers
 +
|-
 +
| style="border: 1px #aaa solid; padding: 0.5em 0;" |
 +
{{JAH}}
 +
<hr style="margin: 0.5em 25%;" />
 +
{{tl|JAH}} on articles based on the [[Vernon Spoilers]]
 +
|-
 +
| style="border: 1px #aaa solid; padding: 0.5em 0;" |
 +
{{basedon|name=Author|url=http://www.website.org}}
 +
<hr style="margin: 0.5em 25%;" />
 +
<nowiki>{{</nowiki>[[Template:Basedon|basedon]]<nowiki>|name=Author|url=http://www.website.org}}</nowiki> on articles based on other, copyrightless, spoilers.
 +
|-
 +
| style="border: 1px #aaa solid; padding: 0.5em 0;" |
 +
{{rodney}}
 +
<hr style="margin: 0.5em 25%;" />
 +
{{tl|rodney}} on articles based on entries from [[Rodney (bot)]]
 +
|-
 +
| style="border: 1px #aaa solid; padding: 0.5em 0;" |
 +
{{CWI}}
 +
<hr style="margin: 0.5em 25%;" />
 +
{{tl|CWI}} on source code from early version of NetHack
 
|-
 
|-
|{{rodney}}
+
| style="border: 1px #aaa solid; padding: 0.5em 0;" |
|<nowiki>{{rodney}}</nowiki> at articles
+
{{NGPL}}
 +
<hr style="margin: 0.5em 25%;" />
 +
{{tl|NGPL}} on NGPL-licensed source code from NetHack
 
|-
 
|-
|{{NGPL}}
+
| style="border: 1px #aaa solid; padding: 0.5em 0;" |
|<nowiki>{{NGPL}}</nowiki> at articles and images
+
{{GFDL}}
 +
<hr style="margin: 0.5em 25%;" />
 +
{{tl|GFDL}} on images
 
|-
 
|-
|{{fairuse}}
+
| style="border: 1px #aaa solid; padding: 0.5em 0;" |
|<nowiki>{{fairuse}}</nowiki> at images
+
{{fairuse}}
 +
<hr style="margin: 0.5em 25%;" />
 +
{{tl|fairuse}} on images
 
|}
 
|}
  
 
Origin:
 
Origin:
 
* [[Wikibooks:Template:fairuse]] -> {{tl|fairuse}}
 
* [[Wikibooks:Template:fairuse]] -> {{tl|fairuse}}
* {{tl|fairuse}} -> {{tl|rodney}}
+
* {{tl|fairuse}} -> other templates
* {{tl|fairuse}} -> {{tl|NGPL}}
+
 
 +
These tags indicate some copyright external to [[Project:Copyrights|the copyright of this wiki]].
 +
 
 +
Some images can use {{tl|fairuse}}, but this should always be avoided except when needed, for example for the Wikipedia logo. In most cases, fair use such as simply quoting from the game ("The newt bites! You die...") or giving game statistics (like when using {{tl|monster}}) does not require a template.
 +
 
 +
==Disambiguation==
 +
 
 +
Put {{tl|disambig}} at the bottom of disambiguation pages.
 +
 
 +
{{tl|otheruses}}, {{tl|for}}, {{tl|for2}} or {{tl|distinguish}} can be put at the top of pages whose title has another major meaning, but try to limit this to pages where a real potential for confusion exists.
 +
 
 +
==Main article==
 +
 
 +
{{tl|main}} may be used to ensure consistent style when indicating a main article from within a section. The [[#Links|Links]] section above uses this template thus:
 +
 
 +
<nowiki>{{main|Category:Link templates}}</nowiki>
 +
 
 +
==Unsigned comments==
 +
 
 +
Put {{tl|unsigned}} after unsigned comments.
 +
 
 +
==News==
 +
 
 +
Edit {{tl|news}} to add news items to the front page.
 +
 
 +
==Welcome==
 +
 
 +
Substitute the {{tl|welcome}} template on the talk pages of anonymous users:
 +
 
 +
<nowiki>{{subst:welcome}} --~~~~</nowiki>
 +
 
 +
==Featured article==
 +
 
 +
On the first of every month, put a new [[NetHackWiki:featured articles|featured article]] in {{tl|currentfeature}}.
  
These tags indicate some copyright external to [[Project:Copyrights|the copyright of this wiki]]. There are two reasons to do this:
+
==Others==
* It is proposed that all images have tags showing their copyright status. This is similar to what [[Commons:Main Page|Wikimedia Commons]] does.
 
* Articles derived from Rodney use the {{tl|rodney}} tag, while articles annotating NetHack source code use the {{tl|NGPL}} tag (for the source code, not the annotations).
 
  
Some images can use {{tl|fairuse}}, but this should always be avoided except when needed, for example for the Wikipedia logo. In most cases, fair use such as simply making a quote ("The newt bites! You die...") or giving game statistics (like when using {{tl|monster}}) does not require a template.
+
There are other templates, such as {{tl|NetHack Versions}}, but they are already on every page they should ever be on.
  
 
== See also ==
 
== See also ==
*[http://nethack.wikicities.com/index.php?title=Special%3AAllpages&from=&namespace=10 list of all templates].
+
*[http://nethackwiki.com/mediawiki/index.php?title=Special:AllPages&from=&namespace=10 List of all templates].
 +
[[Category:NetHackWiki]]

Latest revision as of 00:58, 29 November 2014

The intention of this page is to document each template at this wiki. This page only describes what each template does; for tips on styling an article, try Style guide.

The box at the top-right of this page is Template:Community.

Pages needing attention

Todo

What appears What you type

A user has suggested improving this page or section as follows:

"This page needs X doing."

{{todo|This page needs X doing.}}

The {{todo}} template marks a page with a message about what needs to be done. It also adds the page to Category:Todo.

Deletion

What appears What you type

A user has suggested the deletion of this page. The reason given was:

"insert reason"

{{delete|insert reason}}

The {{delete}} template adds a page to Category:Candidates for deletion so that administrators can consider deleting it.

Merging

What appears What you type

A user has suggested this page be merged with "insert reason"

{{merge|insert reason}}

The {{merge}} template adds a notice that the page should be merged with another, or several others. It also adds the page to Category:Pages to be merged.

If you see a merge notice, try merging the pages!

Stubs

What appears What you type
This page is a stub. Should you wish to do so, you can contribute by expanding this page.
{{stub}}
This page is a stub. Should you wish to do so, you can contribute by expanding this page.

A user has suggested improving this page or section as follows:

"Is this artifact better than Frost Brand?"

{{stub|Is this artifact better than [[Frost Brand]]?}}

The {{stub}} template appeals for someone to click the "edit" link and add more information to an article. It also lists the article in Category:Stubs.

Color templates

The function templates of Category:Function templates allow you to show monsters or objects in any of the 16 colors that NetHack uses. Witness, for example:

Object represented What you type Result
newt {{yellow|:}} (or {{monsym|newt}}) :
lichen {{brightgreen|F}} (or {{monsym|lichen}}) F
lit and unlit corridor {{white|#}}{{white|#}}{{lightgray|#}}{{lightgray|#}} ####
pool of lava {{red|&#125;}} }
grave {{lightgray|&#124;}} |

To display monster symbols you should use Template:Monsym instead, unless the monster symbol you want to display is dependant on the NetHack version and shouldn't change even if it changes in future NetHack versions.

See Category:Function templates for details.

Infoboxes

We have templates for information boxes to be put on each item and monster page; see NetHackWiki:Style guide#Item pages and Template:Monster respectively.

We now also have a Template:Patch for pages about a patch.

Template link

What appears What you type
Use {{stub}} to mark stubs. Use {{tl|stub}} to mark stubs.

Origin:

Links

The Category:Link templates contains boxes that float to the right and show links to other websites, mostly wiki projects. This is most frequently used to link to Wikipedia:

What appears What you type
{{wikipedia|Samurai}}

We also have one that links to Unix manual pages:

What appears What you type
{{man|make}}

Source code references

Template:Refsrc references individual lines in the source code. In a similar way, Template:Reffunc references a named entity (most often a function, hence the name) in the source code.

Template:Sourcecode and Template:Function work almost the same way, but they don't wrap the link in <ref> tags so they can be used to simply link to the source.

Links to SLASH'EM source

Template:Semsrc helps one generate links into SLASH'EM's CVS repository, especially to the HEAD. Note that this is no longer necessary for SLASH'EM 0.0.7E7F2 because we can now use local links, for example using Template:Sourcecode and Template:Refsrc which both support a version parameter.

Licensing

What appears

What you type

This page is based on a spoiler by Dylan O'Donnell. The original license is:

Redistribution, copying, and editing of these spoilers, with or without modification, are permitted provided that the following conditions are met:

  1. The original contributors to any spoiler must continue to be credited.
  2. Any modifications to the spoiler must be acknowledged and credited.

{{DOD}} on articles based on Hugo/O'Donnell spoilers

This page is based on a spoiler by J. Ali Harlow.


{{JAH}} on articles based on the Vernon Spoilers

This page is based on a spoiler by Author, available at http://www.website.org


{{basedon|name=Author|url=http://www.website.org}} on articles based on other, copyrightless, spoilers.

Some or all of the information on this page was taken from https://alt.org/nethack/rodney-learn.php with the permission of the contributor. A list of people who gave such permission is at Contributors to Rodney donating to the Wiki.


{{rodney}} on articles based on entries from Rodney (bot)

Screenshots and source code from Hack are used under the CWI license.


{{CWI}} on source code from early version of NetHack

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.


{{NGPL}} on NGPL-licensed source code from NetHack


GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "Text of the GNU Free Documentation License."

{{GFDL}} on images

This work is copyrighted. The individual who uploaded this work and first used it in an article, as well as subsequent persons who place it into articles, asserts that this qualifies as fair use of the material under United States copyright law.


{{fairuse}} on images

Origin:

These tags indicate some copyright external to the copyright of this wiki.

Some images can use {{fairuse}}, but this should always be avoided except when needed, for example for the Wikipedia logo. In most cases, fair use such as simply quoting from the game ("The newt bites! You die...") or giving game statistics (like when using {{monster}}) does not require a template.

Disambiguation

Put {{disambig}} at the bottom of disambiguation pages.

{{otheruses}}, {{for}}, {{for2}} or {{distinguish}} can be put at the top of pages whose title has another major meaning, but try to limit this to pages where a real potential for confusion exists.

Main article

{{main}} may be used to ensure consistent style when indicating a main article from within a section. The Links section above uses this template thus:

{{main|Category:Link templates}}

Unsigned comments

Put {{unsigned}} after unsigned comments.

News

Edit {{news}} to add news items to the front page.

Welcome

Substitute the {{welcome}} template on the talk pages of anonymous users:

{{subst:welcome}} --~~~~

Featured article

On the first of every month, put a new featured article in {{currentfeature}}.

Others

There are other templates, such as {{NetHack Versions}}, but they are already on every page they should ever be on.

See also