How to MediaWiki Code

From Tar Valon Library
Jump to: navigation, search

This is a short guide to the basic formatting we most often use in TarValon.Net's Library.

What is a Wiki?

"A wiki is a collaborative editing and working environment, containing multiple pages on certain topics, either public or limited, to use within an organization for maintaining its internal knowledge base. A wiki is enabled by wiki software, also known as wiki engines."

TarValon.Net's wiki runs on a software called MediaWiki. MediaWiki.org also has a Formatting guide, which can be accessed here. MediaWiki is a wiki editing software created for use on Wikipedia, and remains in use on Wikipedia, but is also used in almost all other Wikimedia websites - wiktionary, wikidata, etc.

Starting to edit an article happens when the Edit button in the Navigation bar is clicked. Editing can be done either by manually writing code or using the toolbar at the top of the editing area.

Headings

Section headings, headlines, or just headings, separate different sections of information on the page. The headings usually describe what the section that follows will be about.

Each section can have subsections, which are also headings.

To create a heading, the title of the heading (written in title case) should be surrounded by an equal number of equal signs. Text should not be put on the same line after the equal signs.

Top section heading (two equal signs) - ==Title Written in Title Case==

Subsection heading (three equal signs) - === Title Written in Title Case ===

TarValon.Net Library does not use the highest level (Level 1) headings, therefore writing =Title= is prohibited.

Placing more than three headings on a page will create a Table of Contents (TOC) at the top of the page. If a Table of Contents is unnecessary on the page, __NOTOC__ should be written at the top of the page.

Paragraphs

To start a new paragraph, a single Enter/Return press is not enough. To create a new line in the rendered text, there should be a whole empty line left in the code, in order to start a new paragraph.

Example: Rand al'Thor is a young man from the Two Rivers.

[a whole empty line]

Rand al'Thor is also NOT born in the Two Rivers.

Long text paragraphs are automatically wrapped on the next line, so in cases where sentences are very long, there is no need to break lines.

Basic Text Formatting

Text formatting is available, but not used too often. The most often uses are described below:

  • To make text render Italic, surround it in two single quotes: ''italic text'' - results in italic text.
  • To make text render Bold surround it in three single quotes: '''bold text''' - results in bold text.
  • To make the text render Bold AND Italic, surround it in five single quotes: '''''italic and bold text''''' – results in italic and bold text.
  • To Underline text, use <u>text</u> - results in underlined text.
  • To Strikethrough text, use <s>text</s> - results in struck-through text.

Lists

Lists are used to combine several items of the same kind. By default the TarValon.Net Library uses bulleted, or unordered lists, but there might be instances of ordered or numbered lists.

To create a list in the wiki, you need to add special characters to the beginning of each list item. The special characters tell the software how to format the list on screen.

Wikitext Rendering
For bulleted lists
*List item 1
*List item 2
  • List item 1
  • List item 2
For numbered lists
#List item 1
#List item 2
  1. List item 1
  2. List item 2
Need indented lists? It is also possible.
*List item 1
** List item 1.2

#List item 1
##List item 1.2
  • List item 1
    • List item 1.2
  1. List item 1
    1. List item 1.2
Definition Lists
;List item 1
: definition 1

;List item 2
: definition 2-1
: definition 2-2
List item 1
definition 1
List item 2
definition 2-1
definition 2-2

Links

Linking to pages in the wiki is one of the most common editing cases. To link to a page of TarValon.Net Library, put the name of the page in double square brackets.

Example: [[Page Title]]

If the page title is not what should be rendered on the page, use the following:

[[Page Title|Name]] creates an internal link to the page with Name as the rendered text.

Example: [[Ilverin Matriam|Ilvy]] makes the word "Ilvy" link to the page "Ilverin Matriam".

Sometimes, linking to outside sources might be necessary. In such cases, surround the URL to be linked to in single square brackets.

Example: [url-to-external-website]

As with the internal links, certain text can be rendered on the page when using an external link. However, instead of a pipe character, only a space is needed to separate the link from the text.

Example: [url-to-external-website Text to Show]

Pages, Categories and Templates

All of the brackets might get confusing for first-time editors. This is how to distinguish them:

  • [[Red Ajah Aes Sedai]] - This is the link to a page.
  • [[:Category:Red Ajah Aes Sedai]] - This is a link to a category.
  • {{red2}} - this is a template, displaying the text Red Ajah and linking to the Red Ajah Community Page.

Templates are created internally and are used internally only in TarValon.Net's Library. So a template that renders or formats certain text may exist in the Library, but not in any other wiki.

Categories are used to group pages, whereas templates are mainly used to shorten long links and to link to pages within the community. ([[brown]] links to page on the Brown Ajah in the book series, whereas {{brown}} links to the TarValon.Net Ajah.)

The Library uses a lot of Wheel of Time and TarValon.Net specific templates to make things easier to type. For example:

  • {{teotw|1}} is replaced with TEotW, Ch. 1 as a link.
  • {{teotw2|Chapter 1}} is replaced with The Eye of the World, Chapter 1, as a link.
  • {{BWB}} is replaced by The World of Robert Jordan's "The Wheel of Time", Chapter .
  • {{bwb}} is replaced by TWoRJTWoT, Ch.
  • {{main|article}} is replaced by Main article: article, with article as a link.

All the TarValon templates used in the Library can be found under Category:Templates.

Tables

Tables are an excellent way of listing information. Tables are used a lot in TarValon.Net's Library.

A basic table with two fields and two columns, as well as a title row on top, would be coded like this:

{| class="wikitable"
! Title 1
! Title 2
|-
| Column 1 Row 1
| Column 2 Row 1
|-
| Column 1, Row 2
| Column 2, Row 2
|}

To render the following table:

Title 1 Title 2
Column 1, Row 1 Column 2, Row 1
Column 1, Row 2 Column 2, Row 2

The table's start ( {| ) and end ( |} ) elements are absolutely required to create a table. Each row is separated by the ( |- ) character. A table cell in this row is separated by a single pipe character and it is written underneath the row. A cell beginning with an exclamation mark is rendered as table header.

To make the table sortable, add the class ="wikitable sortable" to the top row.

To set the width of the table, add width=percentage of page (e.g. width=50%).

To set the width of a separate column, add the same to and before the title of that column (!width=15%|Title 1 will make that column take up 15% of the width of the table).

More on tables can be learned on MediaWiki.org’s help page on tables.


For more information, feel free to contact the Director of Research and Records at library@tarvalon.net.