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

From Path of Exile Wiki
Jump to navigation Jump to search
>OmegaK2
(Manual of Style - smw properties)
>OmegaK2
(templates, modules added)
Line 1: Line 1:
{{fmbox|text=This is draft, discuss it on the [[{{TALKPAGENAME}}|talk page]]}}
__TOC__
__TOC__


Line 41: Line 43:
'''Use "Has ... " for setting additional information about the page.'''
'''Use "Has ... " for setting additional information about the page.'''


See example above.
See example above.<section end="smw property" />
 
===Result templates===
<section start="smw result templates />* The [[Path_of_Exile_Wiki:Manual_of_Style#Templates|guidelines for templates]] in general apply
* Create the templates with the prefix SMW
* Add the template to [[:Category:SMW result formatting templates]]
* Add outro/intro templates as subpages to the main template. Document it on the /doc page if outro/intro templates are needed
<section end="smw result templates" />
 
==Templates==
<section start="templates />
===General===
<section start="templates general" />* Always document templates on the respective /doc page (see [[{{FULLPAGENAME}}#Template documentation|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 <section end="templates general" />
 
===Template Documentation===
<section start="templates 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 <nowiki><includeonly></includeonly></nowiki> tags)
** For lua based templates add [[:Template:Lua]] at the top<section end="templates documentation" /><section end="templates" />
 
==Modules==
<section start="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 <nowiki><includeonly></includeonly></nowiki> tags)
** For templates for inclusion in other templates add [[:Template:ProgrammingModule]]


<section end="smw property" />
<section end="modules" />

Revision as of 15:46, 4 September 2015

This is draft, discuss it on the talk page

Semantic Mediawiki

Properties

Choose a meaningful name for a property but keep it short.

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]]


Use a verb for the property for the property

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.

See example above.

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)