Help:Wiki markup

From Wikipedia, the free encyclopedia
  (Redirected from Wikipedia:MARKUP)
Jump to: navigation, search
Wiki markup
  • Basic markup
  • Text, links, and talk pages
  • Visual files
  • Sound files
  • Tables
  • Template editing
  • Using HTML
  • v
  • t
  • e
Shortcuts:
  • H:MARKUP
  • WP:MARKUP
spacer
A video about wikicode and how to use it.

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

  • 1 Layout
    • 1.1 Sections
      • 1.1.1 Section headings
      • 1.1.2 Table of contents
    • 1.2 Line breaks
    • 1.3 Indent text
    • 1.4 Center text
    • 1.5 Lists
    • 1.6 Retaining newlines and spaces
  • 2 Format
    • 2.1 Text formatting
    • 2.2 Special characters
      • 2.2.1 Egyptian Hieroglyphs
      • 2.2.2 Chess symbols
      • 2.2.3 Diacritical marks
      • 2.2.4 Punctuation
      • 2.2.5 Other punctuation
      • 2.2.6 Commercial symbols
      • 2.2.7 Subscripts and superscripts
      • 2.2.8 Greek characters
      • 2.2.9 Mathematical characters
      • 2.2.10 Mathematical formulae
      • 2.2.11 Spacing in simple math formulae
      • 2.2.12 Complicated formulae
  • 3 Links and URLs
    • 3.1 Free links
      • 3.1.1 Link to another wiki article
      • 3.1.2 Renamed link
      • 3.1.3 Automatically rename links
      • 3.1.4 Blend link
      • 3.1.5 Link to a section of a page
      • 3.1.6 Create page link
    • 3.2 Redirects
    • 3.3 Link to another namespace
    • 3.4 Link to the same article in another language (interlanguage links)
    • 3.5 Interwiki link
    • 3.6 Categories
    • 3.7 External links
    • 3.8 Miscellaneous
      • 3.8.1 "As of" tag
      • 3.8.2 Media link
      • 3.8.3 Links directly into edit mode
      • 3.8.4 Automatic links
        • 3.8.4.1 Book sources
        • 3.8.4.2 RFC number
  • 4 Pronunciation aids
  • 5 Images
  • 6 Tables
  • 7 References and citing sources
  • 8 Templates and transcluding pages
  • 9 Talk and project pages
    • 9.1 Signing comments
    • 9.2 What links here and related changes
    • 9.3 Linking to old revisions of pages, diffs, and specific history pages
    • 9.4 User edits
    • 9.5 Coloring text
    • 9.6 Show deleted or inserted text
  • 10 Limiting formatting / escaping wiki markup
    • 10.1 Nowiki
    • 10.2 Pre
  • 11 Invisible text (comments)
  • 12 Variables
  • 13 HTML

[edit] Layout

[edit] Sections

[edit] Section headings

Further information: Help:Section

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.

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.
'''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:

this is above it...

...and this is below it.

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
without starting a new paragraph.

[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:

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 ...

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.

...And so forth
Until it gets quite out of hand.

──────────────────────────────────────────────────────────────────────────────────────────────────── Then one can use outdent to return to the left margin.

(←) is another short form of outdent, with a back-arrow.

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.

[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

Further information: Help:List
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.
  • Unordered lists 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.
# ''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.
  1. Numbered lists are:
    1. Very organized
    2. Easy to follow
    Previous item continues

A new line marks the end of the list.

  1. New numbering starts with 1.
;Definition lists: Terms and their definitions.
;Hamlet: Also useful for texts of plays.
Definition lists
Terms and their definitions.
Hamlet
Also useful for texts of plays.

[edit] Retaining newlines and spaces

Shortcut:
  • H:POEM

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
  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 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
  A stately pleasure-dome decree:
Where Alph, the sacred river, ran
  Through caverns measureless to man
Down to a sunless sea.

[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 int m2() is nice

Syntax highlighting for source code.

Computer code has colored text and more stringent formatting. For example, to define a function: int m2(), with highlights.

<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 &nbsp; in place of a regular space between the two "words" that need to behave as a single word (never be separated on different lines).

Mr.&nbsp;Smith or 400&nbsp;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      &rarr;</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

Main page: Help:WikiHiero syntax

WikiHiero is a software extension that renders Egyptian hieroglyphs as PNG images using <hiero> tags.

Example:

Markup Renders as
<hiero>P2</hiero>
spacer
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.