Help:Wiki markup
Wiki markup |
---|
|
|
Shortcuts:
|
---|
Wiki markup is the syntax and keywords used by the MediaWiki software to format a page. To learn how to see this markup and to save an edit, see: Help:Editing.
Contents
|
[edit] Layout
[edit] Sections
[edit] Section headings
Use headings to split articles into sections. Put a heading on a separate line. A level-two heading ("==
") is the highest level editors use in an article.
What you type | What it looks like |
---|---|
==Section headings== ''Headings'' organize your writing into sections. The wiki software can automatically generate a [[Help:Section|table of contents]] from them. Start with 2 'equals' ("==") characters. ===Subsection=== Using more 'equals' characters creates a subsection. ====A smaller subsection==== Don't skip levels, like from two ("==") to four ("====") 'equals' characters. ;A defined term: A semicolon at the start of a line is a way of making a definition where the word being defined appears in bold. The definition itself follows the colon and is not rendered bold by default. It is not a heading and does not appear in the table of contents. |
Section headings
Headings organize your writing into sections. The wiki software can automatically generate a table of contents from them. Start with 2 'equals' ("==") characters. Subsection
Using more 'equals' characters creates a subsection. A smaller subsection
Don't skip levels, like from two ("==") to four ("====") 'equals' characters.
|
'''Horizontal line''' Separating with a horizontal dividing line: :this is above it... ---- :...and this is below it. If you don't use a section header, you don't get a TOC entry. |
Horizontal line Separating with a horizontal dividing line:
If you don't use a section header, you don't get a TOC entry. |
[edit] Table of contents
When a page has at least four headings, a table of contents (TOC) will appear in front of the first header (after the lead). Putting __TOC__ anywhere forces the TOC to appear at that point (instead of just before the first heading). Putting __NOTOC__ anywhere forces the TOC to disappear. See also Compact TOC for alphabet and year headings.
[edit] Line breaks
- You can make the wikitext more readable by putting in newlines, but see Wikipedia:Don't use line breaks for possible problems.
- To break lines use the
<br />
element. The HTML tag<br>
will be converted to the XHTML<br />
tag by HTML Tidy in most instances. The<br>
tag is not converted when used in editnotices or in the MediaWiki namespace — it will render invalid XHTML and will break tools such as Twinkle. - Please use these sparingly.
- Close markup between lines; do not start a link or italics or bold on one line and close it on the next.
- When used in a list, a newline does affect the layout (see Help:List).
What you type | What it looks like |
---|---|
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. |
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. |
You can break lines<br /> without starting a new paragraph. |
You can break lines |
[edit] Indent text
- Indentation is most commonly used on Talk pages, see here for conventions.
- To shift the stream back to the left, use outdent or outdent2.
- There are also short forms of outdent, od and od2
What you type | What it looks like |
---|---|
Left indent |
|
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:
so long as no carriage return or line break is used.)
|
Left outdent |
|
:::::::::::...And so forth :::::::::::::Until it gets quite out of hand. {{Outdent|:::::::::::::}} Then one can use ''outdent'' to return to the left margin. {{od2}} is another short form of outdent, with a back-arrow. |
Then one can use outdent to return to the left margin. (←) is another short form of outdent, with a back-arrow. |
Blockquote
|
|
|
|
[edit] Center text
What you type | What it looks like |
---|---|
<div style="auto; margin-left:auto; margin-right:auto;">Centered text</div> |
Centered text
|
Template {{center}} uses the same markup. To center a table, see Help:Table#Centering tables.
[edit] Lists
What you type | What it looks like |
---|---|
* ''Unordered [[Help:List|list]]s'' are easy to do: ** Start every line with a star. *** More stars indicate a deeper level. **: Previous item continues. ** A new line * in a list marks the end of the list. * Of course you can start again. |
marks the end of the list.
|
# ''Numbered lists'' are: ## Very organized ## Easy to follow #: Previous item continues A new line marks the end of the list. # New numbering starts with 1. |
A new line marks the end of the list.
|
;Definition lists: Terms and their definitions. ;Hamlet: Also useful for texts of plays. |
|
[edit] Retaining newlines and spaces
Shortcut:
|
---|
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 <poem>...</poem>
tags to maintain newlines and spaces. These tags may be used inside other tags such as <blockquote>...</blockquote>
. CSS styles may be applied to this tag, e.g.: <poem style="margin-left:2em;">
.
What you type | What it looks like |
---|---|
<poem> In Xanadu did Kubla Khan A stately pleasure-dome decree: Where Alph, the sacred river, ran Through caverns measureless to man Down to a sunless sea. So twice five miles of fertile ground With walls and towers were girdled round: And there were gardens bright with sinuous rills, Where blossomed many an incense-bearing tree; And here were forests ancient as the hills, Enfolding sunny spots of greenery. </poem> |
In Xanadu did Kubla Khan |
<poem style="font-family:Georgia, serif; %; background-color: #F5F6CE; margin-left:0.3em;"> In Xanadu did Kubla Khan A stately pleasure-dome decree: Where Alph, the sacred river, ran Through caverns measureless to man Down to a sunless sea. </poem> |
In Xanadu did Kubla Khan |
[edit] Format
[edit] Text formatting
Description | What you type | What it looks like |
---|---|---|
Italics, bold, small capital letters. |
To ''italicize text'', just put 2 apostrophes on each side. 3 apostrophes will '''bold the text''' 5 apostrophes for '''''bold italics''''' 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 For text as small caps, that uses a template. |
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="%">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 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 link New paragraph started here. |
[edit] Special characters
[edit] Egyptian Hieroglyphs
WikiHiero is a software extension that renders Egyptian hieroglyphs as PNG images using <hiero>
tags.
Example:
Markup | Renders as |
||
---|---|---|---|
<hiero>P2</hiero> |
|
||