Wiki syntax
Editing a wiki-page is in most cases straightforward, just enter your text. However, you have to consider some conventions and you need to know how to format the text. The basics of these convention and some of the most frequent used formatting (wiki-markup) will be explained in this article.
- Important
- Use the button "Show Preview" to see how your text and formatting will look like.
- Use this button as often as needed before you "Save Page".
- Make small edits, a few lines/paragraphs, one list, table or new section at a time.
- In case something went wrong and you saved the changes, you can revert these changes in the version history of the page. Use this rarely but when necessary.
- You may use the sandbox of the OSM-wiki to experiment with markup you are not yet familiar with.
More comprehensive resources
- For a short overview of most frequent wiki editing syntax (wiki markup) see Help:Editing on meta.wikimedia.org English
- Another overview of frequently used wiki syntax (wiki markup) can be found in the text examples on meta.wikimedia.org English
- For a more comprehensive list of wiki markup see Help:Wiki_markup on Wikipedia English, German (Deutsch)
- For a complete list of wiki help topics including wiki edits see Help:Contents on MediaWiki and its followup pages. English
Editing conventions
Continuous text
|
Example: Text displays as you type it and wraps around even with a newline embedded. |
Wiki source:
Text displays as you |
Formatting text
|
Example: Highlight 'your' text in italic, bold or bold-italic |
Wiki source: Highlight 'your' text in ''italic'', '''bold''' or '''''bold-italic''''' |
Special formatting
|
Example: Nr. 1 Hit
|
Wiki source:
'''Nr. 1 Hit''' |
The first or the first few character(s) of a line determine, what kind of text the line is.
|
Example: Space as first character
|
Wiki source:
|
Headers
A section starts with a header consisting of a line beginning and ending with two or more consecutive equal signs (=). The number of equal signs indicates the nesting level of sections.
When using several sections a table of contents is created just before the first header. This article as an example has more than five sections and consequently a table of contents. If you want the table of contents to appear in a different place, you may use __TOC__ to define the place where the table of contents is displayed. You may use __NOTOC__ anywhere in the document, if you want the table of contents not to display at all. |
Example: Header 2Header 3Header 4 |
Wiki source:
=== Header 2 === |
Lists
To create a list is pretty simple, just write a star (*) as first character on one or more consecutive line(s). This will display as a bullet list.
If you use number signs (#) instead of stars (*) you create an ordered list. This will display as a list with numbers instead of bullets. You may create nested lists by increasing the number of stars / number signs. Nested lists display as lists with different levels of indentation. When nesting lists you may mix bullet lists and numbered lists on each level. |
Example:
|
Wiki source:
* A list with |
You can create a definition list by using a semicolon (;) as first character of a line, write your definition term, write one colon (:) and finally your definition text. This will display as two lines, first the definition term in bold, second the definition text with indentation.
You may separate definition term and definition text onto two lines for better readability in the wiki source. If you want to do so, use a colon (:) as first character of the second line with the definition text. Although not intended you may use a colon (:) alone without a line for a definition term, which will display as an indentation. Using multiple lines with the colon as first character, you can create a list without any marking. This is allowed to support multiple paragraphs for a definition text. As with other types of lists you may use multiple colons to increase the indentation level. |
Examples:
|
Wiki source:
; Definition term |
Note: Each line marked with one of the above characters (*, #, ; or :) as the first character is one list-item. A newline in wiki-source will end a list-item. If you happen to need a new line displayed within a list-item, you may use <br /> inline in the wiki-source which builds the list-item. |
Example:
at a newline |
Wiki source:
* List-item will end |
Links
Links within the same wiki are pretty simple. Just surround the article-name with double square brackets [[wiki-link]]. You might add a different text for the link by adding a pipe symbol (|) and the text that should appear as the link-text. [[wiki-link | link-text]] If you want a special language version of an wiki-article prefix the article-name with the two-letter language-code and a colon (:). This results in a link like [[DE:wiki-link]] for a german version of a wiki article. |
Example: |
Wiki source:
[[Wiki_Help]] |
If you want a link to a wikipedia-article, then prefix the article-name with "wikipedia:" This will give [[wikipedia:article-name]] as link. This will result in a link to the English Wikipedia as the default Wikipedia. If you need to link to another language Wikipedia note the language code with an appended colon immediate after "wikipedia:" and before the article name. A link to the German Wikipedia thus looks like [[wikipedia:de:article-name]]. |
Example: |
Wiki source:
[[wikipedia:Main Page]] |
External links are quite easy as well. Just type the URL like ''https://help.openstreetmap.org'' and it will display as a clickable link with the URL as link-text. If you want a very short link, surround the URL with single square brackets [external-link] which displays as a numbered link like [7] . This is really short but in most cases not very meaningful. It is better practice to give a hint what this link points to. To do so, surround the URL, a space (“ ”) and the link-text with single square brackets [external-link link-text] which displays as the link-text.
Please note, that (different from wiki-links) a space character(“ ”) separates the link from the link-text. All external links are marked with a symbol which is generated through the used stylesheet. If a target webpage is accessible via HTTP and HTTPS (secure), you could omit the protocol and colon in the link (only if you use the explicit link syntax with “[]”). In the resulting wiki page the link will inherit the protocol from the current wiki page. This is called a protocol-relative link and helps readers to keep their preferred protocol while browsing. |
Example: https://help.openstreetmap.org A short link [1]
|
Wiki source:
https://help.openstreetmap.org |
Tables
A table is a two-dimensional grid consisting of rows and columns which allows to arrange information according to two criteria, one in the rows and one in the columns.
A basic table needs the following parts:
It is good practise and increases readability to use a space as second/third character, thus avoiding any ambiguity. |
Example:
|
Wiki source:
{| align="center"
| ||||
Tables have an important difference to lists. Lists are restricted to one line in the wiki-source. Table cells can have almost everything that you can express with wiki markup. This includes paragraphs, lists, images or other media and even tables in a table cell are possible although not encouraged.
There are a lot of tricky things you might do with tables. If you want further information try Wikipedia's help on tables. English, German (Deutsch) |
Example:
|
Wiki source:
{| border="1" |
Templates
Templates are textual macros. They are articles in a special namespace (Template:) Templates are used to have identical text or text structure within several articles. Templates are expanded and included on the fly when opening an article. (You might suppress this if needed.) Templates are called by surrounding the template name with double curly braces {{template-name}}.
Templates can have parameters. Parameters are separated by pipe symbols {{template-name | parameter}}. Parameters can be positional as in {{template-name | param-1 | | param-3 }} where you need an empty parameter if you want to omit a positional parameter. Parameters can be named, in which case you denote the named parameters as key-value pairs {{template-name | param-X=value-X | param-F = value-F}}. You may use spaces for readability as you like. Parameters can have a default value defined inside the template. This value is used if you do not specify a value for a parameter. There is a wide range how templates are used. Templates can be a simple text-inclusion allowing identical text and formatting over several pages. Templates can create infoboxes and alike with parameters and sophisticated formatting. You might refer to the list of most linked templates in the OSM-wiki to find widely used templates. Templates used within your edit are listed at the bottom of the edit page. You might use the links to see what's that all about. Warning: Creating new or modifying existing templates is not for the beginner. |
Example: Icon-template for:
heavy use in the wiki
|
Wiki source:
Icon-template for: |
See also
- For general information about using this wiki refer to the OSM-page on Wiki Help (no special help for editing/markup). English German (Deutsch)
- For an overview on using the wiki editor see the Wikipedia help page (no special help for markup). English German (Deutsch)