MediaWiki for Beginners

From Lolitics Wiki
Jump to navigationJump to search

The Lolitics Wiki runs on the MediaWiki platform, just like the real Wikipedia. MediaWiki is an incredibly well documented piece of software, and you can find the answer to any question you might conceivably have about it here.

But the full documentation is pretty complicated, and to edit our little wiki you only need a tiny fraction of that information. So here's what you need to know.

Formatting[edit | edit source]

Text Formatting[edit | edit source]

Basic Formatting
Formatting Code Example
Two single quotes makes stuff italic.
''Italics!''
Italics!
Three single quotes makes stuff bold.
'''Bold!'''
Bold!
Five will make stuff bold and italic.
'''''Wow!'''''
Wow!
For underline, you need the html <u> tag.
<u>Underline!</u>
Underline!
And for PETER BONE formatting, you need all three.
<u>'''''PETER BONE!'''''</u>
PETER BONE!
Strikeout also requires an html tag, in this case <strike>.
<strike>Strikeout!</strike>
Strikeout!
If you want to display the raw code without actually implementing the instructions from the markup, you need the "<nowiki>" tag.
<nowiki> <u> <- Look, no underline! </nowiki>
<u> <- Look, no underline!
And if you want to display the raw code in a neat little box, like in this table, you need the <pre> tag.
<pre> Look, a box! </pre>
Look, a box!
The wikitext parser deletes any whitespace it deems unnecessary, so if you want text to be on multiple lines without becoming multiple paragraphs, you need the <poem> tag.
<poem>Labour are red,
Tories are blue,
Lib Dems are yellow,
and Ukip are poo.</poem>

Labour are red,
Tories are blue,
Lib Dems are yellow,
and Ukip are poo.

You can also change the font, the text size, or the colour with standard HTML or CSS tags.

Headers[edit | edit source]

Headers mark the titles for the different subsections of the page. If a page has enough subsections, it will automatically generate a table of contents that appears above the first header.

You create headers by flanking your text with increasing numbers of equal signs. Header 1, marked with single equal signs, is reserved for the page title, which generates itself automatically. We never use that one.

Header 2 creates a subsection set off with a horizontal rule, like the one called "Formatting". Header 3 creates a subsection under that, like the one called "Headers".

==Header 2==
===Header 3===

Headers 4 and 5 make even smaller subsections, like so:

====Header 4====
A little subsection with even smaller parts.
=====Header 5=====
Here's one.
=====Header 5 Again=====
And a second.
=====Yet Another Header 5=====
And a third!
====And Another Header 4====
Here's another subsection.

Header 4[edit | edit source]

A little subsection with even smaller parts.

Header 5[edit | edit source]

Here's one.

Header 5 Again[edit | edit source]

And a second.

Yet Another Header 5[edit | edit source]

And a third!

And Another Header 4[edit | edit source]

Here's another subsection.

If you scroll up to the table of contents, you'll see all the little headers.

Links[edit | edit source]

Links, both internal and external, are the lifeblood of a wiki. They are marked with square brackets.

Internal links use two brackets and separate the link (the title of the other wiki page) from the link text with a pipe character ("|"), like so:

[[Guidelines|An internal link!]]

An internal link!

External links use single brackets and separate the link from the link text with a space:

