Wiki markup
The contents of this page were copied from Wikipedia Help:Wiki markup. Any embedded internal links are for the Wikipedia site. These will be corrected eventually.
Wiki markup is the syntax and keywords used by the MediaWiki software to format a page.
Layout
Sections
Section headings
The =
through ======
markup are headings for the sections with which they are associated.
- A single = is styled as the article title and should not be used within an article.
- Headings are styled through CSS and add an
[edit]
link. - Four or more headings cause a table of contents to be generated automatically.
- Do not use any markup after the final heading markup – this will either break the heading, or will cause the heading to not be included in an edit summary.
Markup And so on.
Wiki headings translate to HTML, styled as follows by default:
Templates: Tl for use in documentation
Horizontal rule
The horizontal rule represents a paragraph-level thematic break. Do not use in article content.
HTML: Tag
Table of contents
When a page has at least four headings, a table of contents (TOC) will automatically appear after the lead and before the first heading. The TOC can be controlled by magic words or templates:
__FORCETOC__
forces the TOC to appear at the normal location regardless of the number of headings.__TOC__
forces the TOC to appear at the point where the magic word is inserted instead of the normal location.__NOTOC__
disables the TOC entirely.- Tl can be used to control the depth of subsections included in the TOC. This is useful where the TOC is long and unwieldy.
- Category:Wikipedia table of contents templates contains a number of specialized TOC templates.
Line breaks
Line breaks or newlines are used to add whitespace between lines, such as separating paragraphs.
- A line break that is visible in the content is inserted by pressing Key press twice.
- Pressing Key press once will place a line break in the markup, but it will not show in the rendered content, except when using list markup.
- Markup such as bold or italics will be terminated at a line break.
|A single newline has no effect on the layout. But an empty line starts a new paragraph, or ends a list or an indented part. |Crlf2 A single newline has no effect on the layout.
But an empty line starts a new paragraph, or ends a list or an indented part.
Indent text
Indentation is most commonly used on talk pages.
|Indentation as used on talk pages:
:Each colon at the start of a line
::causes the line to be indented by three more character positions.
:::(The indentation persists
so long as no carriage return or line break is used.)
:::Repeat the indentation at any line break.
::::Use an extra colon for each response.
:::::And so forth ...
::::::And so on ...
|Indentation as used on talk pages:
- Each colon at the start of a line
- causes the line to be indented by three more character positions.
- (The indentation persists
- causes the line to be indented by three more character positions.
so long as no carriage return or line break is used.)
- Repeat the indentation at any line break.
- Use an extra colon for each response.
- And so forth ...
- And so on ...
- And so forth ...
- Use an extra colon for each response.
- Repeat the indentation at any line break.
Blockquote
When there is a need for separating a block of text. This is useful for (as the name says) inserting blocks of quoted (and cited) text.
|<blockquote> The '''blockquote''' tag will indent both margins when needed instead of the left margin only as the colon does. </blockquote>
|
The blockquote tag will indent both margins when needed instead of the left margin only as the colon does.
Center text
|<div class="center" style="width: auto; margin-left: auto; margin-right: auto;">Centered text</div>
|2=
Also see Wikipedia Help:Table#Centering tables.
Align text to right
|<div style="text-align: right; direction: ltr; margin-left: 1em;">Text on the right</div>
|2=
Lists
Do not leave blank lines between items in a list unless there is a reason to do so, since this causes the MediaWiki software to interpret each item as beginning a new list.
Unordered lists
AnchorDefinition lists
To list terms and definitions, start a new line with a semicolon (;) followed by the term. Then, type a colon (:) followed by a definition.
Definition lists consist of group names corresponding to values. Group names (terms) are in bold. Values (definitions) are indented. Each group must include one or more definitions. For a single or first value, the :
can be placed on the same line after ;
– but subsequent values must be placed on separate lines.
Do not use a semicolon (;) simply to bold a line without defining a value using a colon (:). This usage renders invalid HTML5.
Retaining newlines and spaces
The MediaWiki software suppresses single newlines and converts lines starting with a space to preformatted text in a dashed box. HTML suppresses multiple spaces. It is often desirable to retain these elements for poems, lyrics, mottoes, oaths and the like. The Poem extension adds HTML-like Tag tags to maintain newlines and spaces. These tags may be used inside other tags such as Tag. CSS styles may be applied to this tag, e.g.: <poem style="margin-left: 2em;">
.
Format
Text formatting
Description | What you type | What it looks like |
---|---|---|
Italics, bold, Smallcaps. |
To ''italicize text'', just put 2 apostrophes on each side. 3 apostrophes will '''bold the text''' 5 apostrophes for '''''bold italics''''' '''''Italic and bold formatting''''' only works properly within a single line. For text as {{Smallcaps|small caps}}, that uses a [[Help:Template|template]]. |
To italicize text, just put 2 apostrophes on each side. 3 apostrophes will bold the text 5 apostrophes for bold italics Italic and bold formatting only works properly within a single line. |
Small chunks of source code within a line of normal text. Code is displayed in a monospace font. |
function <code>int m2()</code> is nice |
function |
Syntax highlighting for source code. Computer code has colored text and more stringent formatting.
For example, to define a function: |
<syntaxhighlight lang="cpp"> #include <iostream> int m2 (int ax, char *p_ax) { std::cout <<"Hello World!"; return 0; }</syntaxhighlight> |
#include <iostream>
int m2 (int ax, char *p_ax) {
std::cout <<"Hello World!";
return 0;
} |
Small text. |
Use <small>small text</small> if needed. A span tag can set text font-size as being <span style="font-size: 87%">87% of prior size</span>, to match an image caption. |
Use small text if needed. A span tag can set text font-size as being 87% of prior size, to match an image caption. |
Big text. |
Better not use <big>big text</big>, unless <small> it's <big>within</big> small</small> text. |
Better not use big text, unless it's within small text. |
You can include a non-breaking space (sometimes called non-printing character) where you require two words to always appear together on the same line, such as Mr. Smith or 400 km/h, using |
Mr. Smith or 400 km/h. |
Mr. Smith or 400 km/h. |
Extra spacing within text can best be achieved using the pad template. |
Mary {{pad|4em}} had a little lamb. |
Mary Pad had a little lamb. |
Typewriter font. (Also works beyond the end of a paragraph.) |
<tt>arrow →</tt> <tt>''italics'', '''bold'''</tt> <tt>[[link]] New paragraph </tt>started here. |
arrow → italics, bold New paragraph started here. |
Special characters
Egyptian hieroglyphs
Go to Wikipedia at main|Help:WikiHiero syntax
WikiHiero is a software extension that renders Egyptian hieroglyphs as PNG images using Xtag tags.
Example: Markup
Chess symbols
Go to Wikipedia at main|Chess symbols in Unicode
Diacritical marks
- See Help:Special characters.
What you type | What it looks like |
---|---|
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ñ Ò Ó Ô Õ Ö Ø Œ Ù Ú Û Ü Ÿ ß à á â ã ä å æ ç è é ê ë ì í î ï ñ ò ó ô õ ö ø œ ù ú û ü ÿ |
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ñ Ò Ó Ô Õ Ö Ø Œ Ù Ú Û Ü Ÿ ß à á â ã ä å æ ç è é ê ë ì í î ï ñ ò ó ô õ ö ø œ ù ú û ü ÿ |
Punctuation, special characters
What you type | What it looks like |
---|---|
¿ ¡ § ¶ † ‡ • – — ‹ › « » ‘ ’ “ ” ' " |
¿ ¡ § ¶ † ‡ • – — ‹ › « » ‘ ’ “ ” ' " |
Other punctuation, escaping special characters
The [[#Pre|Tag]] and [[#Nowiki|Tag]] markup tags are also available. (For writing "[", "{", "&", "}", "]", for example.)
Commercial symbols
What you type | What it looks like |
---|---|
™ © ® ¢ € ¥ £ ¤ |
™ © ® ¢ € ¥ £ ¤ |
Subscripts and superscripts
- See Help:Scripts
- The Wikipedia:Manual of Style (mathematics)#Superscripts and subscripts|Manual of Style prefers the x<sub>1</sub> format.
- The latter methods of sub/superscripting cannot be used in the most general context, as they rely on Unicode support which may not be present on all users' machines. For the 1, 2, 3 superscripts, it is nevertheless preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.
Description | What you type | What it looks like |
---|---|---|
Subscripts |
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub> or x₀ x₁ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ |
x1 x2 x3 or x₀ x₁ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ |
Superscripts |
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup> or x⁰ x¹ x² x³ x⁴ x⁵ x⁶ x⁷ x⁸ x⁹ |
x1 x2 x3 or x⁰ x¹ x² x³ x⁴ x⁵ x⁶ x⁷ x⁸ x⁹ |
Combined |
ε<sub>0</sub> = 8.85 × 10<sup>−12</sup> C² / J m 1 [[hectare]] = [[1 E+4 m²]] |
ε0 = 8.85 × 10−12 C² / J m |
Greek characters
What you type | What it looks like |
---|---|
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω |
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω |