RuneScape:Style guide/Wiki code

The wiki code style part of the style guide is a set of guidelines to work towards when cleaning up the wiki code used in articles. These guidelines are not an obligation during general editing, but serve as a common ground for the specific task of keeping the wiki code clean and consistent.

Trailing spaces
Do not allow trailing spaces at the end of lines/paragraphs, with the exception of a single trailing space following the '=' of a parameter without a value in a block-style template.

Multiple spaces
Only a single space should be used between the end of one sentence and the beginning of the next, and between words.

Styling/tags
There should be no spaces between text styling wiki syntax elements or HTML tags and their content. If the styling only surrounds a fraction of a full block, spaces should be on the outside of the styling. Use: This is bold and red. instead of: This is bold and red.

Line break tags
When  tags are used, they should not be surrounded by spaces, but immediately follow/precede the content that is broken into two lines. When used in a paragraph, the tag should be followed by an actual new line.

Inline
Inline templates should not have spaces between the pipe (' ') symbol and the parameter name (or value), nor before or after the ' ' sign.

Block
Block templates should have each parameter on a new line, with no space between the pipe symbol and the parameter name or value. The ' ' symbol should be surrounded by a single space on each side. The final ' ' should be on a separate line.

List
There should be a single space between a list character and the content of that list item. * List1
 * Sublist
 * List2

Section headers
There should be no spaces between the ' ' signs used as wiki syntax for the section headers and the content of the header. ==HEADER==

General
Paragraphs should only be separated by a single blank line; if for some formatting reason a wider gap is required, use the Clear template as necessary. The clear template should be on its own line. Example: Paragraph 1

Paragraph 2

If the formatting issue is caused by a right-floating element (such as an infobox), the clear template should generally have the value ; for left-floating elements (like chatheads),.

A section header should always be preceded by a blank line, except if the previous line with content is another section header, or if the previous line is a  for formatting purposes and is preceded by a blank line. A section header should never be followed by a blank line. As with the detail and chathead images just after an infobox, if the first line after a section header is a (group of) file(s), or a simple text-template such as Main, it should not be followed by a blank line before the next paragraph.

There should be no blank line between a  tag and its preceding table, if applicable; nor between the last trivia bullet and a WP also template.

Language links and categories should not be separated by blank lines. They should also follow the last content part of the article without any blank lines separating them, regardless of what that last bit of content is (text, list, table, template, ...).

Template grouping
There should be no blank line between the 'header templates', the infobox, and the first paragraph. 'Header templates' are the grouping of all templates that are generally put at the very top of an article (RSC/2007scape links, otheruses, strategy, dual wield, ...). There should be no blank lines between navboxes, nor between templates that belong together (such as drop table templates). Reflist tags should be separated by a blank line from following navboxes, even if they are not preceded by their own section header.

Lists
Lists should be followed by a blank line. On disambig pages the listing should always be preceded by a blank line.

Special tags
should be placed at the very top of the page, prior to any actual article content. At the bottom of the page  should be placed just prior to any language links (or categories). In both cases no blank lines should precede or follow these tags, and each tag should be placed on its own line. should be placed before the first section header, without a blank line in between them. All other behaviour switch magic words should be at the top of the page before ; however, this should almost never occur.

Template order
The following order should be followed for 'header templates'. Each template should start on a new line:

<> <> <>

Detail/chathead
The detail image of an article should come first, after the infobox, followed by the chathead image (either only if applicable), and the first paragraph. Both of these should be left-floating elements.

Tables
In the mainspace, tables should always be created using the wiki syntax instead of using HTML tags. In other namespaces (specifically Template: and Module:) it might be required to use the HTML tags instead.

Except for very simple tables, multi-line row formatting should be preferred, where each cell starts on its own line.

Formatting
Tables in mainspace articles should always have the class, unless there is a specific reason why this is omitted. CSS classes for tables should be placed in the following order:

wikitable, sortable, lighttable, mw-collapsible, mw-collapsed/uncollapsed

If present, the table header should be the first thing following the table opening.

The order that should be used for any style and attributes applied to a table, cell or row is:

id, class, rowspan, colspan, style

White-spacing
A space should be placed between each table syntax element and table content, styling, and attributes. Empty cells should not contain anything, even a space, with the exception of an empty cell in the single-line row formatting as long as this is not the last cell of the row. In this case a single space should separate both cell boundary syntax elements.

Below are examples of the expected placement of white-spacing in both formats.

HTML
Strict XHTML should be used in preference to older HTML. For example, prefer. This also implies:


 * Surround all attribute values by double quotation marks: use  instead of
 * Separate attribute values by a space, but do not put a space around the ' ' between attributes and their values:  instead of
 * Style attributes should contain no spaces surrounding the ' ' between the style's tag and its value. Each style tag+value combination should be terminated by a ' ', even if there is only a single pair, and a space should separate multiple tag+value combinations:  instead of
 * There should be no space between the last part of a tag and the closing, except in the case of a self-closing tag. For self-closing tags, a single space should precede the.

Prefer using CSS over deprecated HTML tags such as, except when appropriate wiki syntax elements exist (such as  ). Notable exceptions are: the sup and sub tags.

Number formatting
Always include thousand separators in any numbers above 999 (and below -999), with the exception of in the year of a date (for both real dates and an ingame lore date) and for numbers that are template parameter values, which the template will automatically format (convert value of an Infobox Item, quantity of a DropsLine, ...).

Image captions
Non-thumbnail/framed images should generally not contain a caption. Use: instead of:

Disambiguation pages
Disambiguation pages should begin with Term may refer to:

And each item listed should be part of an unordered list. Each item may stand alone or have a short sentence fragment following it. If a term is disambiguated in the title, it may have the parenthetical removed via pipe link; however, this will require it to have a description. For example:

Harry may refer to:


 * Harry
 * Harry, a man in Falador
 * Harry (Slayer master)

Information presented in the description should be kept to a bare minimum (remember: these are not actual articles; they are navigational tools), and should only be just enough to direct a reader to the correct article. For the same reason, links should be used extremely sparingly. " Harry, a man in Falador" is preferred over " Harry , a man in Falador".

For pages with more than several items, the list may be split into sections. Short pages may use fake section headings (by starting the line with a " "); longer pages should use proper, level-3 headers.

Example page
Below are examples of the above guidelines in action, for a stub version of an average article.

Normal page
__BEHAVIOURSWITCH__

Subject has information in lead paragraph.

First heading
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Sub heading
PARAGRAPH

New line, same paragraph.


 * Item
 * Item

Trivia

 * Trivia

Disambiguation page
TERM may refer to:


 * Item
 * Item