[http://www.parliament.uk/ An external link!]

An external link!

Lists[edit | edit source]

MediaWiki lets you do bulleted lists, which are marked with asterisks:

* Here
* is
* a
* list
** with
** a
** sublist
* Yay!
  • Here
  • is
  • a
  • list
    • with
    • a
    • sublist
  • Yay!

Sometimes you want every bullet point to have a whole paragraph after it. The standard bullet point spacing becomes too compact and hard to read if there's a lot of text, so we have a special Spaced List class to deal with this situation.

You call it like so:

<div class="spacedList">
* A long paragraph

* Another long paragraph</div>
  • A long paragraph
  • Another long paragraph

The extra spacing is almost unnoticeable in this example, but if you do have a list with long paragraphs and you experiment with spacedList you'll see the difference.

Tables[edit | edit source]

Sometimes you have a series of related items you want to put in a table, like a list of characters in an AU or the ministerial posts an MP has held over the years. The page templates have tables already included, so in most cases you won't need to create your own.

Table formatting can get very complicated, but the basics of MediaWiki table coding are fairly straightforward.

Basic Table Coding
Element Code
Begin table
{|
New row
|-
New cell
|
New header cell

(automatic bold
and centered text)

!
End table
|}

So a table coded like this:

{|
|-
! Party
! Colour
|-
| Tories
| Blue
|-
| Labour
| Red
|-
| Lib Dems
| Yellow
|}

will produce this:

Party Colour
Tories Blue
Labour Red
Lib Dems Yellow

You'll notice this is not much of a table: there's no border or background colour to distinguish it from the rest of the page, it doesn't have have borders between the cells or a title cell with a different background colour to make it stand out, and the cells are all jammed together so they're hard to read.

To fix this, we've written some special classes to improve table formatting. Class "paddedcell" gives you decent spacing between the cells. Class "bumpytable" gives you that nice 3D effect. You can call either or neither of them when you set up a new table.

Here's a table using the same formatting as the guide tables in this article:

{| class="paddedcell bumpytable" style= "background-color: #F9F9F9;"
|- style= "background-color: #A9A9AF;"
!colspan = 2 |Party Colours
|-
! Party
! Colour
|-
| Tories
| Blue
|-
| Labour
| Red
|-
| Lib Dems
| Yellow
|}
Party Colours
Party Colour
Tories Blue
Labour Red
Lib Dems Yellow

Notice the "colspan = 2" bit: that's what creates the single, table-spanning header cell for the title. The two "style= background-color: #XXXXXX;" commands assign the background colours to the table and the title cell respectively.

By copying, pasting and modifying the code above, you should be able to create decent-looking tables without having to venture too deep into the labyrinth of table formatting. If you want to get fancier (centering the table on the page, changing the style of the cell borders, changing the alignment of text, etc, etc) you can read the MediaWiki documentation on table formatting here, look at the code for the tables in existing articles, or ask the Admins for help.

Quote Wrappers[edit | edit source]

The blockquote html tag will work, but our wiki has a wrapper template that will put your block of text in a nice grey box and spare you from having to worry about html tags. You call it like so:

{{Quotebox|A long quotation}}

And it produces the following:

A long quotation

There is also a wrapper to format the little quotes with attributions that go at the top of some article sections. You call it like this:

{{Quote|A quote|Who said it}}

And it produces this:

A quote~ Who said it

If you don't know who said it, you can just leave the second parameter blank and the attribution line will disappear:

{{Quote|A quote}}

A quote

References[edit | edit source]

Although we are not as exacting about citation as Wikipedia, it's generally a good idea to provide references for specific claims, especially when they are of the outlandish "Pics or it didn't happen!" variety. This is a fandom where truth is often stranger than fiction, but it's part of our mission to help people distinguish between the two.

To add a citation to an article, you use the <ref> tag as follows:

The Cite extension allows us to make citations.<ref>http://www.mediawiki.org/wiki/Extension:Cite</ref>

The Cite extension allows us to make citations.[1]

If you click on the citation, it will take you to the reference footnote at the end of the article.

You can also use the <ref> tag for editorial footnotes that don't contain a reference:

Sometimes the text needs further clarification in a footnote.<ref>Though not in this case.</ref>

Sometimes the text needs further clarification in a footnote.[2]

At the end of any article containing a <ref> tag you will need to create a references section using the following code, or you'll get an error.

==References==
<references />

This will automatically create a list of the references and footnotes. You can see them at the bottom of this article.

Multimedia[edit | edit source]

Images[edit | edit source]

Uploading Images[edit | edit source]

You can only upload images when you're logged in, and the process for doing it is a bit cumbersome. Once you're logged in you'll see a little "Upload File" link in your Tools box on the lefthand side of the screen. Open that link in a new window/tab and it will take you to a page that will let you upload an image.

Before uploading your image, please make sure you change the destination file name to something sensible. The file name should look like this:

Page_Name.Description.jpg

where Page_Name is the name of the article you're uploading the image for. Otherwise we get a bunch of images with indecipherable titles and it's not clear which articles they belong to.

Displaying Images[edit | edit source]

MediaWiki has a lot of options for displaying images, but we're not using most of them. (Ignore everything the file upload page tells you about image linking.) Our standard display format looks like this:

[[File:Page_Name.Description.jpg|thumb|center/left/right|(width)x(height)px|A caption]]

The second parameter tells the image what alignment it should use and the third determines its size. Center alignment will interrupt the text to display the image and resume the text below it. Left and right alignments will float the image on the left or right margin of the page and wrap the text around it. If you don't care about the image size or you don't want a caption you can omit those parameters.

So if you wanted to post a picture of Michael Gove intently editing Ed Balls' wiki page, you could type the following:

[[File:MediaWiki_for_Beginners.Gove.jpg|thumb|center|Govey editing the Lolitics wiki.]]
Govey editing the Lolitics wiki.

The size of every image is automatically limited to 300x300px to save browser space. If you want your image to display larger than this (or in the case of our Gove image, to display at its full size), you need to specify the size parameter like so:

[[File:MediaWiki_for_Beginners.Gove.jpg|thumb|center|334x263px]]
MediaWiki for Beginners.Gove.jpg

Images can never be resized to larger than their actual size, so if you want to display an image at its full size and you don't want to look up the exact dimensions you can use something like "600x600px" as a shorthand.

If you wanted to make Gove smaller and have him float left, you could type:

[[File:MediaWiki_for_Beginners.Gove.jpg|thumb|left|100x100px]]
MediaWiki for Beginners.Gove.jpg

Look, a tiny floaty Gove! Note how it is floating next to the text, with the text wrapping around it.

Image Galleries[edit | edit source]

Sometimes you have a lot of images you want to display without much context, for instance, a bunch of Prime Ministers on stamps. The easiest way to deal with this is to create an image gallery.

You can specify the heights or widths you want the images to be scaled to, and you can include image captions as a second parameter. They'll show up if you hover your mouse over the image.

<gallery mode="packed-hover" heights=175px>
File:MediaWiki_for_Beginners.PittStamp.jpg|William Pitt the Younger
File:MediaWiki_for_Beginners.GreyStamp.jpg|Charles Grey
File:MediaWiki_for_Beginners.PeelStamp.jpg|Robert Peel
File:MediaWiki_for_Beginners.GladstoneStamp.jpg|William Gladstone
File:MediaWiki_for_Beginners.ChurchillStamp.jpg|Winston Churchill
File:MediaWiki_for_Beginners.AttleeStamp.jpg|Clement Attlee
File:MediaWiki_for_Beginners.WilsonStamp.jpg|Harold Wilson
File:MediaWiki_for_Beginners.ThatcherStamp.jpg|Margaret Thatcher
</gallery>

Video[edit | edit source]

MediaWiki blocks most html to prevent trolls from uploading dangerous scripts, so we can't use normal video embedding code, but we can embed stuff from YouTube using a special tag.

The height and width parameters specify how big the embedded video should be (you can figure this out by looking at the equivalent values in the YouTube embedding code) and the numerical code for the video (the thing after the watch?v= bit in the URL) goes in between the <youtube> tags.

It's often nice to center the video, which is what the div tags are for.

<div style="text-align:center;"><youtube width=560 height=315>IlE-Uys_2mI</youtube></div>

Magic Words[edit | edit source]

MediaWiki has special commands called magic words which allow you to alter or manipulate basic features of the page. Some do things like hiding the table of contents or allowing you to display the page title in the text- if you're interested you can look them all up here- but the only one we really care about is

__NOINDEX__

__NOINDEX__ is the command that stops Google and other search engines from crawling and listing our pages. Every page on the wiki must contain it somewhere (it usually goes at the beginning of the first paragraph) to keep the wiki off Google.

Navigation[edit | edit source]

Categories[edit | edit source]

Categories are the MediaWiki equivalent of tags. They control the navigation system and allow us to group similar pages. Every category has its own page listing all the pages in that category, and as you'll see in the next section, we can also use them to make more refined lists of pages.

At the bottom of every page is a box listing all its categories, and categories appear at the bottom of each page's wikitext code too. Categories are declared like this:

[[Category:Some Category]]

For instance, this page is in the Help category.

[[Category:Help]]

If you click edit so you can see the raw code, you'll see a little clump of those assignments at the bottom of most pages.

If you want to link to a category page, you need to put a colon in front. Otherwise the wiki will just think you're trying to assign the current page to that category:

[[:Category:Help]]

Category:Help

Dynamic Page Lists[edit | edit source]

Dynamic page lists enable us to create lists of all the pages in certain categories. They can support an infinite number of boolean operations if you are careful about how you code them.

There are two basic DPL commands: "category" (which retrieves everything in the specified category) and "notcategory" (which retrieves everything not in that category*). In addition, you can use "&" for an "and" and "|" for an "or" if you want to work with more than one category (although you can't use both in the same line, and "|" doesn't work with "notcategory").

For instance, suppose you wanted to retrieve all the backbenchers in the Lords, but only those who had never been members of the SDP:

<DPL>
category = Backbencher & Lord
notcategory = SDP
</DPL>

* Note: notcategory will retrieve every page on the wiki except those tagged with the category you specify, including templates and image files. It's for narrowing down a list of pages you've already retrieved; it's not really useful on its own.

References[edit | edit source]