Help:Advanced editing - MediaWiki
Jump to content
From mediawiki.org
Translate this page
Languages:
català
polski
português do Brasil
čeština
中文
Note:
When you edit this page, you agree to release your contribution under the
CC0
. See
Public Domain Help Pages
for more info.
Please help
expand
this page.
The reason given is:
a section either here or in
Transclusion
detailing tags would be useful, explainining how to use e.g. #syntaxhighlight or #nowiki in templates.
More information might be found on the
talk page
Wikitext
markup guide – crafting your page's appearance
edit
See also:
Help:Formatting
and
Help:Categories
Help:Editing
covers the basics.
You can experiment using the
Sandbox
Details on
wikitext's HTML tags
Use the following Wikitext markup to tailor the appearance of your page.
Arranging your words – lines, lists, paragraphs, and sections
edit
Rendering
Wikitext
Drafting sections and subsections
edit
Begin a section with a header line
Note:
The top-level heading like the page title is indicated by a single equal (
) sign.
A section
A sub-section
Another sub-subsection
Avoid using first-level headings (
); rather, begin with a second-level heading (
==
).
Avoid jumping levels; for example, don't go from second to fourth level.
If an article has four or more parts, a
table of contents
will be generated automatically.
Sort the subsections in an appropriate order. When listing countries, for instance, sort them alphabetically as opposed to, say, according to their respective populations inside the
OECD
or in any other
haphazardous
order.
Use HTML heading tags and close headings without slashes, if you wish to keep them out of the TOC. For example:
h4
Subsection with heading too low level to be in the TOC
h4
== A section ==
=== A sub-section ===
==== Another sub-subsection ====
Newline
edit
Adding a new line has no effect.
This is a line.
This is still part of the same paragraph.
An empty line starts a new paragraph or ends a list or indented part. The
<
tag can disable a paragraph until
or the end of the section.
This is a paragraph.
This is a continuation of the paragraph.
But it appears after an empty line due to the
<
and
tags.
This is a line.
This is another line appearing as a second new paragraph instead of a third paragraph due to the
<
div
and
div
tags.
In a list, a newline is used to separate individual items and subitems, enhancing the visual structure and readability of the list content in MediaWiki syntax. See
List
for examples.
This is a line.
This is still part of the same paragraph.
This is a paragraph.
This is a continuation of the paragraph. But it appears after an empty line due to the
<
p> and
<
/p> tags.
This is a line.
div
This is another line appearing as a second new paragraph instead of a third paragraph due to the
<
div> and
<
/div> tags.
div
Lines can be broken
without beginning another paragraph.
Kindly don't overuse this.
Don't begin a
link
italics
or
bold
on one line and end it on the next; instead, close markup per line.
Lines can be broken
br
/>
without beginning another paragraph.
Unordered lists
edit
Start a line with asterisks (
) to create the first item in an unordered list.
Use two asterisks for a sub-item.
Increase the number of asterisks for deeper levels.
Each line break signifies a new item in the list.
A line starting without a star marks the end of the list.
You can start over with a new list
Now you are ready to create well-structured unordered lists.
Start a line with asterisks (
code
code
) to create the first item in an unordered list.
**
Use two asterisks for a sub-item.
***
Increase the number of asterisks for deeper levels.
Each line break signifies a new item in the list.
A line starting without a star marks the end of the list.
You can start over with a new list
Now you are ready to create well-structured unordered lists.
Ordered lists
edit
Use a hashtag (
) at the beginning of each line to signify the order.
Use two hashtags (
##
) for a sub-item.
Continue numbering to maintain the sequence and logical flow of information.
Add a new line between each item for improved readability.
A line starting without a hashtag marks the end of the list.
An ordered list starts with 1.
Then 2, etc.
Use a hashtag (
code
code
) at the beginning of each line to signify the order.
##
Use two hashtags (
code
##
code
) for a sub-item.
##
Continue numbering to maintain the sequence and logical flow of information.
Add a new line between each item for improved readability.
A line starting without a hashtag marks the end of the list.
An ordered list starts with 1.
Then 2, etc.
Mixed lists
edit
This mixed list begins with an unordered list (
).
To create a subitem of an ordered list under an unordered list use an asterisk and a hashtag (
*#
).
To create a deeper sub-item of an unordered list within an ordered list, add another asterisk (
*#*
).
You can also break
lines in a list.
This mixed list begins with an unordered list (
code
code
).
*#
To create a subitem of an ordered list under an unordered list use an asterisk and a hashtag (
code
*#
code
).
*#*
To create a deeper sub-item of an unordered list within an ordered list, add another asterisk (
code
*#*
code
).
*#*
You can also break
br
/>
lines in a list.
Definition lists
edit
A definition list consists of a series of term-definition pairs.
Use a semicolon (
) to indicate the start of a term.
Place the term immediately after the semicolon.
Use a colon (
) to introduce the definition associated with the term.
Place the definition on the line following the colon.
Wiki
A wiki (/ˈwɪki/ ⓘ WI-kee) is a form of online hypertext publication that is collaboratively edited and managed by its own audience directly through a web browser. See
w:Wiki
Web Browser
A web browser is an application for accessing websites. See
w:Web browser
Signifying one item per line is most suitable, rather than adding a new line before the colon (
).
; Wiki
: A wiki (/ˈwɪki/ ⓘ WI-kee) is a form of online hypertext publication that is collaboratively edited and managed by its own audience directly through a web browser. See [[
w:Wiki
]].
; Web Browser
: A web browser is an application for accessing websites. See [[
w:Web browser
]]
Indentation
edit
A paragraph is indented when a colon (
) is specified at the beginning of a line, as explained in
Definition Lists
An indented line.
A new line starts a new non-indented paragraph.
This is frequently utilized for discussing on
talk pages
This is often used as a workaround for indenting the line, but it will harm accessibility and produce invalid HTML output. Using CSS for visual indentation is a far more preferable approach (e.g. {{
Indent
}}).
An indented line.
A new line starts a new non-indented paragraph.
A blockquote
edit
A blockquote style is used to highlight a specific section of text from an external source or to distinguish it from the surrounding content.
This is a blockquote. It is used to highlight quoted text or separate specific content.
blockquote
This is a blockquote. It is used to highlight quoted text or separate specific content.
blockquote
Horizontal dividing line
edit
The horizontal dividing line on a wiki page is represented by four or more consecutive hyphens (
----
), enhancing visual organization between sections.
Text above dividing line
Text below dividing line
Text above dividing line
----
Text below dividing line
Links
edit
For more details, see
Help:Links
General information:
Place double square brackets around the
target name
[[
and
]]
On a new page, the target name's first letter is automatically capitalized after clicking on it.
Underscores are used to represent spaces. Avoid using underscores.
When you hover over a link, it shows a preview of the linked page without you needing to click on it.
Rendering
Wikitext
Basics
edit
You are reading the
documentation
You are reading the
[[
documentation
]]
Basics +
Text formatting
edit
Links can be
italicized
e.g.:
MediaWiki
''
[[
MediaWiki
]]
''
Interwiki links
edit
These link to another wiki that covers related or similar topics.
This interwiki link points to
w:Documentation
on Wikipedia.
Its Esperanto word equivalent is
eo:Dokumentaro
This interwiki link points to
[[
Documentation
]]
on Wikipedia.
Its Esperanto word equivalent is
[[
:eo
Dokumentaro
]]
Links to sections
edit
You can link to a specific section of an existing page by adding a pound (
) and section title after specifying the page name.
Help:Special pages#Editing Special namespace pages
If no such section exists then the link points to the beginning of the page.
If a page has multiple sections with the same name, specifying the rank of the section with a number at the end.
(e.g., if there are three sections titled "Section title" and you want to link to the third, use [[#Section title 3]]).
See
Help:Editing FAQ
[[
Help
Special pages
Editing Special namespace pages
Help:Special pages
]]
Piped links
edit
Create a
link label
using a pipe symbol (
):
About links
The above produces
About links
, linked to the article
Help:Link
[[
Help
Link
About links
]]
Blank link label
edit
Using a
blank link label
will automatically fill in an appropriate link label. I.e.
[[
Kingdom (biology)
|]]
will be replaced with
[[
Kingdom (biology)
Kingdom
]]
Parentheses:
kingdom
Colon:
Pipe
Parentheses:
[[
kingdom (biology)
|]]
Colon:
[[
Help
Pipe
|]]
Links to pages that don't exist
edit
A link to a page which does not exist (like
this one
) is colored in red.
To create the page, you can click on the link. See
Help:Starting a new page
(and the naming conventions of your project, if there are).
A link to a page which does not exist (like
[[
Foo
this one
]]
) is colored in red.
Redirects
edit
You can create a redirect by adding the wikitext at the beginning of the page. See
Help:Redirects
#REDIRECT
[[
United States of America
]]
REDIRECT [[
United States of America
]]
Magic links
edit
Magic links
enable users to generate links automatically by typing specific keywords.
ISBN
book links:
ISBN 0131103629
(see
Help:Magic links
Request for Comments
links:
RFC 234
(see
rfcurl
ISBN 0131103629
RFC 234
These are deprecated and generally should not be used.
* ISBN 0131103629
* RFC 234
Media:
links
edit
Media links are used to reference a page containing media files.
They are accessed through the
Media
namespace.
Audio
[[
media
Test.ogg
Audio
]]
Category links
edit
Category links direct users to a specific category page (without categorizing the page into that category).
To achieve this, a syntax similar to that of links is used, but with a colon (
) added before the namespace.
Category:Documentation
[[:Category:Documentation]]
Special pages
edit
Special pages are created by the wiki software.
They are accessed through the
Special
namespace.
You can create links to special pages like "What links here" using the following format:
Special:Whatlinkshere/Help:Editing
See
Help:Special pages
for other special pages.
[[Special:Whatlinkshere/Help:Editing]]
Links to previous revisions of a page, differences (diffs), and particular history pages
edit
To link to an old revision, diff, or particular history pages, avoid using the standard wiki-link syntax like
[[
page
]]
Instead, utilize the external link function or copy and paste the provided URLs directly.
Linking to previous revisions of a page
edit
To share an old page version of a wiki, copy the URL from the page's history and paste it where you want to share it.
You can also use
Special:PermaLink
to do this, i.e
Special:PermaLink/6364084
Linking to diffs:
edit
To link to page differences between two revisions, copy and paste the specific URL of the page containing the diff of the compared pages.
You can also use
Special:Diff
to do this, i.e
Special:Diff/6364333/6364084
Linking to a specific page from edit history
edit
Navigate to the edit history and select the
older XX
or
oldest
buttons to reach a particular page history, then copy the URL and paste it where you want to share it.
External links
edit
External links do not open in a new browser window/tab in MediaWiki's default configuration.
Google
[1]
[http://www.google.com Google],
[http://www.google.com]
Example of an email
[2]
[mailto:email@example.com Example of an email],
[mailto:email@example.com]
Or just provide
as the URL.
Every symbol in the
UTF-8
code. For example:
%5e
(LATIN SMALL LETTER A WITH MACRON) →
%c4%81
You can also turn a blank space into an underscore.
Or just provide
as the URL.
Formatting texts – customizing the way it looks
edit
Rendering
Wikitext
Emphasize
(italics),
strongly
(bold),
very strongly
(bold italics).
(These are double and triple apostrophes, not double quotes.)
Note: this can also be applied to links (e.g.,
Wikipedia
).
''Emphasize''
'''strongly'''
''
'''very strongly'''
''
''
[[
Wikipedia
]]
''
The use of
italic
and
bold
fonts is beneficial in mathematical calculations where specific font styles are needed instead of emphasis.
(Most people disregard the fact that these two approaches differ in a way that is not particularly significant for graphical browsers.)
However, it can have a significant impact on those who are blind.
The use of
italic
and
bold
fonts is beneficial in mathematical calculations where specific font styles are needed instead of emphasis.
><
You can write
in small caps
You can write
span
style
"font-variant:small-caps"
in small caps
span
The typewriter font that is occasionally used for
technical terms
and
computer code
The typewriter font that is occasionally used for
kbd
technical terms
kbd
and
code
computer code
code
For captions, you can use
small text
For captions, you can use
small
small text
small
Deleted material can be
struck out
and new material can be
underlined
You can also denote
deleted material
and
inserted material
with the respective tags, preserving their semantic meaning, rather than relying solely on visual cues like strikethrough and underline.
Editing regular articles can be done directly without using special markup to indicate deletions or insertions.
Markup can be used to indicate deleted or inserted material when revising previous remarks on talk pages.
Deleted material can be
struck out
and new material can be
underlined
You can also denote
del
deleted material
del
and
ins
inserted material
ins
with the respective tags, preserving their semantic meaning, rather than relying solely on visual cues like strikethrough and underline.
Subscript: m
Superscript: m
or m²
Many browsers find it simpler to format lines containing the HTML entity ² (²) rather than using the
HTML tag for representing superscripted text.
8.85 × 10
−12
C² / J m.
hectare
1 E4 m²
Subscript: m
Superscript: m
or m
²
ε
8.85
×
10
−
12
²
/ J m.
1 [[
hectare
]] = [[
1 E4 m²
]]
Reformatting and/or disabling wikitext interpretation
edit
The following provides methods for managing formatting and processing. Please refer to
Template:Tc
for the code
{{tc}}
used in the examples (see
Help:Templates
).
Default interpretation
edit
Interpret
HTML entities
Interpret wiki markup like bolding, or italicizing text, etc.
Format text (Delete single newlines, multiple spaces, and wrap text automatically)
Create new paragraphs with double newlines
arrow → in
italics
link
arrow
→
{{
tc
}}
''italics''
[[
help:Link
link
]]
Tag poem used to preserve single newlines
edit
Interpret HTML entities
Interpret wiki markup like bolding, or italicizing text, etc.
Reformat text partially (Don't remove newlines, but remove multiple spaces, and wrap text automatically)
arrow → in
italics
link
arrow
→
{{
tc
}}
''italics''
[[
help:Link
link
]]
edit
Interpret HTML entities.
Don't process special wiki markup like bolding, or italicizing text, etc.
Reformat text
Ignore double newlines to avoid creating a new paragraph; hence, each paragraph must have its application.
can be applied in-line:
arrow → {{tc}}
''italics''
[[help:Link|link]]
normal
again
''can be applied in-line:''
arrow
→
{{
tc
}}
''italics''
[[
help:Link
link
]]
''[[
normal
]] again''
edit
Process HTML entities
Avoid interpreting or processing any special wiki markup like bolding, or italicizing text, etc.
No text wrapping
As instructed by the browser's settings, use a fixed-width font.
arrow → {{tc}}''italics''
[[help:Link|link]]
arrow
→
{{
tc
}}
''italics''
[[
help:Link
link
]]
Leading space
edit
Process HTML entities
Interpret wiki markup like bolding, or italicizing text, etc.
No text wrapping
Creates a
<
pre
HTML element
The pre element ends with a blank line, and if there are more lines with leading spaces, a new pre element begins.
arrow → {{tc}}''italics''
[[help:Link|link]]If a line of plain text begins with a space
it will be displayed exactly
as entered
in a fixed-width font
inside a grey dotted-outline box
with no line breaks
END
This feature is handy for:
* inserting preformatted text;
* algorithm descriptions;
* showcasing code snippets;
* displaying ASCII art;
* presenting chemical diagrams;
* formatting poetry
Warning:
When you make it wide, you
make the entire page wide
and hence less readable. Don't begin ordinary lines with spaces.
(see also hereafter)
arrow
→
{{
tc
}}
''italics''
[[
help
Link
link
]]
If a line of plain text begins with a space
it will be displayed exactly
as entered
in a fixed-width font
inside a grey dotted-outline box
with no line breaks
END
This feature is handy for:
* inserting preformatted text;
* algorithm descriptions;
* showcasing code snippets;
* displaying ASCII art;
* presenting chemical diagrams;
* formatting poetry
Literal character references
edit
→
&
rarr;
When using
expandable wikitext
like
{{t1demo|p ''q'' r}}
, using{{t1demo|p ''q'' r}}
will display the wikitext as it is.
However, when using the
#tag
magic word,
{{#tag:nowiki|{{t1demo|p ''q'' r}}}}
will show the expanded wikitext
startp ''q'' rend
Miscellaneous
edit
Signatures
edit
Don't forget to "sign" your comments on talk pages using tildes (
).
Three tildes adds your username:
Example
Four tildes adds your username and a timestamp:
Example
09:20, Mar 14 2024 (UTC)
Five tildes adds a timestamp: 09:20, Mar 14 2024 (UTC)
The server will add the link when you save.
Three tildes adds your username:
~~~
Four tildes adds your username and timestamp:
~~~~
Five tildes adds only a timestamp:
~~~~~
Comments
edit
Text between
here
and here
won't be rendered.
Text between
'''here'''
'''and here'''
won't be rendered.
Adding another page – transclusion and templates
edit
Modifying a
transcluded
page will modify every page that transcludes it.
Template
edit
A unique type of page designed for transclusion.
They are found in the
Template:
namespace
These templates can take parameters.
All the templates that are used on a page are listed after the edit box when you update it.
In this example,
Quote
is a template page designed to display a quote.
{{Template:Quote}}
Transclusion
edit
Combining another page's contents into the current page.
The below example uses a
Quote
template page to perform transclusion of the said template.
The
Quote
template processes wikitext provided through a parameter and applies text formatting to generate the transcluded output.
This is a parameter for a transcluded quote.
{{Quote|quote=This is a parameter for a transcluded quote.}}
Database records related to edits
edit
Both the
revision
table and the
recentchanges
table of the database contain records of edits.
The
revision
table stores page histories and user contribution lists, while the
recentchanges
table manages recent changes, watchlists, and new page creation lists.
If older edits are removed from the
recentchanges
table while nothing is deleted from the
revision
table, older edits remain visible in page histories and user contribution lists but not in recent changes, related changes watchlists, or the list of new pages.
When
importing
page revisions, the changes are recorded in the
revision
table but not in the
recentchanges
table.
This means that while the revisions will show up in the page histories and user contribution lists, they won't appear in recent changes, watchlists, or lists of new pages.
References
edit
Manual:$wgExternalLinkTarget
Retrieved from "
Categories
Pages to be expanded
Help
Hidden categories:
Pages using ISBN magic links
Pages using RFC magic links
Help
Advanced editing
Add topic