Difference between revisions of "Help:Wiki markup"
Line 1: | Line 1: | ||
{{Wiki markup}} | {{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 | + | '''Wiki markup''' is the syntax and keywords used by the MediaWiki software to format a page. |
{{TOC limit}} | {{TOC limit}} | ||
Line 16: | Line 16: | ||
The <code>=</code> through <code>======</code> markup are headings for the sections with which they are associated. | The <code>=</code> through <code>======</code> 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. | * A single = is styled as the article title and should not be used within an article. | ||
− | * Headings are styled through | + | * Headings are styled through CSS and add an <code>[edit]</code> link. |
* Four or more headings cause a table of contents to be generated automatically. | * Four or more headings cause a table of contents to be generated automatically. | ||
* Do not use <em>any</em> 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. | * Do not use <em>any</em> 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. | ||
Line 30: | Line 30: | ||
And so on. | And so on. | ||
− | Wiki headings translate to | + | Wiki headings translate to HTML, styled as follows by default: |
− | |||
− | |||
Templates: {{tl|fake heading}} for use in documentation | Templates: {{tl|fake heading}} for use in documentation | ||
==== Horizontal rule ==== | ==== Horizontal rule ==== | ||
− | |||
The horizontal rule represents a paragraph-level thematic break. Do not use in article content. | The horizontal rule represents a paragraph-level thematic break. Do not use in article content. | ||
Line 50: | Line 47: | ||
==== Table of contents ==== | ==== 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: | 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: | ||
Line 57: | Line 54: | ||
* <code><nowiki>__NOTOC__</nowiki></code> disables the TOC entirely. | * <code><nowiki>__NOTOC__</nowiki></code> disables the TOC entirely. | ||
* {{tl|TOC limit}} can be used to control the depth of subsections included in the TOC. This is useful where the TOC is long and unwieldy. | * {{tl|TOC limit}} 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 === | ||
− | |||
Line breaks or newlines are used to add whitespace between lines, such as separating paragraphs. | Line breaks or newlines are used to add whitespace between lines, such as separating paragraphs. | ||
Line 93: | Line 89: | ||
=== Indent text === | === Indent text === | ||
− | + | ||
Indentation is most commonly used on talk pages. | Indentation is most commonly used on talk pages. | ||
Line 118: | Line 114: | ||
}} | }} | ||
− | |||
=== Blockquote === | === Blockquote === | ||
Line 140: | Line 135: | ||
}} | }} | ||
− | Template {{tl|center}} uses the same markup. To center a table, see | + | Template {{tl|center}} uses the same markup. To center a table, see Wikipedia Help:Table#Centering tables. |
===Align text to right=== | ===Align text to right=== | ||
Line 150: | Line 145: | ||
=== Lists === | === 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. | 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. | ||
Line 204: | Line 199: | ||
==== {{Anchor|DL}}Definition lists ==== | ==== {{Anchor|DL}}Definition 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. | To list terms and definitions, start a new line with a semicolon (;) followed by the term. Then, type a colon (:) followed by a definition. | ||
Line 210: | Line 204: | ||
Definition lists consist of group names corresponding to values. Group names (terms) are in bold. Values (definitions) are indented. Each group <em>must</em> include one or more definitions. For a single or first value, the <code>:</code> can be placed on the same line after <code>;</code> – but subsequent values must be placed on separate lines. | Definition lists consist of group names corresponding to values. Group names (terms) are in bold. Values (definitions) are indented. Each group <em>must</em> include one or more definitions. For a single or first value, the <code>:</code> can be placed on the same line after <code>;</code> – 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. | |
{{markup | {{markup | ||
Line 231: | Line 225: | ||
HTML: {{tag|dl|o}} {{tag|dt}}, {{tag|dd}} {{tag|dl|c}} | HTML: {{tag|dl|o}} {{tag|dt}}, {{tag|dd}} {{tag|dl|c}} | ||
− | |||
=== Retaining newlines and spaces === | === 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 [[mw:Extension:Poem|Poem]] extension adds HTML-like {{tag|poem}} tags to maintain newlines and spaces. These tags may be used inside other tags such as {{tag|blockquote}}. [[H:CSS|CSS styles]] may be applied to this tag, e.g.: <code><nowiki><poem style="margin-left: 2em;"></nowiki></code>. | 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 [[mw:Extension:Poem|Poem]] extension adds HTML-like {{tag|poem}} tags to maintain newlines and spaces. These tags may be used inside other tags such as {{tag|blockquote}}. [[H:CSS|CSS styles]] may be applied to this tag, e.g.: <code><nowiki><poem style="margin-left: 2em;"></nowiki></code>. | ||
Line 412: | Line 405: | ||
==== Egyptian hieroglyphs ==== | ==== Egyptian hieroglyphs ==== | ||
− | + | Go to Wikipedia at main|Help:WikiHiero syntax | |
− | WikiHiero is a software extension that renders | + | WikiHiero is a software extension that renders Egyptian hieroglyphs as PNG images using {{xtag|hiero}} tags. |
Example: | Example: | ||
Line 423: | Line 416: | ||
==== Chess symbols ==== | ==== Chess symbols ==== | ||
− | + | Go to Wikipedia at main|Chess symbols in Unicode | |
==== Diacritical marks ==== | ==== Diacritical marks ==== | ||
− | * See | + | * See Help:Special characters. |
{| class="wikitable" | {| class="wikitable" | ||
Line 530: | Line 523: | ||
==== Subscripts and superscripts ==== | ==== Subscripts and superscripts ==== | ||
+ | * See Help:Scripts | ||
− | * The | + | * The Wikipedia:Manual of Style (mathematics)#Superscripts and subscripts|Manual of Style prefers the <em><nowiki>x<sub>1</sub></nowiki></em> 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. | * 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. | ||
Revision as of 13:10, 13 September 2013
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.
Templates:
- Tl adds multiple line breaks.
- Tl adds a true carriage return and line feed.
- Tl adds a break with styling to clear floating elements.
- Tl creates an unbulleted list.
Indent text
Indentation is most commonly used on talk pages.
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. Markup
Center text
Template Tl uses the same markup. To center a table, see Wikipedia Help:Table#Centering tables.
Align text to right
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
Ordered 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 |
---|---|
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω |
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω |