Wiki Markup/Printable version
This is the print version of Wiki Markup You won't see this message or any elements not part of the book's content when you print or preview this page. |
The current, editable version of this book is available in Wikibooks, the open-content textbooks collection, at
https://en.wikibooks.org/wiki/Wiki_Markup
Basic Markup Language
MediaWiki's markup system may sound daunting and complex at first glance, but it's not nearly as hard as it seems! First, let's start with "bold", all you do is wrap the text you want to be bold in '''
. For example: if I wanted to make the word "Cat" bold, I would type '''Cat'''
. It would produce this result: Cat. To put text in italics, you'd do the same but in two ''
s. Example: ''cat''
would produce the result cat.
Next, linking. To link to another article, you would wrap the article name in square brackets. For example, to link to the page History, you would type [[History]]
. That would produce the result History. To link to an external link, you would set it out like this [URL Text]
. For example, if one types [http://www.google.co.uk Google]
, the system would produce the result Google. It's that simple.
The next important thing is templates. To transclude a template, one would type (let's take the template Lorem ipsum for example) {{Lorem ipsum}}
. However, some templates require that you determine variables. To determine variable X on template Y one would type {{X|Y=Test}}
. This is especially useful in infoboxes that rely on the information you enter. To substitute a template for its code (only recommended for warnings, and similar circumstances), you simply add the subst: prefix. Finally, categorisation. To add a page to a category you simply type [[Category:Category name]]
. This code would add the page to category Category name.
That's it for the basics of Wikipedia markup!
Templates
Templates are automatically generated text boxes which pipe user-entered data in a nice format which may also include a small graphic element. By typing a shortcut an editor can create a prefabricated presentation which permits a better user experience for viewers (end-users) who are not editing.
Templates in Wikimedia belong in the Template namespace. In a page, a template is surrounded by braces, such as {{Example}}
. The need to type in {{Template:Example}}
is negated, because the braces defaults to the Template namespace unless specified.
Templates can be displayed in two ways. You can either transclude them or substitute them. Normally, a template is transcluded, which shows the version on the original page. If the source page is updated, the template is updated. Substitution copies over the source code of a page as it is. Instead of viewing a page with the parameters specified, it directly pastes the code for the template into the page. The substituted code does not change if the source page changes.
To specify parameters in a template, you use the symbol |
. This separates the template name/another parameter from the current parameter. Normally, you have to name the given parameter. For example, if {{Example}}
requires a name, then you will have to specify a name by using a parameter, such as {{Example|name=A name}}
. If no name is specified, then {{Example|A name}}
is the same as {{Example|1=A name}}
.