Help:Editing
Introduction
This page is a quick reference for wikitext-code. A full help for Wiki markup can be found at Wikipedia.
WikiPages gives common guidelines on the best practices to be followed when writing LabRPS documentation.
This Editing Overview has a lot of wikitext examples. You may want to keep this page open in a separate browser window for reference while you edit.
Editing basics
- Start editing
- To start editing a MediaWiki page, click the Edit link at the top of the page. This brings you to a page with a text box containing the wikitext: the editable source code from which the server produces the webpage. If you just want to experiment, please do so in the sandbox, not here.
- Type your changes
- You can just type your text. However, also using basic wiki markup (described in the next section) and adding links adds to the value of your contribution.
- Summarize your changes
- Write a short edit summary in the small field below the edit-box. You may use shorthand to describe your changes, as described in the legend.
- Upload images
- You can also add images and screenshots. Please only upload *.png and *.svg files.
- Preview before saving
- When you have finished, click the Show preview button to see how your changes will look before making them permanent. Repeat the edit/preview process until you are satisfied, then click the Save page button. Your changes will be applied to the page immediately.
Basic text formatting
What you type | What it looks like |
---|---|
You can ''italicize text'' by putting 2 apostrophes on each side. 3 apostrophes will bold '''the text'''. 5 apostrophes will bold and italicise '''''the text'''''. 4 apostrophes don't do anything special, there's just ''''one left over''''. |
You can italicize text by putting 2 apostrophes on each side. 3 apostrophes will bold the text. 5 apostrophes will bold and italicise the text. 4 apostrophes don't do anything special, there's just 'one left over'. |
A single newline has no effect on the layout. But an empty line starts a new paragraph. |
A single newline has no effect on the layout. But an empty line starts a new paragraph. |
You can break lines<br> without a new paragraph.<br> Please use this sparingly. |
You can break lines |
You should sign your comments on talk pages:<br> - Three tildes gives your user name: ~~~<br> - Four tildes give your user name plus date/time: ~~~~<br> - Five tildes gives the date/time only: ~~~~~<br> |
You should sign your comments on talk pages: |
You can use <b>HTML tags</b>, too. For example: Put text in a <tt>typewriter font</tt>. The same font is generally used for <code>computer code</code>. <strike>Strike out</strike> or <u>underline</u> text, or write it in <span style="font-variant:small-caps"> small caps</span>. Superscripts and subscripts: X<sup>2</sup>, H<sub>2</sub>O Invisible comments to editors (<!-- -->) only appear while editing the page. <!-- Note to editors: blah blah blah. --> If you wish to make comments to the public, you should go to the [[wikipedia:wikipedia:talk page|talk page]]. |
You can use HTML tags, too. For example: Put text in a typewriter font. The same
font is generally used for
Superscripts and subscripts: X2, H2O Invisible comments to editors (<!-- -->) only appear while editing the page. If you wish to make comments to the public, you should go to the talk page. |
For a list of HTML tags that are allowed, see HTML in wikitext. However, you should avoid HTML in favor of wiki markup whenever possible.
Organizing your writing
What you type | What it looks like |
---|---|
== H2 heading == Adding pairs of equals signs around a text creates a heading for a new paragraph. You should start with 2 pairs of equals signs because using 1 pair would create an H1 heading which is reserved for the page title. === H3 heading === Do not skip levels, for example do not go from 2 to 4 pairs of equals signs. |
Adding pairs of equals signs around a text creates a heading for a new paragraph. You should start with 2 pairs of equals signs because using 1 pair would create an H1 heading which is reserved for the page title. Do not skip levels, for example do not go from 2 to 4 pairs of equals signs. |
=== External links === You will often want to make clickable links to other pages. Here's a link to a page named [[Compile_on_Linux|Compile on Linux]]. [[Compile on Linux]] will also work. But the first example is preferred. |
External linksYou will often want to make clickable links to other pages. Here's a link to a page named Compile on Linux. Compile on Linux will also work. But the first example is preferred. |
You can put formatting around a link. Example: ''[[Compile_on_Linux|Compile on Linux]]''. |
You can put formatting around a link. Example: Compile on Linux. |
The first letter of pages is automatically capitalized, so [[Compile on Linux]] goes to the same place as [[compile on Linux]]. Capitalization matters after the first letter. |
The first letter of pages is automatically capitalized, so Compile on Linux goes to the same place as compile on Linux. Capitalization matters after the first letter. |
[[The_weather_in_Riga|The weather in Riga]] is a page that doesn't exist yet. You could create it by clicking on the link. |
The weather in Riga is a page that doesn't exist yet. You could create it by clicking on the link. |
You can link to a page section by its heading:<br> [[Help:Editing#Organizing_your_ writing|Organizing your writing]]. If the section is on the same page you should leave out the page name:<br> [[#Organizing_your_ writing|Organizing your writing]]. |
You can link to a page section by its heading: If the section is on the same page you should leave out the
page name: |
You can make a link to Wikipedia by typing:<br> [[wikipedia:Python (programming language)]] You can make an external link by just typing a URL:<br> http://www.nupedia.com You can give it a title:<br> [http://www.nupedia.com Nupedia] Or leave the title blank:<br> [http://www.nupedia.com] |
You can make a link to Wikipedia by typing: You can make an external link by just typing a URL: You can give it a title: Or leave the title blank: |
Linking to an e-mail address works the same way:<br> mailto:someone@domain.com Or:<br> [mailto:someone@domain.com someone] |
Linking to an e-mail address works the same way: Or: |
#REDIRECT [[Target page name]] |
You can redirect the user to another page. |
To put a page in a [http://en.wikipedia.org/wiki/Wikipedia:Categorization category], add a link like Category:Help. Category links do not show up inline but at page bottom. They cause the page to be listed in the linked category:<br> [[Category:Help]] To link to a category page without putting the article into the category, use a colon prefix in the link:<br> [[:Category:Help]] |
To put a page in a category,
add a link like Category:Help. Category links do not show up
inline but at page bottom. They cause the page to be listed
in the linked category: To link to a category page without putting the article
into the category, use a colon prefix in the link: |
You can include images: [[Image:Labrps.svg|24px]]. You can refer to [http://www.mediawiki.org/wiki/Help:Images MediaWiki Images Help] for details about the available options. A very useful one is <code>none</code>, allowing your image to be positioned on the left, with no flowing text: [[Image:Labrps.svg|none]] |
You can include images: . You can refer to
MediaWiki Images Help
for details about the available options. A very useful one is
|
You can use ordered or unordered lists: # Item1 ## Sub-item 1.1 ### Sub-item 1.1.1 ## Sub-item 1.2 # Item2 * Item1 ** Sub-item 1.1 *** Sub-item 1.1.1 ** Sub-item 1.2 * Item2 |
You can use ordered or unordered lists:
|
Collapsible element
Collapsible element complete page
Click to see the code
Collapsible element 500 pixels
Click to see the code
Code blocks and syntax highlighting
To mark a code block a number of solutions are available. The Code template is the preferred solution.
Prepend a space to each line
Example:
import math for radius in [1.0, 2.0, 3.0]: area = math.pi * pow(radius, 2) print(area)
Result:
import math for radius in [1.0, 2.0, 3.0]: area = math.pi * pow(radius, 2) print(area)
Use <pre> tags
Example:
<pre> import math for radius in [1.0, 2.0, 3.0]: area = math.pi * pow(radius, 2) print(area) </pre>
Result:
import math for radius in [1.0, 2.0, 3.0]: area = math.pi * pow(radius, 2) print(area)
Use <syntaxhighlight> tags
As the name implies, these tags will highlight the syntax. The lang
parameter is required.
Example:
<syntaxhighlight lang="python"> import math for radius in [1.0, 2.0, 3.0]: area = math.pi * pow(radius, 2) print(area) </syntaxhighlight>
Result:
import math for radius in [1.0, 2.0, 3.0]: area = math.pi * pow(radius, 2) print(area)
Use the Code template
The Code template will also highlight the syntax. If the language is Python the lang
parameter is optional.
Example:
{{Code|lang=python|code= import math for radius in [1.0, 2.0, 3.0]: area = math.pi * pow(radius, 2) print(area) }}
Result:
import math for radius in [1.0, 2.0, 3.0]: area = math.pi * pow(radius, 2) print(area)
Templates and transcluding pages
Templates are segments of wiki markup that are meant to be copied automatically ("transcluded") into a page. You add them by putting the template's name in {{double braces}}. By default, pages are transcluded from the default Template namespace. The namespace is the portion of a page name before the colon; for instance, in Help:Editing, Help is the namespace in which the page Editing lives.
It is also possible to transclude other pages from the default namespace (the null one) by using {{:colon and double braces}}.
There are three pairs of transclusion markup tags that can be used in wikitext to control how transclusion affects parts of a template or article. They determine whether or not wikitext renders, either in its own article, which we will call "here", or in another article where it is transcluded, which we will call "there".
- <noinclude>: the content will not be rendered there. These tags have no effect here.
- <includeonly>: the content will render only there, and will not render here (like invisible ink made visible by means of transclusion).
- <onlyinclude>: the content will render here and will render there, but it will only render there what is between these tags.
There can be several such section. Also, they can be nested.
Remark: if a page is transcluded without any transclusion markup, it may cause an unintentional categorization. Any page transcluding it will contain the same category as the original page. Wrap the category markup with <noinclude> tags to prevent incorrect categorization.
What you type | What it looks like |
---|---|
{{Transclusion demo}} |
|
{{Help:Transclusion demo}} |
Special Pages
Special pages are pages that cannot be edited, but are generated by the wiki engine. They provide very useful functions, and live in the Special namespace. A summary of all special pages is available from Special:SpecialPages.
Direct link to frequently used Special pages are:
- Special:WhatLinksHere that allows to find all the wiki pages linking to the given page name. For example, find all the pages linking to this page
- Special:PrefixIndex that allows to find all pages starting with the given prefix. For example, find all the pages in the Template namespace
Minor edits
A logged-in user can mark an edit as "minor". Minor edits are generally spelling corrections, formatting, and minor rearrangement of text. Users may choose to hide minor edits when viewing Recent Changes.
Marking a significant change as a minor edit is considered bad Wikiquette. If you have accidentally marked an edit as minor, make a dummy edit, verify that the "[ ] This is a minor edit" check-box is unchecked, and explain in the edit summary that the previous edit was not minor.