Difference between revisions of "Help:Wiki markup"

From Emulation General Wiki
Jump to navigation Jump to search
(Created page with ":''For more detail see the [[wikipedia:Help:Wiki_markup|wikipedia page] The markup language called '''wikitext''', also known as '''wiki markup''' or '''wikicode''', consists...")
 
 
Line 1: Line 1:
:''For more detail see the [[wikipedia:Help:Wiki_markup|wikipedia page]
+
:''For more detail see the [[wikipedia:Help:Wiki_markup|wikipedia page]]
 
The markup language called '''wikitext''', also known as '''wiki markup''' or '''wikicode''', consists of the syntax and keywords used by the [[wikipedia:MediaWiki|MediaWiki]] software to format a page. (Note the lowercase spelling of these terms. To learn how to see this [[wikipedia:hypertext markup|hypertext markup]], and to save an edit, see [[Help:Editing]]. Generally, coding can be copied and pasted, without writing new code. There is a short list of markup and tips at [[Help:Cheatsheet]].
 
The markup language called '''wikitext''', also known as '''wiki markup''' or '''wikicode''', consists of the syntax and keywords used by the [[wikipedia:MediaWiki|MediaWiki]] software to format a page. (Note the lowercase spelling of these terms. To learn how to see this [[wikipedia:hypertext markup|hypertext markup]], and to save an edit, see [[Help:Editing]]. Generally, coding can be copied and pasted, without writing new code. There is a short list of markup and tips at [[Help:Cheatsheet]].
  

Latest revision as of 23:32, 31 March 2024

For more detail see the wikipedia page

The markup language called wikitext, also known as wiki markup or wikicode, consists of the syntax and keywords used by the MediaWiki software to format a page. (Note the lowercase spelling of these terms. To learn how to see this hypertext markup, and to save an edit, see Help:Editing. Generally, coding can be copied and pasted, without writing new code. There is a short list of markup and tips at Help:Cheatsheet.

In addition to wikitext, some HTML elements are also allowed for presentation formatting. See HTML in wikitext for information on this.

Sections[edit]

Article sections in a page will follow that page's lead or introduction and, if there are four or more, the table of contents.

Section headings[edit]

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. See this section for the relevant CSS.
  • 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.

Horizontal rule[edit]

The horizontal rule represents a paragraph-level thematic break. Do not use in article content, as rules are used only after main sections, and this is automatic.

Markup ----
Renders as:


HTML equivalent: <hr /> (which can be indented, whereas ---- always starts at the left margin.)

Line breaks[edit]

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 Enter twice.
    • It's good practice to do this by itself when publishing changes. Leave additional changes to another edit because otherwise only the line break will be highlighted in the diff.
  • Pressing Enter 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.
  • Blank lines within indented wikitext should not be added due to accessibility issues.


A single newline here
has no effect on the layout.
 
But an empty line starts a new paragraph, 
or ends a list or an indented part.

HTML equivalent: <br> or <br /> can be used to break line layout.

Indent text[edit]

Indentation is most commonly used on talk pages.

Markup

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

Renders as:
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 ...

Center text[edit]

See also Span and div HTML tag.

Markup:
<div class="center" style="width: auto; margin-left: auto; margin-right: auto;">Centered text</div>
Renders as:

Centered text

Align text to right[edit]

You can align content in a separate container:

Markup:
<div style="text-align: right; direction: ltr; margin-left: 1em;">Text on the right</div>
Renders as:

Text on the right

Lists[edit]

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[edit]

Markup:

* Item1
* Item2
* Item3
* Item4
** Sub-item 4 a)
*** Sub-item 4 a) 1.
**** Sub-item 4 a) 1. i)
**** Sub-item 4 a) 1. ii)
** Sub-item 4 b)
* Item5

Renders as:

  • Item1
  • Item2
  • Item3
  • Item4
    • Sub-item 4 a)
      • Sub-item 4 a) 1.
        • Sub-item 4 a) 1. i)
        • Sub-item 4 a) 1. ii)
    • Sub-item 4 b)
  • Item5


Ordered lists[edit]

Markup:

# Item1
# Item2
# Item3
# Item4
## Sub-item 1
### Sub-sub-item
#### Sub-sub-sub-item
## Sub-item 2
# Item5

Renders as:

  1. Item1
  2. Item2
  3. Item3
  4. Item4
    1. Sub-item 1
      1. Sub-sub-item
        1. Sub-sub-sub-item
    2. Sub-item 2
  5. Item5


Description lists[edit]

To list terms and definitions, start a new line with a semicolon (;) followed by the term. Then, type a colon (:) followed by a definition. The format can also be used for other purposes, such as make and models of vehicles, etc.

