Path of Exile Wiki:Manual of Style: Difference between revisions

From Path of Exile Wiki
Jump to navigation Jump to search
>OmegaK2
(templates, modules added)
>OmegaK2
(→‎Semantic Mediawiki: added some of the recent changes discussed)
Line 6: Line 6:


===Properties===
===Properties===
<section begin="smw property" />'''Choose a meaningful name for a property but keep it short.'''
<section begin="smw property" />
Properties should follow these rules in order to have a consistent naming scheme throughout the wiki.
 
====Names should be short, meaningful and avoid ambiguity====


This should be the case so what the property means can be identified by reading the name on sight. It should also avoid clashes with other properties.
This should be the case so what the property means can be identified by reading the name on sight. It should also avoid clashes with other properties.
Line 17: Line 20:




'''Use a verb for the property for the property'''
====Names should start with a verb====


This should be done to avoid confusion about what the property actually does.  
This should be done to avoid confusion about what the property actually does.  
Line 43: Line 46:
'''Use "Has ... " for setting additional information about the page.'''
'''Use "Has ... " for setting additional information about the page.'''


See example above.<section end="smw property" />
====Properties for multiple values should be plural; singular otherwise====
 
The intention is to help people to tell what to expect when they are perform an ask query on a page. So properties that are intended to have multiple values (and commonly do so), should be in plural while others that have a single value associated with them should be in singular.
 
This rule is not strict. The use of plural naming should be considered for case there can be multiple values.
 
Good:
<pre>On a skill page
[[Has gem tags::Fire]]
[[Has gem tags::Cold]]
[[Has gem tags::Spell]]</pre>
 
Bad:
<s><pre>On a skill page
[[Has gem tag::Fire]]
[[Has gem tag::Cold]]
[[Has gem tag::Spell]]</pre></s>
 
====Absence should be indicated by a "no"====
 
Since it is not possible to query for the absence of properties, sometimes properties for the absence of other properties have to be created. In these cases they should be indicated by a no in their name, like so:
<pre>[[Has no ...]]</pre>
 
Additionally they should have [[smw:Help:Type_Boolean|Has type::Boolean]] set.
 
For example:
 
[[Property:Has item class restrictions]] indicates a list of restrictions
 
[[Property:Has no item class restrictions]] indicates the absence of said list
 
<section end="smw property" />


===Result templates===
===Result templates===

Revision as of 00:11, 18 June 2016

This is draft, discuss it on the talk page

Semantic Mediawiki

Properties

Properties should follow these rules in order to have a consistent naming scheme throughout the wiki.

Names should be short, meaningful and avoid ambiguity

This should be the case so what the property means can be identified by reading the name on sight. It should also avoid clashes with other properties.

Good:

[[Is forsaken master::Vorici]]

Bad:

[[Is:Vorici]]


Names should start with a verb

This should be done to avoid confusion about what the property actually does.

Good:

On page "Cobalt Jewel"
[[Is base item::Cobalt Jewel]]

On page "Army of Bones"
[[Has base item::Cobalt Jewel]]

Bad:

On page "Cobalt Jewel"
[[base item::Cobalt Jewel]]

On page "Army of Bones"
[[base item::Cobalt Jewel]]


Use "Is ..." for setting a single piece of information that can be used to identify the page based on the property; in particular this should be set on every page of the same "type".

See example above.


Use "Has ... " for setting additional information about the page.

Properties for multiple values should be plural; singular otherwise

The intention is to help people to tell what to expect when they are perform an ask query on a page. So properties that are intended to have multiple values (and commonly do so), should be in plural while others that have a single value associated with them should be in singular.

This rule is not strict. The use of plural naming should be considered for case there can be multiple values.

Good:

On a skill page
[[Has gem tags::Fire]]
[[Has gem tags::Cold]]
[[Has gem tags::Spell]]

Bad:

On a skill page
[[Has gem tag::Fire]]
[[Has gem tag::Cold]]
[[Has gem tag::Spell]]

Absence should be indicated by a "no"

Since it is not possible to query for the absence of properties, sometimes properties for the absence of other properties have to be created. In these cases they should be indicated by a no in their name, like so:

[[Has no ...]]

Additionally they should have Has type::Boolean set.

For example:

Property:Has item class restrictions indicates a list of restrictions

Property:Has no item class restrictions indicates the absence of said list


Result templates


Templates

General

  • Always document templates on the respective /doc page (see Template documenation for details)
  • Complicated templates should be implemented in lua
  • Add categories to the /doc page
  • Use English words for naming separated by a space
  • Do not capitalize all words
  • Consider creating /testcases

Template Documentation

  • Always document the template you are creating
  • Create a list of arguments the template takes and a description of what they do (and if they are optional)
  • Add appropriate categories to the template (NOT the /doc subpage, i.e. use <includeonly></includeonly> tags)

Modules

General

  • Use underscore_naming for variables and functions
  • Use 4 spaces for indentation
  • Add extension documentation to /doc if possible, however this is not required if the code is readable
  • If implementing a template in lua
    • Add to the lua comments which template(s) are implemented by the function
    • Add to the /doc page which templates are implemented
    • Add to a link from the template's /doc page using Template:Lua

Module Documenation

  • Add appropriate categories to the template (NOT the /doc subpage, i.e. use <includeonly></includeonly> tags)