Apr
29
2013

MediaWiki cheatsheet

We had a request recently from a client of our MediaWiki training course for a MediaWiki cheatsheet to help them remember the various syntaxes for different formatting options in MediaWiki.

This MediaWiki cheatsheet provides a guide to basic MediaWiki formatting, from making text bold and italic to inserting images in to your MediaWiki articles.

Basic MediaWiki formatting cheatsheet

Aim MediaWiki syntax or ‘wiki markup’ to do this What you’ll see Comments
A new paragraph Ensure there is a free line between content. This is on line.

This is a second paragraph created by the spare line above.

Italic text ”Italic text’ Italic text A double apostrophe on each side of the text you want to make italic.
Bold text ”’Bold text”’ Bold text A triple apostrophe on each side of the text you want to make bold.
Bold and italic text ””’Bold and italic text””’ Bold and italic text Five apostrophes on each side of the text you want to make bold and italic.
A table of contents n/a A table of contents based on the headings in your wiki article. MediaWiki will do this automatically once your article has 4 or more headings. You can remove the table of contents from a specific article by inserting the

__NOTOC__ magic word in to the page's content.
A link to another page in your wiki [[Test page]] Test page This would link to the page called Test page in your wiki, whether or not the page existed.
A link to another page in your wiki with custom link text [[Test page|Link text]] Link text This would link to the page called Test page in your wiki, whether or not the page existed, but it would display Link text rather than Test page.
A link to another website (an external link) [http://www.example.com] 1 Be sure to use the full link to the website, including the "http://". Most MediaWiki installations (this depends on the "skin" or design you have installed) will display a small icon alongside external links to indicate they're different from the internal link to a page within your wiki.

MediaWiki will number links added like this, starting at 1.

A link to another website (an external link) with custom link text [http://www.example.com Link text] Link text Be sure to use the full link to the website, including the "http://", and leave a space between the link to the website and the link text you wish to use.
A bullet point list * A list item
* A list item
** A nested list item
** A nested list item
* A list item
  • A list item
  • A list item
    • A nested list item
    • A nested list item
  • A list item
You can nest more than one list in itself by using more asterisk (*) characters.
A numbered list # A list item
# A list item
## A nested list item
## A nested list item
# A list item
  1. A list item
  2. A list item
    1. A nested list item
    2. A nested list item
  3. A list item
You can nest more than one list in itself by using more hash (#) characters.
An image [[File:Test.jpg]] Test image This inserts the image called Test.jpg in your wiki in to the page at its original size.
An image with a size and caption [[File:Test.jpg|200px|Caption goes here]] Test image This inserts the image called Test.jpg in your wiki in to the page at a size of 200px (200 pixels wide) in to the page with a caption of "Caption goes here".
An image with a size and caption, as a thumbnail [[File:Test.jpg|thumb|right|200px|Caption goes here]] Test image This inserts the image called Test.jpg in your wiki in to the page at a size of 200px (200 pixels wide) in to the page with a caption of "Caption goes here". The image will appear to the right of the content block, with text flowing around it.
A category [[Category:Test category]] This adds the page to a category called Test category. You can insert more than more category per page using this syntax.
A redirect #REDIRECT [[New page]] This redirects the current page to a page called New page whether or not this page exists.  

Advanced MediaWiki editing cheatsheet

Aim MediaWiki syntax or 'wiki markup' to do this What you'll see Comments
A table of data {|
! A table heading
! Another table heading
|-
| A table cell
| A table cell
|}
A table heading Another table heading
A table cell A table cell
Use {| to open a table and |} to close a table. For each new cell in the table, start a new line in MediaWiki's editor tool. Start the line with an exclamation mark (!) for table headings, and a vertical pipe (|) for normal cells. Use |- (a vertical pipe followed immediately by a hyphen character) to start a new row of cells.

Have we missed anything? Let us know!