Description lists (formerly definition lists, and a.k.a. association 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 and creates issues with screen readers. Also, use of a colon to indent (other than for talk page responses) may also render invalid HTML5 and cause accessibility issues per MOS:INDENTGAP.

Markup: ; Term : Definition1
Renders as:

Term 
Definition1

Markup: ; Term
: Definition1
: Definition2
: Definition3
: Definition4
Renders as:

Term
Definition1
Definition2
Definition3
Definition4

HTML equivalent: <dl> <dt>...</dt>, <dd>...</dd> </dl>

Format[edit]

Text formatting[edit]

Description What you type What it looks like

italics, bold, small capital letters

To ''italicize text'', put two consecutive apostrophes on each side of it.

Three apostrophes each side will '''bold the text'''.

Five consecutive apostrophes on each side (two for italics plus three for bold) produces '''''bold italics'''''.
'''''Italic and bold formatting''''' works correctly only within a single line.

For text as {{smallcaps|small caps}}, use the template {{tl|smallcaps}}.

To italicize text, put two consecutive apostrophes on each side of it.

Three apostrophes each side will bold the text.

Five consecutive apostrophes on each side (two for italics plus three for bold) produces bold italics.

Italic and bold formatting works correctly only within a single line.

For text as small caps, use the template {{smallcaps}}.

Small text

Use <small>small text</small> only when necessary.

Use small text only when necessary.

a <small> span

To match, for example, the font-size used in an [[Help:Visual file markup#Caption|image caption]], the "small" tag can also be used to <small style="font-size:87%;">reduce a text's font-size to 87%</small>.</code>

To match, for example, the font-size used in an image caption, the "small" tag can also be used to reduce a text's font-size to 87%.

Big text

Better not use <big>big text</big>, unless <small>it's <big>within</big> small</small> text. </code>

Better not use big text, unless it's within small text. }}

Special characters[edit]

See also List of XML and HTML character entity references

Special characters can often be displayed using numeric character references or character entity references. See Character encodings in HTML for more information. For example, &Agrave; and &#xC0; both render À (A-grave). Percent-encoding can't be used, as it works only in URLs.

Diacritical marks[edit]

Diacritic marks, using character entity references.

What you type What it looks like
&Agrave; &Aacute; &Acirc; &Atilde; &Auml; &Aring; &AElig;

&Ccedil; &Egrave; &Eacute; &Ecirc; &Euml;

&Igrave; &Iacute; &Icirc; &Iuml; &Ntilde;

&Ograve; &Oacute; &Ocirc; &Otilde; &Ouml; &Oslash; &OElig;

&Ugrave; &Uacute; &Ucirc; &Uuml; &Yuml; &szlig;

&agrave; &aacute; &acirc; &atilde; &auml; &aring; &aelig; &ccedil;

&egrave; &eacute; &ecirc; &euml;

&igrave; &iacute; &icirc; &iuml; &ntilde;

&ograve; &oacute; &ocirc; &otilde; &ouml; &oslash; &oelig;

&ugrave; &uacute; &ucirc; &uuml; &yuml;

À Á Â Ã Ä Å Æ

Ç È É Ê Ë

Ì Í Î Ï Ñ

Ò Ó Ô Õ Ö Ø Œ

Ù Ú Û Ü Ÿ ß

à á â ã ä å æ ç

è é ê ë

ì í î ï ñ

ò ó ô õ ö ø œ

ù ú û ü ÿ

Punctuation special characters[edit]

Using character entity references.

What you type What it looks like
&iquest; &iexcl; &sect; &para; ¿ ¡ § ¶
&dagger; &Dagger; &bull; &ndash; &mdash; † ‡ • – —
&lsaquo; &rsaquo; &laquo; &raquo; ‹ › « »
&lsquo; &rsquo; &ldquo; &rdquo; ‘ ’ “ ”
&apos; &quot; ' "

Commercial symbols[edit]

Using character entity references.

What you type What it looks like
&trade; &copy; &reg; ™ © ®
&cent; &euro; &yen; &pound; &curren; ¢ € ¥ £ ¤

Greek characters[edit]

Using character entity references.

What you type What it looks like
&alpha; &beta; &gamma; &delta; &epsilon; &zeta; α β γ δ ε ζ
&Alpha; &Beta; &Gamma; &Delta; &Epsilon; &Zeta; Α Β Γ Δ Ε Ζ
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu; η θ ι κ λ μ ν
&Eta; &Theta; &Iota; &Kappa; &Lambda; &Mu; &Nu; Η Θ Ι Κ Λ Μ Ν
&xi; &omicron; &pi; &rho; &sigma; &sigmaf; ξ ο π ρ σ ς
&Xi; &Omicron; &Pi; &Rho; &Sigma; Ξ Ο Π Ρ Σ
&tau; &upsilon; &phi; &chi; &psi; &omega; τ υ φ χ ψ ω
&Tau; &Upsilon; &Phi; &Chi; &Psi; &Omega; Τ Υ Φ Χ Ψ Ω

Subscripts and superscripts[edit]

  • The Manual of Style prefers the <sub> and <sup> formats, for example x<sub>1</sub>. So this should be used under most circumstances.
  • The latter methods of sub/superscripting cannot be used in the most general context, as they rely on Unicode support that may not be present on all users' machines.
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₉ </code>

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⁹ </code>

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² </code>

ε0 = 8.85 × 10−12 C² / J m

1 hectare = 1 E+4 m²

This page uses Creative Commons Licensed content from Wikipedia (view authors).