Welcome to Yahamaga: Difference between revisions

From Yahamaga
Line 6: Line 6:




local this = {}
{{short description|Wikipedia help page}}
{{pp-move-indef|small=yes}}
{{pp-vandalism|small=yes}}
{{for|the encyclopedic section on wikitext|Wiki#Editing}}
{{redirect|H:WT|the welcoming templates|Wikipedia:Welcoming committee/Welcome templates}}
{{Locutions pages header}}
{{Wikipedia how to|H:WT|H:MARKUP|H:WIKICODE}}
{{Wikitext navbox}}
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.){{efn|Wikipedia is an encyclopedia that uses wikitext—wikitext is not named after Wikipedia.}} 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]].


function this.checkLanguage(subpage, default)
In addition to wikitext, some [[HTML element]]s are also allowed for presentation formatting. See [[Help:HTML in wikitext]] for information on this.
    --[[Check first if there's an any invalid character that would cause the
{{TOC limit}}
        mw.language.isKnownLanguageTag function() to throw an exception:
        - all ASCII controls in [\000-\031\127],
        - double quote ("), sharp sign (#), ampersand (&), apostrophe ('),
        - slash (/), colon (:), semicolon (;), lower than (<), greater than (>),
        - brackets and braces ([, ], {, }), pipe (|), backslash (\\)
        All other characters are accepted, including space and all non-ASCII
        characters (including \192, which is invalid in UTF-8).
    --]]
    if mw.language.isValidCode(subpage) and mw.language.isKnownLanguageTag(subpage)
    --[[However "SupportedLanguages" are too restrictive, as they discard many
        valid BCP47 script variants (only because MediaWiki still does not
        define automatic transliterators for them, e.g. "en-dsrt" or
        "fr-brai" for French transliteration in Braille), and country variants,
        (useful in localized data, even if they are no longer used for
        translations, such as zh-cn, also useful for legacy codes).
        We want to avoid matching subpagenames containing any uppercase letter,
        (even if they are considered valid in BCP 47, in which they are
        case-insensitive; they are not "SupportedLanguages" for MediaWiki, so
        they are not "KnownLanguageTags" for MediaWiki).
        To be more restrictive, we exclude any character
        * that is not ASCII and not a lowercase letter, minus-hyphen, or digit,
          or does not start by a letter or does not finish by a letter or digit;
        * or that has more than 8 characters between hyphens;
        * or that has two hyphens;
        * or with specific uses in template subpages and unusable as languages.
    --]]
    or  string.find(subpage, "^[%l][%-%d%l]*[%d%l]$") ~= nil
    and string.find(subpage, "[%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l]") == nil
    and string.find(subpage, "%-%-") == nil
    and subpage ~= "doc"
    and subpage ~= "layout"
    and subpage ~= "sandbox"
    and subpage ~= "testcases"
    and subpage ~= "init"
    and subpage ~= "preload"
    and subpage ~= "subpage"
    and subpage ~= "subpage2"
    and subpage ~= "sub-subpage"
    and subpage ~= "sub-sub-subpage"
    and subpage ~= "sub-sub-sub-subpage"
    then
        return subpage
    end
    -- Otherwise there's currently no known language subpage
    return default
end


--[[Get the last subpage of an arbitrary page if it is a translation.
==Layout==
    To be used from templates.
<!--{{VE documentation}} Over prominent and confusing -->
    ]]
function this.getLanguageSubpage(frame)
local title = frame and frame.args[1]
if not title or title == '' then
title = mw.title.getCurrentTitle()
end
return this._getLanguageSubpage(title)
end


--[[Get the last subpage of an arbitrary page if it is a translation.
===Sections===
    To be used from Lua.
Article sections in a page will follow that page's [[WP:LEAD|lead]] or introduction and, if there are four or more, the [[WP:TOC|table of contents]].
    ]]
function this._getLanguageSubpage(title)
if type(title) == 'string' then
title = mw.title.new(title)
end
if not title then
-- invalid title
return mw.language.getContentLanguage():getCode()
end
--[[This code does not work in all namespaces where the Translate tool works.
--  It works in the main namespace on Meta because it allows subpages there
--  It would not work in the main namespace of English Wikipedia (but the
--  articles are monolignual on that wiki).
--  On Meta-Wiki the main space uses subpages and its pages are translated.
--  The Translate tool allows translatng pages in all namespaces, even if
--  the namespace officially does not have subpages.
--  On Meta-Wiki the Category namespace still does not have subpages enabled,
--  even if they would be very useful for categorizing templates, that DO have
--  subpages (for documentatio and tstboxes pages). This is a misconfiguration
--  bug of Meta-Wiki. The work-around is to split the full title and then
--  get the last titlepart.
local subpage = title.subpageText
--]]
local titleparts = mw.text.split(title.fullText, '/')
local subpage = titleparts[#titleparts]
return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode())
end


--[[Get the last subpage of the current page if it is a translation.
====Section headings====
    ]]
{{see|Help:Section|Wikipedia:Manual of Style#Section headings}}
function this.getCurrentLanguageSubpage()
return this._getLanguageSubpage(mw.title.getCurrentTitle())
end


--[[Get the first part of the language code of the subpage, before the '-'.
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.
function this.getMainLanguageSubpage()
* Headings are styled through [[CSS]] and add an <code>[edit]</code> link. [[Help:Cascading Style Sheets#Wiki headings|See this section]] for the relevant CSS.
parts = mw.text.split( this.getCurrentLanguageSubpage(), '-' )
* Four or more headings cause a table of contents to be generated automatically.
return parts[1]
* 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.
end


--[[Get the last subpage of the current frame if it is a translation.
{{#lst:Help:HTML in wikitext|WIKI_section}}
    Not used locally.
    ]]
function this.getFrameLanguageSubpage(frame)
return this._getLanguageSubpage(frame:getParent():getTitle())
end


--[[Get the language of the current page.
Templates: {{tl|fake heading}} for use in documentation.
    Not used locally.
    ]]
function this.getLanguage()
    local subpage = mw.title.getCurrentTitle().subpageText
    return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode())
end


--[[Get the language of the current frame.
====Horizontal rule====
    Not used locally.
{{see|WP:LINE}}
    ]]
function this.getFrameLanguage(frame)
    local titleparts = mw.text.split(frame:getParent():getTitle(), '/')
    local subpage = titleparts[#titleparts]
    return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode())
end


function this.title(namespace, basepagename, subpage)
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.
    local message, title
    local pagename = basepagename
    if (subpage or '') ~= ''
    then
        pagename = pagename .. '/' .. subpage
    end
    local valid, title = xpcall(function()
            return mw.title.new(pagename, namespace) -- costly
        end, function(msg) -- catch undocumented exception (!?)
            -- thrown when namespace does not exist. The doc still
            -- says it should return a title, even in that case...
            message = msg
        end)
    if valid and title ~= nil and (title.id or 0) ~= 0
    then
        return title
    end
    return { -- "pseudo" mw.title object with id = nil in case of error
        prefixedText = pagename, -- the only property we need below
        message = message -- only for debugging
    }
end


--[[If on a translation subpage (like Foobar/de), this function returns
{{markup
    a given template in the same language, if the translation is available.
|<nowiki>----</nowiki>
    Otherwise, the template is returned in its default language, without
|{{crlf2}}
    modification.
----
    This is aimed at replacing the current implementation of Template:TNTN.
}}


    This version does not expand the returned template name: this solves the
HTML equivalent: {{tag|hr|s}} (which can be indented, whereas <nowiki>----</nowiki> always starts at the left margin.)
    problem of self-recursion in TNT when translatable templates need themselves
    to transclude other translable templates (such as Tnavbar).
    ]]
function this.getTranslatedTemplate(frame, withStatus)
    local args = frame.args
    local pagename = args['template']
   
    --[[Check whether the pagename is actually in the Template namespace, or
        if we're transcluding a main-namespace page.
        (added for backward compatibility of Template:TNT)
        ]]
    local title
    local namespace = args['tntns'] or ''
    if (namespace ~= '') -- Checks for tntns parameter for custom ns.
    then
        title = this.title(namespace, pagename) -- Costly
    else -- Supposes that set page is in ns10.
    namespace = 'Template'
        title = this.title(namespace, pagename) -- Costly
        if title.id == nil
        then -- not found in the Template namespace, assume the main namespace (for backward compatibility)
        namespace = ''
            title = this.title(namespace, pagename) -- Costly
        end
    end
   
    -- Get the last subpage and check if it matches a known language code.
    local subpage = args['uselang'] or ''
    if (subpage == '')
    then
        subpage = this.getCurrentLanguageSubpage()
    end
    if (subpage == '')
    then
        -- Check if a translation of the pagename exists in English
        local newtitle = this.title(namespace, pagename, 'en') -- Costly
        -- Use the translation when it exists
        if newtitle.id ~= nil
        then
            title = newtitle
        end
    else
        -- Check if a translation of the pagename exists in that language
        local newtitle = this.title(namespace, pagename, subpage) -- Costly
        if newtitle.id == nil
        then
            -- Check if a translation of the pagename exists in English
            newtitle = this.title(namespace, pagename, 'en') -- Costly
        end
        -- Use the translation when it exists
        if newtitle.id ~= nil
        then
            title = newtitle
        end
    end
    -- At this point the title should exist
    if withStatus then
    -- status returned to Lua function below
        return title.prefixedText, title.id ~= nil
    else
    -- returned directly to MediaWiki
        return title.prefixedText
    end
end


--[[If on a translation subpage (like Foobar/de), this function renders
====Table of contents====
    a given template in the same language, if the translation is available.
{{see|WP:TOC}}
    Otherwise, the template is rendered in its default language, without
    modification.
    This is aimed at replacing the current implementation of Template:TNT.
   
    Note that translatable templates cannot transclude themselves other
    translatable templates, as it will recurse on TNT. Use TNTN instead
    to return only the effective template name to expand externally, with
    template parameters also provided externally.
    ]]
function this.renderTranslatedTemplate(frame)
local title, found = this.getTranslatedTemplate(frame, true)
    -- At this point the title should exist prior to performing the expansion
    -- of the template, otherwise render a red link to the missing page
    -- (resolved in its assumed namespace). If we don't tet this here, a
    -- script error would be thrown. Returning a red link is consistant with
    -- MediaWiki behavior when attempting to transclude inexistant templates.
if not found then
return '[[' .. title .. ']]'
end


    -- Copy args pseudo-table to a proper table so we can feed it to expandTemplate.
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:
    -- Then render the pagename.
* <code><nowiki>__FORCETOC__</nowiki></code> forces the TOC to appear at the normal location regardless of the number of headings.
    local args = frame.args
* <code><nowiki>__TOC__</nowiki></code> forces the TOC to appear at the point where the magic word is inserted instead of the normal location.
    local pargs = (frame:getParent() or {}).args
* <code><nowiki>__NOTOC__</nowiki></code> disables the TOC entirely.
    local arguments = {}
* {{tl|TOC limit}} template can be used to control the depth of subsections included in the TOC. This is useful where the TOC is long and unwieldy.
    if (args['noshift'] or '') == ''
* [[:Category:Wikipedia table of contents templates]] contains a number of specialized TOC templates.
    then
        for k, v in pairs(pargs) do
            -- numbered args >= 1 need to be shifted
            local n = tonumber(k) or 0
            if (n > 0)
            then
                if (n >= 2)
                then
                    arguments[n - 1] = v
                end
            else
                arguments[k] = v
            end
        end
    else -- special case where TNT is used as autotranslate
    -- (don't shift again what is shifted in the invokation)
        for k, v in pairs(pargs) do
            arguments[k] = v
        end
    end
    arguments['template'] = title -- override the existing parameter of the base template name supplied with the full name of the actual template expanded
    arguments['tntns'] = nil -- discard the specified namespace override
    arguments['uselang'] = args['uselang'] -- argument forwarded into parent frame
    arguments['noshift'] = args['noshift'] -- argument forwarded into parent frame
   
    return frame:expandTemplate{title = ':' .. title, args = arguments}
end


--[[A helper for mocking TNT in Special:TemplateSandbox. TNT breaks
===Line breaks===
    TemplateSandbox; mocking it with this method means templates won't be
<!--[[Help:Breaks]] links directly here.-->
    localized but at least TemplateSandbox substitutions will work properly.
{{see|Help:Line-break handling|Wikipedia:Line breaks usage|Wikipedia:Manual of Style/Accessibility#Indentation}}
    Won't work with complex uses.
    ]]
function this.mockTNT(frame)
    local pargs = (frame:getParent() or {}).args
    local arguments = {}
    for k, v in pairs(pargs) do
        -- numbered args >= 1 need to be shifted
        local n = tonumber(k) or 0
        if (n > 0)
        then
            if (n >= 2)
            then
                arguments[n - 1] = v
            end
        else
            arguments[k] = v
        end
    end
    if not pargs[1]
    then
    return ''
end
    return frame:expandTemplate{title = 'Template:' .. pargs[1], args = arguments}
end


return this
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|Enter}} twice.
* Pressing {{key press|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.
 
{{markup
|<nowiki>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.
</nowiki>
|{{crlf2}}
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: {{tag|br|o}} or {{tag|br|s}} can be used to break line layout.
 
Templates for line breaks:
* {{tl|break}} adds multiple line breaks.
* {{tl|-}} and {{tl|clear}} adds a break with styling, to clear floating elements. (often used to prevent text from flowing next to unrelated tables or images)
 
Unbulleted list:
* {{tl|plainlist}} and {{tl|unbulleted list}} both create an unbulleted list.
 
===Indent text===
{{see|WP:INDENT|Wikipedia:Manual of Style/Accessibility#Indentation}}
 
Indentation is most commonly used on talk pages.
 
{{markup
|<nowiki>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 ...
{{Outdent|::::::}}The outdent template can give a visual indicator that we're deliberately cancelling the indent (6 levels here)</nowiki>
|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 ...
{{Outdent|::::::}}The outdent template can give a visual indicator that we're deliberately cancelling the indent (6 levels here)}}
 
Templates: {{tl|outdent}}, {{tl|outdent2}}
 
===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
|<nowiki>Normal text
<blockquote>
The '''blockquote''' tag will indent both margins when needed instead of the left margin only as the colon does.
</blockquote>
</nowiki>Normal text
|Normal text
<blockquote>
The '''blockquote''' tag will indent both margins when needed instead of the left margin only as the colon does.
</blockquote>
Normal text
}}
This uses an HTML tag; template {{tl|quote}} results in the same render.
 
===Center text===
{{See also|Span and div|HTML tag|Template:Align}}
{{markup
|<syntaxhighlight lang="html" inline style="border:none; background:transparent;"><div class="center" style="width: auto; margin-left: auto; margin-right: auto;">Centered text</div></syntaxhighlight>
|2=<div class="center" style="width: auto; margin-left: auto; margin-right: auto;">Centered text</div>
}}
 
Template {{tl|center}} uses the same markup. To center a table, see [[Help:Table#Centering tables]].
Please do not use {{tag|center}} tags, as it is obsolete.
 
===Align text to right===
 
You can align content in a separate container:
 
{{markup
|1=<syntaxhighlight lang="html" inline style="border:none; background:transparent;"><div style="text-align: right; direction: ltr; margin-left: 1em;">Text on the right</div></syntaxhighlight>
|2=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.<div style="text-align: right; direction: ltr; margin-left: 1em;">Text on the right</div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
}}
 
Or; make the text float around it:
 
{{markup
|1=<syntaxhighlight lang="html" inline style="border:none; background:transparent;"><div class="floatright">Text on the right</div></syntaxhighlight>
|2=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.<div class="floatright">Text on the right</div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
 
|3=<nowiki>{{stack|Text on the right}}</nowiki>
|4=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.{{stack|Text on the right}}Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
}}
 
===Lists===
{{see|Help:List|MOS: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.
 
====Unordered lists====
{{Shortcut|H:UL}}
 
{{markup
|<nowiki>* 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</nowiki>
|{{crlf2}}
* 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====
{{Shortcut|H:OL}}
 
{{markup
|<nowiki>
# Item1
# Item2
# Item3
# Item4
## Sub-item 1
### Sub-sub-item
#### Sub-sub-sub-item
## Sub-item 2
# Item5
</nowiki>
|{{crlf2}}
# Item1
# Item2
# Item3
# Item4
## Sub-item 1
### Sub-sub-item
#### Sub-sub-sub-item
## Sub-item 2
# Item5
}}
 
===={{Anchor|DL}}Description lists====
{{anchors|Definition lists|Association lists|H:DL}}
{{Shortcut|H:DL}}
 
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''<!--HTML5 name--> (formerly ''definition lists''<!--HTML4 name-->, and a.k.a. ''association lists''<!--draft HTML5 name-->) 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.
 
{{hatnote-inline|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 reader]]s. 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
|<nowiki>; Term : Definition1</nowiki>
|{{crlf2}}
; Term : Definition1
|<nowiki>; Term
: Definition1
: Definition2
: Definition3
: Definition4</nowiki>
|{{crlf2}}
; Term
: Definition1
: Definition2
: Definition3
: Definition4
}}
 
HTML equivalent: {{tag|dl|o}} {{tag|dt}}, {{tag|dd}} {{tag|dl|c}}
 
Templates: {{tl|defn}}
 
===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 [[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}}; the template {{tlx|poemquote}} provides a convenient shorthand. [[H:CSS|CSS styles]] may be applied to this tag, e.g.: <code><nowiki><poem style="margin-left: 2em;"></nowiki></code>.
 
{{markup
|<nowiki><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></nowiki>
|<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>
}}
 
Poems and their translation can be presented side by side, and the language can be indicated with <code>lang="xx"</code>. Following the last side-by-side block, {{tlx|Clear|left}} must be used to cancel <code>"float:left;"</code> and to re-establish normal flow. Note that this method does not require [[#Tables|a table]] and its columns to achieve the side-by-side presentation.
 
'''Markup'''
<syntaxhighlight lang="xml"><poem lang="fr" style="float:left;">Frère Jacques, frère Jacques,
Dormez-vous? Dormez-vous?
Sonnez les matines! Sonnez les matines!
Ding, dang, dong. Ding, dang, dong.</poem>
<poem style="margin-left:2em; float:left;">Are you sleeping? Are you sleeping?
Brother John, Brother John,
Morning bells are ringing! Morning bells are ringing!
Ding, dang, dong. Ding, dang, dong.</poem>{{Clear|left}}</syntaxhighlight>
'''Renders as'''
<poem lang="fr" style="float:left;">Frère Jacques, frère Jacques,
Dormez-vous? Dormez-vous?
Sonnez les matines! Sonnez les matines!
Ding, dang, dong. Ding, dang, dong.</poem>
<poem style="margin-left:2em; float:left;">Are you sleeping? Are you sleeping?
Brother John, Brother John,
Morning bells are ringing! Morning bells are ringing!
Ding, dang, dong. Ding, dang, dong.</poem>{{Clear|left}}
 
==Format==
 
===Text formatting===
 
{| class="wikitable"
|- style="vertical-align: top;"
!style="width:34%;"| Description
!style="width:33%;"| What you type
!style="width:33%;"| What it looks like
 
<!---------- italics, bold, smallcaps ----------->
|- id="emph" style="vertical-align: top;"
|
''italics'', '''bold''', {{smallcaps|small capital letters}}
|
<pre>
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}}.
</pre>
|
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.
 
To reverse this effect where it has been automatically applied, use {{tl|nobold}} and {{tl|noitalic}}.
 
For text as {{smallcaps|small caps}}, use the template {{tl|smallcaps}}.
 
<!------------- inline source code -------------->
|-
|
Small chunks of [[source code]] within a line of normal text.
 
Code is displayed in a [[monospace font]].
|
<pre><nowiki>function <code>int m2()</code> is nice.</nowiki></pre>
|
function <code>int m2()</code> is nice.
 
<!------------ syntax highlighting -------------->
|- id="syntaxhighlight" style="vertical-align:top;"
|
[[mw:Extension:SyntaxHighlight|Syntax highlighting]] for source code.
 
Computer code has colored text and more stringent formatting. For example, to define a function: <code>int m2()</code>, with highlights.
 
See [https://github.com/wikimedia/mediawiki-extensions-SyntaxHighlight_GeSHi/blob/master/SyntaxHighlight.lexers.php here] for a full list of supported languages that can be put in <code>lang="????"</code>
|
<pre><nowiki><syntaxhighlight lang="cpp">
#include <iostream>
int m2 (int ax, char *p_ax) {
  std::cout <<"Hello World!";
  return 0;
}</syntaxhighlight></nowiki></pre>
|
<syntaxhighlight lang="cpp">
#include <iostream>
int m2 (int ax, char *p_ax) {
  std::cout <<"Hello World!";
  return 0;
}</syntaxhighlight>
 
<!---------------- <small> text ----------------->
|-
|
<small>Small text</small>
|
<syntaxhighlight lang="html">
Use <small>small text</small> only
when necessary.
</syntaxhighlight>
|
Use <small>small text</small> only when necessary.
 
<!---------------- <small> span ----------------->
|-
|
<small style="font-size:87%;">a <nowiki><small></nowiki> span</small>
|
<syntaxhighlight lang="html">
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>.
</syntaxhighlight>
|
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>.
 
<!----------------- <big> text ------------------>
|-
|
<big>Big text</big>
|
<syntaxhighlight lang="html">
Better not use <big>big text</big>, unless <small>it's <big>within</big> small</small> text.
</syntaxhighlight>
|
Better not use <big>big text</big>, unless <small>it's <big>within</big> small</small> text.
 
<!-------------------- nbsp --------------------->
|-
|
To prevent two words from becoming separated by a [[linewrap]] (e.g. ''Mr.&nbsp;Smith'' or ''400&nbsp;km/h'') a '''[[non-breaking space]]''', sometimes also called a "non-printing character", may be used between them. (For three or more words, the template {{tl|nowrap}} is probably more suitable.)
|
<pre>Mr.&amp;nbsp;Smith or 400&amp;nbsp;km/h</pre>
|
Mr.&nbsp;Smith or 400&nbsp;km/h
 
<!------------------- {{pad}} ------------------->
|-
|
'''Extra spacing''' within text is usually best achieved using the {{tl|pad}} template.
|
<pre><nowiki>Mary {{pad|4.0em}} had a little lamb.</nowiki></pre>
|
Mary {{pad|4.0em}} had a little lamb.
 
<!---------- (<kbd>)
|-
|
'''Typewriter text'''<br><br>
 
(Also works beyond the end of a paragraph.)
|
<pre><nowiki><kbd>right arrow    →</kbd>
 
<kbd>''italics'', '''bold'''</kbd>
 
<kbd>[[wikilink]]
 
New paragraph </kbd>started here.</nowiki></pre>
|
<pre><kbd>right arrow    →</kbd>
 
<kbd>''italics'', '''bold'''</kbd>
 
<kbd>[[wikilink]]
 
New paragraph </kbd>started here.</pre>
 
----->
|}
 
===Special characters===
{{See also|Help:Special characters|List of XML and HTML character entity references}}
Special characters can often be displayed using [[Numeric character reference|numeric character references]] or [[List of XML and HTML character entity references|character entity references]]. See [[Character encodings in HTML]] for more information. For example, <code>&amp;Agrave;</code> and <code>&amp;#xC0;</code> both render [[&Agrave;]] (A-[[Grave accent|grave]]). [[Percent-encoding]] can't be used, as it works only in [[URL]]s.
 
====Diacritical marks====
[[Diacritic]] marks, using character entity references.
{| class="wikitable"
! What you type
! What it looks like
|-
|
<pre><nowiki>&amp;Agrave; &amp;Aacute; &amp;Acirc; &amp;Atilde; &amp;Auml; &amp;Aring; &amp;AElig;
 
&amp;Ccedil; &amp;Egrave; &amp;Eacute; &amp;Ecirc; &amp;Euml;
 
&amp;Igrave; &amp;Iacute; &amp;Icirc; &amp;Iuml; &amp;Ntilde;
 
&amp;Ograve; &amp;Oacute; &amp;Ocirc; &amp;Otilde; &amp;Ouml; &amp;Oslash; &amp;OElig;
 
&amp;Ugrave; &amp;Uacute; &amp;Ucirc; &amp;Uuml; &amp;Yuml; &amp;szlig;
 
&amp;agrave; &amp;aacute; &amp;acirc; &amp;atilde; &amp;auml; &amp;aring; &amp;aelig; &amp;ccedil;
 
&amp;egrave; &amp;eacute; &amp;ecirc; &amp;euml;
 
&amp;igrave; &amp;iacute; &amp;icirc; &amp;iuml; &amp;ntilde;
 
&amp;ograve; &amp;oacute; &amp;ocirc; &amp;otilde; &amp;ouml; &amp;oslash; &amp;oelig;
 
&amp;ugrave; &amp;uacute; &amp;ucirc; &amp;uuml; &amp;yuml;</nowiki></pre>
 
|
À Á Â Ã Ä Å Æ
 
Ç È É Ê Ë
 
Ì Í Î Ï Ñ
 
Ò Ó Ô Õ Ö Ø Œ
 
Ù Ú Û Ü Ÿ ß
 
à á â ã ä å æ ç
 
è é ê ë
 
ì í î ï ñ
 
ò ó ô õ ö ø œ
 
ù ú û ü ÿ
|}
 
====Punctuation special characters====
Using character entity references.
{| class="wikitable"
! What you type
! What it looks like
|-
|<code>&amp;iquest; &amp;iexcl; &amp;sect; &amp;para;</code>
|¿ ¡ § ¶
|-
|<code>&amp;dagger; &amp;Dagger; &amp;bull; &amp;ndash; &amp;mdash;</code>
|† ‡ • &ndash; &mdash;
|-
|<code>&amp;lsaquo; &amp;rsaquo; &amp;laquo; &amp;raquo;</code>
|‹ › « »
|-
|<code>&amp;lsquo; &amp;rsquo; &amp;ldquo; &amp;rdquo;</code>
|&lsquo; &rsquo; &ldquo; &rdquo;
|-
|<code>&amp;apos; &amp;quot;</code>
|&apos; &quot;
|}
 
====Escaping punctuation characters====
The [[#Pre|{{tag|pre|o}}]], [[#Nowiki|{{tag|nowiki|o}}]], and  [[#Code|{{tag|code|o}}]]  markup tags are also available, for writing <nowiki>"[", "{", "&", "}", "]"</nowiki> for example. These tags prevent these characters from being recognised as wiki markup, which is a possibility in some circumstances.
 
====Commercial symbols====
Using character entity references.
{| class="wikitable"
! What you type
! What it looks like
|-
|<code>&amp;trade; &amp;copy; &amp;reg; </code>
|™ © ®
|-
|<code>&amp;cent; &amp;euro; &amp;yen; &amp;pound; &amp;curren;</code>
|¢ € ¥ £ ¤
|}
 
====Greek characters====
Using character entity references.
{| class="wikitable"
! What you type
! What it looks like
|-
|<code>&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta; </code>
|α β γ δ ε ζ
|-
|<code>&amp;Alpha; &amp;Beta; &amp;Gamma; &amp;Delta; &amp;Epsilon; &amp;Zeta;</code>
|Α Β Γ Δ Ε Ζ
|-
|<code>&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu;</code>
|η θ ι κ λ μ ν
|-
|<code>&amp;Eta; &amp;Theta; &amp;Iota; &amp;Kappa; &amp;Lambda; &amp;Mu; &amp;Nu; </code>
|Η Θ Ι Κ Λ Μ Ν
|-
|<code>&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;</code>
|ξ ο π ρ σ ς
|-
|<code>&amp;Xi; &amp;Omicron; &amp;Pi; &amp;Rho; &amp;Sigma; </code>
|Ξ Ο Π Ρ Σ
|-
|<code>&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;</code>
|τ υ φ χ ψ ω
|-
|<code>&amp;Tau; &amp;Upsilon; &amp;Phi; &amp;Chi; &amp;Psi; &amp;Omega; </code>
|Τ Υ Φ Χ Ψ Ω
|}
 
====Egyptian hieroglyphs====
{{main|Help:WikiHiero syntax}}
 
WikiHiero is a software extension that renders [[Egyptian hieroglyphs]] as PNG images using {{xtag|hiero}} HTML-like tags.
 
Example:
{{markup
|<nowiki><hiero>P2</hiero></nowiki>
|<hiero>P2</hiero>
}}
 
====Chess symbols====
{{main|Chess symbols in Unicode}}
 
For example, &amp;#9812; displays &#9812;
 
====Subscripts and superscripts====
* The [[Wikipedia:Manual of Style (mathematics)#Superscripts and subscripts|Manual of Style]] prefers the {{tag|sub|o}} and {{tag|sup|o}} formats, for example <code>x{{tag|sub|content=1}}</code>. 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.
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''Subscripts''
|
<syntaxhighlight lang="html">
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub> or
 
x&#8320; x&#8321; x&#8322; x&#8323; x&#8324;
 
x&#8325; x&#8326; x&#8327; x&#8328; x&#8329;
</syntaxhighlight>
|
 
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub> or
 
x₀ x₁ x₂ x₃ x₄
 
x₅ x₆ x₇ x₈ x₉
 
|-
|
''Superscripts''
|
<syntaxhighlight lang="html">
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup> or
 
x&#8304; x&sup1; x&sup2; x&sup3; x&#8308;
 
x&#8309; x&#8310; x&#8311; x&#8312; x&#8313;
</syntaxhighlight>
|
 
x<sup>1</sup> x<sup >2</sup > x<sup >3</sup > or
 
x⁰ x¹ x² x³ x⁴
 
x⁵ x⁶ x⁷ x⁸ x⁹
 
|-
|
''Combined''
|
<syntaxhighlight lang="tid">
&epsilon;<sub>0</sub> = 8.85 &times; 10<sup>&minus;12</sup> C&sup2; / J m
 
1 [[hectare]] = 1 E+4 m&sup2;
</syntaxhighlight>
|
 
&epsilon;<sub>0</sub> = 8.85 &times; 10<sup>&minus;12</sup> C&sup2; / J m
 
1 [[hectare]] = 1 E+4 m&sup2;
 
|}
 
====Characters in the Private Use Area, and invisible formatting characters====
{{main|MOS:TEXT#PUA and RTL}}
 
Invisible and [[Private Use Areas|PUA (Private Use Areas)]] characters should be avoided where possible.  When needed, they should both be replaced with their (hexa)decimal code values (as "&#(x)...;").  This renders invisible characters visible, for manual editing, and allows [[Wikipedia:AutoWikiBrowser|AWB]] to process pages with PUA characters.  The latter should also be tagged with the {{tl|PUA}} template for tracking and future maintenance.
 
===Mathematical characters and formulae===
 
====Mathematical characters====
 
* See also [[Wikipedia:Mathematical symbols]], [[Wikipedia:WikiProject Mathematics|WikiProject Mathematics]] and [[TeX]].
 
{| class="wikitable"
! What you type
! What it looks like
|-
|<kbd>&amp;int; &amp;sum; &amp;prod; &amp;radic;</kbd>||&int; &sum; &prod; &radic;
|-
|<kbd>&amp;minus; &amp;plusmn; &amp;infin;</kbd>||&minus; &plusmn; &infin;
|-
|<kbd>&amp;asymp; &amp;prop; &amp;equiv; &amp;ne;</kbd>||&asymp; &prop; &equiv; &ne;
|-
|<kbd>&amp;le; &amp;ge;</kbd>||&le; &ge;
|-
|<kbd>&amp;times; &amp;middot; &amp;divide; &amp;part;</kbd>||&times; &middot; &divide; &part;
|-
|<kbd>&amp;prime; &amp;Prime;</kbd>||&prime; &Prime;
|-
|<kbd>&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;alefsym;</kbd>||&nabla; &permil; &deg; &there4; &alefsym;
|-
|<kbd>&amp;oslash;</kbd>||&oslash;
|-
|<kbd>&amp;isin; &amp;notin; &amp;cap; &amp;cup;</kbd>||&isin; &notin; &cap; &cup;
|-
|<kbd>&amp;sub; &amp;sup; &amp;sube; &amp;supe;</kbd>||&sub; &sup; &sube; &supe;
|-
|<kbd>&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall;</kbd>||&not; &and; &or; &exist; &forall;
|-
|<kbd>&amp;rArr; &amp;lArr; &amp;dArr; &amp;uArr; &amp;hArr;</kbd>||&rArr; &lArr; &dArr; &uArr; &hArr;
|-
|<kbd>&amp;rarr; &amp;larr; &amp;darr; &amp;uarr; &amp;harr;</kbd>||&rarr; &larr; &darr; &uarr; &harr;
|}
 
====Mathematical formulae====
{{main|Help:Displaying a formula}}
 
* Formulae that include mathematical letters, like {{math|x}}, and operators like <code>×</code> should not use the plain letter <code>x</code>. See [[MOS:MATH#Font_formatting|math font formatting]]. For a comprehensive set of symbols, and comparison between {{tag|math|o}} tags and the {{tl|math}} template see section [[Help:Displaying_a_formula#TeX_vs_HTML|''TeX vs HTML'']].
 
* The {{tag|math|o}} tag typesets using [[MOS:MATH#Typesetting_of_mathematical_formulae|LaTeX markup]],{{efn|The version of LaTeX used is a subset of AMS-LaTeX markup; see [[Help:Displaying a formula]] for details.}} which may render as an image or as HTML, depending on environmental settings. The {{tag|math|o}} tag is best for the complex formula on its own line in an image format. If you use this tag to put a formula in the line with text, put it in the {{tl|nowrap}} template.
 
* The {{tl|math}} template [[MOS:MATH#Using_HTML|uses HTML]], and will size-match a serif font, and will also prevent line-wrap. All templates are sensitive to the <code>=</code> sign, so remember to replace <code>=</code> with <code>{{tl|{{=}}}}</code> in template input, or start the input with <code>1=</code>. Use wiki markup <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code> inside the {{tl|math}} template, as well as other [[Wikipedia:Mathematical_symbols|HTML entities]]. The {{tl|math}} template is best for typeset formulas in line with the text.
 
{{markup
|<syntaxhighlight lang="tex" inline>
<math>2x \times 4y \div 6z + 8 - \frac {y}{z^2} = 0</math>
</syntaxhighlight>
 
<syntaxhighlight lang="html" inline>
{{math|2''x'' &times; 4''y'' &divide; 6''z'' + 8 &minus; {{sfrac|''y''|''z''<sup>2</sup>}} {{=}} 0}}
</syntaxhighlight>
 
<syntaxhighlight lang="tex" inline>
<math>\sin 2\pi x + \ln e</math>
</syntaxhighlight>
<nowiki>
{{math|sin 2&amp;pi;''x'' + ln ''e''}}
</nowiki>
|<math>2x \times 4y \div 6z + 8 - \frac {y}{z^2} = 0</math>
{{crlf|}}
 
{{math|2''x'' &times; 4''y'' &divide; 6''z'' + 8 &minus; {{sfrac|''y''|''z''<sup>2</sup>}} {{=}} 0}}
 
<math>\sin 2\pi x + \ln e</math>{{crlf|}}
{{math|sin 2π''x'' + ln ''e''}}
}}
 
====Spacing in simple math formulae====
 
* Using '''<code>&amp;nbsp;</code>''' to prevent line break is not needed; the {{tl|math}} template will prevent line breaks anyway; you can use {{tag|br|s}} if you need an explicit line break inside a formula.
 
{{markup
|<syntaxhighlight lang="html" inline>
It follows that {{math|''x''<sup>2</sup> &ge; 0}} for real {{mvar|x}}.
</syntaxhighlight>
|2=
 
It follows that {{math|''x''<sup>2</sup> &ge; 0}} for real {{mvar|x}}.
}}
 
====Complicated formulae====
 
* See [[Help:Displaying a formula]] for how to use {{tag|math|o}}.
* A formula displayed on a line by itself should be indented using {{tag|math|params=display=block}}
 
{{markup
|<syntaxhighlight lang="latex" inline>
<math display=block>\sum_{n=0}^\infty \frac{x^n}{n!}</math>
</syntaxhighlight>
|2={{crlf2}}
<math display=block>\sum_{n=0}^\infty \frac{x^n}{n!}</math>
}}
Indenting by using the colon (:) character (i.e. using <code><nowiki>:<math></math></nowiki></code> instead of <code><nowiki><math display=block></math></nowiki></code>) is discouraged for [[Wikipedia:Manual of Style/Accessibility#Indentation|accessibility reasons]].
 
==Links and URLs==
{{main|Help:Link}}
 
===Wikilinks===
 
'''Wikilinks''' are used in wikitext markup to produce [[internal link]]s between pages. You create wikilinks by putting double square brackets around text designating the title of the page you want to link to. Thus, <code><nowiki>[[Texas]]</nowiki></code> will be rendered as [[Texas]]. Optionally, you can use a [[vertical bar]] (|) to customize the link title. For example, typing <code><nowiki>[[Texas|Lone Star State]]</nowiki></code> will produce [[Texas|Lone Star State]], a link that is displayed as "<u>Lone Star State</u>" but in fact links to [[Texas]].
 
====Link to another wiki article====
 
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).
* Thus the link hereafter is to the Web address <code>en.wikipedia.org/wiki/Public_transport</code>, which is the Wikipedia article with the name "Public transport". See also [[Help:Link#Conversion to canonical form|Canonicalization]].
* [[Intentionally permanent red link|A red link]] is a page that doesn't exist yet; it can be created by clicking on the link.
* [[Help:Self link|A link to its own page]] will appear only as bold text.
 
{{markup
|<nowiki>London has [[public transport]].</nowiki>
|London has [[public transport]].
 
|<nowiki>Link to this page: "[[Help:Wikitext]]" will appear only as bold text.</nowiki>
|Link to this page: "[[Help:Wikitext]]" will appear only as bold text.
 
}}
 
====Renamed link====
 
* Same target, different name.
* The target ("piped") text must be placed '''first''', then the text to be displayed '''second'''.
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>New York also has [[public transport|public transportation]].</nowiki></code>
|
New York also has [[public transport|public transportation]].
|}
 
====Automatically rename links====
 
* Simply typing the pipe character | after a link will automatically rename the link in certain circumstances. The next time you open the edit box you will see the expanded piped link. When [[Help:Show preview|previewing]] your edits, you will not see the expanded form until you press '''Save''' and '''Edit''' again. The same applies to [[#link-to-section|links to sections within the same page]].
* See [[Help:Pipe trick|Pipe trick]] for details.
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''Automatically hide stuff in parentheses''
|
<code><nowiki>[[kingdom (biology)|]]</nowiki></code>
|
[[kingdom (biology)|kingdom]]
|-
| ''Automatically hide the comma and following text''
| <code><nowiki>[[Seattle, Washington|]]</nowiki></code>
| [[Seattle, Washington|Seattle]]
|-
|
''Automatically hide namespace''
|
<code><nowiki>[[Wikipedia:Village pump|]]</nowiki></code>
|
[[Wikipedia:Village pump|Village pump]]
|-
|
''Or both''
|
<code><nowiki>[[Wikipedia:Manual of Style (headings)|]]</nowiki></code>
|
[[Wikipedia:Manual of Style (headings)|Manual of Style]]
|-
|
''<b>But this doesn't work for section links</b>''
|
<code><nowiki>[[Wikipedia:Manual of Style#Links|]]</nowiki></code>
|
[[Wikipedia:Manual of Style#Links|]]
|}
 
====Blend link====
 
* Endings are blended into the link.
** ''Exception'': a trailing [[apostrophe]] (') and any characters following the apostrophe are ''not'' blended.
* Preferred style is to use this instead of a piped link, if possible.
* Blending can be suppressed by using the [[#Nowiki|{{tag|nowiki|s}}]] tag, which may be desirable in some instances.
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
| rowspan=2 | ''Blending active''
|
<code><nowiki>San Francisco also has [[public transport]]ation. Examples include [[bus]]es, [[taxicab]]s, and [[tram]]s.</nowiki></code>
| San Francisco also has [[public transport]]ation. Examples include [[bus]]es, [[taxicab]]s, and [[tram]]s.
|-
| <code><nowiki>A [[micro-]]second</nowiki></code>
| A [[micro-]]second
|-
|
''Blending suppressed''
|
<code><nowiki>A [[micro-]]<nowiki />second.</nowiki></code>
|
A [[micro-]]<nowiki />second
|}
 
====Link to a section of a page====
 
* The part after the hash sign (#) must match a [[Help:Section#Creation_and_numbering_of_sections|section heading]] on the page. Matches must be exact in terms of spelling, case, and punctuation. Links to non-existent sections are not broken; they are treated as links to the beginning of the page.
* Include "| link title" to create a stylish ([[WP:Piping|piped]]) link title.
* If sections have the same title, add a number to link to any but the first. [[#Example section 3]] goes to the third section named "Example section". You can use the pipe and retype the section title to display the text without the # symbol.
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[Wikipedia:Manual of Style#Italics]] is a link to a section within another page.</nowiki></code>
|
[[Wikipedia:Manual of Style#Italics]] is a link to a section within another page.
|-
|
<code><nowiki>[[#Links and URLs]] is a link to another section on the current page. [[#Links and URLs|Links and URLs]] is a link to the same section without showing the # symbol.</nowiki></code>
|
[[#Links and URLs]] is a link to another section on the current page. [[#Links and URLs|Links and URLs]] is a link to the same section without showing the # symbol.
|-
|
<code><nowiki>[[Wikipedia:Manual of Style#Italics|Italics]] is a piped link to a section within another page.</nowiki></code>
|
[[Wikipedia:Manual of Style#Italics|Italics]] is a piped link to a section within another page.
|}
 
====Create a page link====
 
* To create a new page:
*# Create a link to it on some other (related) page.
*# Save that page.
*# Click on the link you just made. The new page will open for editing.
* For more information, see [[Wikipedia:Starting an article|starting an article]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].
* Please do not create a new article without linking to it from at least one other article.
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''Links to pages that don't exist yet look red.''
|
<code><nowiki>The article about [[cardboard sandwiches]] doesn't exist yet.</nowiki></code>
|
The article about [[cardboard sandwiches]] doesn't exist yet.
|}
 
===Redirects===
{{main|Help:Redirect}}
 
* [[Wikipedia:Redirect|Redirect]] one article title to another by placing a directive like the one shown to the right on the ''first'' line of the article (such as at a page titled "[[US]]").
* It is possible to redirect to a section. For example, a redirect to [[United States#History]] will redirect to the History section of the [[United States]] page, if it exists.
 
{| class="wikitable" border=1
! Description
! What you type
|-
|
''Redirect to an article''
|
<code><nowiki>#REDIRECT [[United States]] </nowiki></code>
|-
|
''Redirect to a section''
|
<code><nowiki>#REDIRECT [[United States#History]]</nowiki></code>
|}
 
===Link to another [[Help:namespace|namespace]]===
 
*The full page name should be included in double square brackets.
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>See the [[Wikipedia:Manual of Style]].</nowiki></code>
|
See the [[Wikipedia:Manual of Style]].
|}
 
===Link to the same article in another language (interlanguage links)===
{{main|Help:Interlanguage links|Wikipedia:Complete list of language wikis available}}
{{notice|After the launch of [[Wikipedia:Wikidata|Wikidata]], interlanguage links are now added through it. Links in articles should exist only in special cases, for example when an article in one language has two articles in another language.}}
 
* To link to a corresponding page in another language, use the form: <code><nowiki>[[</nowiki><em>language code</em>:<em>Foreign title</em><nowiki>]]</nowiki></code>.
* It is recommended interlanguage links be placed at the very end of the article.
* Interlanguage links are '''NOT visible''' within the formatted article, but instead appear as language links on the sidebar (to the left) under the menu section "languages".
 
* '''NOTE:''' To create an '''''inline link''''' (a clickable link within the text) to ''any'' foreign language article, see [[Help:Interlanguage links#Inline interlanguage links]] and consider the usage notes.
 
{| class="wikitable"
! Description
! What you type
|-
|
''Link from English article "Plankton" to the Spanish article [[:es:Plancton|"Plancton"]].''
 
''"es" is the language code for "{{lang|es|español}}" (the [[Spanish language]]).''
|
<pre>
[[es:Plancton]]
</pre>
 
|-
|
''Other examples: French (<code>fr</code> for {{lang|fr|français}}), German (<code>de</code> for {{lang|de|Deutsch}}), Russian (<code>ru</code>), and simple English (<code>simple</code>).''
|
<pre>
[[fr:Plancton]]
[[de:Plankton]]
[[ru:Планктон]]
[[simple:Plankton]]
</pre>
 
|}
 
===Interwiki link===
 
* [[Help:Interwiki links|Interwiki links]] link to any page on other wikis. [[Help:Interwikimedia links|Interwikimedia links]] link to other Wikimedia wikis.
* Note that interwikimedia links use the internal link style, with double square brackets.
* See [[MetaWikiPedia:Interwiki_map|Meta-Wiki:Interwiki map]] for the list of shortcuts; if the site you want to link to is not on the list, use an [[#External links|external link]].
* See also [[Wikipedia:Wikimedia sister projects]].
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
| colspan="3"|
Linking to a page on another wiki in English.
 
All of these forms lead to the URL <em>https://en.wiktionary.org/wiki/hello</em>.
|-
|
''Simple link.''
 
''Without prefix.''
 
''Named link.''
|
<code><nowiki>[[Wiktionary:hello]]</nowiki></code>
 
<code><nowiki>[[Wiktionary:hello|]]</nowiki></code>
 
<code><nowiki>[[Wiktionary:hello|Wiktionary definition of "hello"]] </nowiki></code>
|
[[Wiktionary:hello]]
 
[[Wiktionary:hello|hello]]
 
[[Wiktionary:hello|Wiktionary definition of "hello"]]
|-
| colspan="3"|
Linking to a page on another wiki in another language.
 
All of these forms lead to the URL <em>https://fr.wiktionary.org/wiki/bonjour</em>.
|-
|
''Simple link.''
 
''Without prefix.''
 
''Named link.''
|
<code><nowiki>[[Wiktionary:fr:bonjour]]</nowiki></code>
 
<code><nowiki>[[Wiktionary:fr:bonjour|]]</nowiki></code>
 
<code><nowiki>[[Wiktionary:fr:bonjour|bonjour]]</nowiki></code>
|
[[Wiktionary:fr:bonjour]]
 
[[Wiktionary:fr:bonjour|fr:bonjour]]
 
[[Wiktionary:fr:bonjour|bonjour]]
|}
 
===Categories===
 
* To put an article in a [[Wikipedia:Categorization|category]], place a link like <code><nowiki>[[Category:Example]]</nowiki></code> into the article. As with interlanguage links, placing these links at [[WP:FOOTERS|the end of the article]] is recommended.
* To link to a category page without putting the article into the category, use a colon prefix (":Category") in the link.
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''Categorize an article.''
|
<code><nowiki>[[Category:Character sets]]</nowiki></code>
|
|-
|
''Link to a category.''
|
<code><nowiki>[[:Category:Character sets]]</nowiki></code>
|
[[:Category:Character sets]]
|-
|
''Without prefix.''
|
<code><nowiki>[[:Category:Character sets|]]</nowiki></code>
|
[[:Category:Character sets|Character sets]]
|}
 
===External links===
<!-- linked from [[Wikipedia:External links]] -->
 
*Single-square brackets indicate an external link. Note the use of a ''space'' (not a pipe |) to separate the URL from the link text in a named link. Square brackets may be used as normal punctuation when not linking to anything – [like this].
*A [[Uniform Resource Locator|URL]] must begin with a supported [[URI scheme]]: <code>https://</code> (preferably) and <code>http://</code> will be supported by all browsers; <code>irc://</code>, <code>ircs://</code>, <code>ftp://</code>, <syntaxhighlight lang="text" inline>news://</syntaxhighlight>, <code>mailto:</code>, and <code>gopher://</code> will require a plugin or an external application. IPv6 addresses in URLs are currently not supported.
*A URL containing certain characters will display and link incorrectly unless those characters are [[Percent-encoding|percent encoded]]. For example, a space must be replaced by <code>%20</code>. Encoding can be achieved by:
:*Use the link button [[File:OOjs UI icon link-ltr.svg]] on the enhanced editing toolbar to encode the link; this tool will add the bracket markup and the linked text, which may not always be desirable.
:*Or manually encode the URL by replacing these characters:
 
{| class="wikitable" style="margin-left: 5em"
! ''space'' !! " !! ' !! , !! ; !! < !! > !! ? !! [ !! ]
|-
| %20 || %22 || %27 || %2c || %3b || %3c || %3e || %3f || %5b || %5d
|}
:*Or use the <code><nowiki>{{urlencode:}}</nowiki></code> magic word. See [[:mw:Help:Magic words#URL data|Help:Magic words]] in the MediaWiki documentation for more details.
 
* See [[Wikipedia:External links]] for style issues, and [[:Category:External link file type templates]] for indicating the file type of an external link with an icon.
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''Named link'' with an [[Help:external link icons|external link icon]]
|
<code><nowiki>[https://www.wikipedia.org Wikipedia]</nowiki></code>
|
[https://www.wikipedia.org Wikipedia]
|-
|
''Unnamed link''
 
''(Used only within article body for footnotes)''
|
<code><nowiki>[https://www.wikipedia.org]</nowiki></code>
|
[https://www.wikipedia.org]
|-
|
''Bare URL''
 
''(Bad style)'' 
 
use <nowiki><nowiki></nowiki></nowiki> to keep this bad style from showing
|
<code><nowiki>https://www.wikipedia.org</nowiki></code>
|
https://www.wikipedia.org
|-
|
''Link without arrow''
 
''(Not often used)''
|
<code><nowiki><span class="plainlinks">[https://www.wikipedia.org Wikipedia]</span></nowiki></code>
|
<span class="plainlinks"> [https://www.wikipedia.org Wikipedia]</span>
|}
 
===Miscellaneous===
 
===="As of" template====
 
* The "[[Wikipedia:As of|as of]]" technique generates phrases like "As of April 2009" or "as of April 2009", and categorize information that will need updating. For an explanation of the parameters see the {{tl|As of}} template documentation.
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>{{As of|2009|4|df=us}}</nowiki></code>
|
{{As of|2009|4|df=us}}
|-
|
<code><nowiki>{{As of|2009|4|df=us|lc=y}}</nowiki></code>
|
{{As of|2009|4|df=us|lc=y}}
|}
 
====Media link====
 
* To include links to non-image uploads such as sounds, use a "media" link. For images, [[#Images|see next section]].
* Some uploaded sounds are listed at [[Commons:Sound]].
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[media:Classical guitar scale.ogg|Sound]]</nowiki></code>
|
[[Media:Classical guitar scale.ogg|Sound]]
|}
 
====Links directly into edit mode====
*These create links that directly go to the edit or view source tab. For example, to create links to the edit tab for this page, either of the following works:
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
Using the {{tl|fullurl}} template
|
<code><nowiki>[{{fullurl:Help:Wiki markup|action=edit}} edit]</nowiki></code>
|
[{{fullurl:Help:Wiki markup|action=edit}} edit]
|-
|
Using the {{tl|Edit}} template
|
<code><nowiki>{{edit}}</nowiki></code>
|
{{edit}}
|}
 
====Links partially italicized====
 
*Linking to a page with a title containing words that are usually italicized, such as the [[Hindenburg disaster|''Hindenburg'' disaster]] article.
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[Hindenburg disaster|''Hindenburg'' disaster]]</nowiki></code>
|
[[Hindenburg disaster|''Hindenburg'' disaster]]
|}
 
==Pronunciation aids==
 
It is often desirable to provide an aid to pronunciation for a word. The [[Template:IPAc-en|''IPAc-en'']] and [[Template:Respell|''Respell'']] templates can be of assistance.
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>'''Konjac''' {{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}}</nowiki></code>
|
'''Konjac''' {{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}}
|-
|
<code><nowiki>'''Konjac''' ({{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}} {{respell|KOHN|yak}})</nowiki></code>
|
'''Konjac''' ({{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}} {{respell|KOHN|yak}})
|-
|
<code><nowiki>''Konjac'' is pronounced {{IPAc-en|ˈ|k|oʊ|n|j|æ|k}} in English.</nowiki></code>
|
''Konjac'' is pronounced {{IPAc-en|ˈ|k|oʊ|n|j|æ|k}} in English.
|}
 
Refer to [[Wikipedia:Manual of Style (pronunciation)]] for more information.
 
==Musical notation==
{{main|Help:Score}}
Musical notation is added by using the {{xtag|score|p}} [[mw:Manual:Tag_extensions|extension]] HTML-like tag. For example:
:
{{markup
|<nowiki><score>\relative c' { fis d fis a d f e d c cis d e a g f ees }</score></nowiki>
|<score>\relative c' { fis d fis a d f e d c cis d e a g f ees }</score>
}}
 
==Images==
{{Main page|Help:Visual file markup|Wikipedia:Images}}
Only images that have been uploaded to Wikipedia or [[commons:Main Page|Wikimedia Commons]] can be used. To upload images, use the [[:commons:Special:UploadWizard|Commons upload wizard]] for photos you have taken, and the [[Special:Upload|Wikipedia upload page]] if there may be copyright issues. You can find the uploaded image on the [[Special:Imagelist|image list]].
 
See the Wikipedia's [[Wikipedia:Image use policy|image use policy]] for the policy used on Wikipedia.
 
For further help on images, including some more versatile abilities, see the [[WP:PIC|picture tutorial]] and [[Wikipedia:Extended image syntax|extended image syntax]].
 
{| class="wikitable"
|-
! What you type
! What it looks like
! Notes
|- style="vertical-align:top;"
| <pre style="white-space: pre-wrap;">The image name, the word thumb then the caption :
<nowiki>[[File:wiki.png|thumb|Wikipedia logo]]</nowiki></pre>
 
| The image name, the word thumb then the caption :
[[File:wiki.png|thumb|alt=Puzzle globe|Wikipedia logo]] {{clear}}
 
|
* The thumb tag automatically allows the image to be enlarged and positions it (floats) automatically to the right of the page.
* An enlarge icon is placed in the lower right corner.
* See note below about adding an [[#alt tag|alt tag]]
* This is the basic markup for most images
 
 
|- style="vertical-align: top;"
| <pre>A picture: <nowiki>[[File:wiki.png]]</nowiki></pre>
 
| A picture: [[File:wiki.png]]
 
|
* The picture name alone places the image in the text, or on the next line if there is insufficient space.
* Embedding the image in the text is only possible for very small images.
* Embedding the image will affect the vertical formatting of text.
|- style="vertical-align: top;"
| <pre>With alternative text:
<nowiki>[[File:wiki.png|alt=Puzzle globe logo]]</nowiki></pre>
 
| With alternative text:
[[File:wiki.png|alt=Puzzle globe logo]]
 
|
* {{anchor|alt tag}}Alternative text, used when the image is unavailable or when the image is loaded in a text-only browser, or when spoken aloud, is '''strongly''' encouraged. See [[Wikipedia:Alternative text for images|Alternative text for images]] for help on choosing it.
 
|- style="vertical-align:top;"
| <pre>With link:
<nowiki>[[File:wiki.png|link=Wikipedia]]</nowiki></pre>
 
| With link:
[[File:wiki.png|link=Wikipedia]] {{clear}}
|
* The link directs to the Wikipedia page, [[Wikipedia]], instead of the image file page.
 
|- style="vertical-align:top;"
| <syntaxhighlight lang="moin" style="white-space: pre-wrap;">Forced to the centre of the page
using the ''frame'' tag (attribute), a ''centre'' tag and a caption:
[[File:wiki.png|frame|centre|alt=Puzzle globe|Wikipedia logo]]</syntaxhighlight>
 
| Forced to the centre of the page using the ''frame'' tag (attribute), a ''centre'' tag and a caption:
[[File:wiki.png|frame|centre|alt=Puzzle globe|Wikipedia logo]] {{clear}}
 
|
* The frame tag automatically floats the image right.
* The frame tag is only of use with very small images or ones using the [[#px tag|px tag]]
* The attributes left, center or centre override this, and places the image to the left or the centre of the page. {{anchor|upright tag}}
* The last parameter is the caption that appears below the image.
 
|- style="vertical-align:top;"
| <syntaxhighlight lang="moin" style="white-space: pre-wrap;">Forced to the left side of the page
using the ''thumb'' attribute, the ''left'' attribute  and a caption:
[[File:wiki.png|thumb|left|alt=Puzzle globe|Wikipedia logo]]</syntaxhighlight>
 
| Forced to the left side of the page using the ''thumb'' attribute, the ''left'' attribute  and a caption:
[[File:wiki.png|thumb|left|alt=Puzzle globe|Wikipedia logo]] {{clear}}
 
|
* The thumb tag automatically floats the image right.
* An enlarge icon is placed in the lower right corner.
* The attributes left, center or centre override this, and places the image to the left or the centre of the page.
 
|- style="vertical-align:top;"
| <syntaxhighlight lang="moin" style="white-space: pre-wrap;">Forced to the right side of the page
''without'' a caption:
[[File:wiki.png|right|Wikipedia encyclopedia]]</syntaxhighlight>
 
| Forced to the right side of the page ''without'' a caption:
[[File:wiki.png|right|Wikipedia encyclopedia]]
|
* Captions are only displayed when the thumb or frame attributes are present
* The [[WP:PIC|picture tutorial]] explains more options.
 
|- style="vertical-align:top;"
| <pre>A picture resized to 50 pixels...
<nowiki>[[File:wiki.png|50 px|Wikipedia encyclopedia]]</nowiki></pre>
 
| A picture resized to 50 pixels width...
[[File:wiki.png|50 px|Wikipedia encyclopedia]]
 
|
* {{anchor|px tag}}The [[WP:PIC|picture tutorial]] explains more options.
* Sizing in pixels is deprecated and should be used very sparingly.
* There is an [[#upright tag|''upright'' attribute]] that should be used instead. These tags are optimised for both laptop and mobile phone screens.
 
|- style="vertical-align:top;"
| <pre>Linking directly to the description page of an image:
<nowiki>[[:File:wiki.png]]</nowiki></pre>
 
| Linking directly to the description page of an image:
[[:File:wiki.png]]
 
|
* Clicking on an image displayed normally on a page also leads to the description page.
 
|- style="vertical-align:top;"
| <pre>Linking directly to an image without displaying it:
<nowiki>[[Media:wiki.png|Image of jigsaw globe]]</nowiki></pre>
 
| Linking directly to an image without displaying it:
[[Media:Wiki.png|Image of jigsaw globe]]
 
|
* To include links to images shown as links instead of drawn on the page, use a "media" link.
 
|- style="vertical-align:top;"
|
<syntaxhighlight lang="html">Example:
<div style="display: inline; width: 220px; float: right;">
[[File:wiki.png|50 px|Wikipedia encyclopedia]][[File:wiki.png|50 px]] </div></syntaxhighlight>
 
|
Example:
<div style="display: inline; width: 220px; float: right;">
[[File:wiki.png|50 px|Wikipedia encyclopedia]][[File:wiki.png|50 px]] </div>
 
|
* Using the [[span and div|<code>span</code> or <code>div</code> elements]] to separate images from text (note that this may allow images to cover text).
 
|- style="vertical-align:top;"
|
<pre><nowiki>Example:
 
{| align=right
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|}</nowiki></pre>
 
|
Example:
 
{| align=right
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|}
 
|
*Using wiki markup to make a table in which to place a vertical column of images (this helps edit links match headers, especially in Firefox browsers).
|}
 
==Tables==
{{main|Help:Table}}
{{See also|Wikipedia:Manual of Style/Tables#Appropriate}}
There are two ways to build tables:
* Using specific wiki markup: (see [[Help:Table]]).
* Using HTML elements: {{tag|table|o}}, {{tag|tr|o}}, {{tag|td|o}} or {{tag|th|o}}.
 
==Columns==
{{main|Help:Columns}}
Use {{tl|colbegin}} and {{tl|colend}} templates to produce columns.
 
==References and citing sources==
{{main|Wikipedia:Citing sources|Help:Footnotes}}
{{see also|APA style|The Chicago Manual of Style{{!}}Chicago style|Harvard style|MLA style}}
 
Making a reference citing a printed or online source can be accomplished by using the {{tag|ref}} wiki markup tags. Inside these tags details about the reference are added.
 
Details about the citation can be provided using a structure provided by various templates; the table below lists some typical citation components.
 
{| class="wikitable"
|-
! What it's for !! What you type
|-
| {{Nowrap|To create the reference}} || {{tag|ref|params=name="reference name"|content=''add_template_name_here''}}
|-
| To cite a book || {{Tlx|cite book}}
|-
| To cite a web source || {{Tlx|cite web}}
|-
| Book ISBN || {{para|isbn|0-4397-0818-4}} (ISBN of the book)
|-
| Web URL || {{para|url|ht<nowiki />tps://www.wikipedia.org}}
|-
| Title || {{para|title|title of source}}
|-
| Author || {{para|author|authors, use commas for multiple}}
|-
| First name || {{para|first|first name}}
|-
| Last name || {{para|last|last name}}
|-
| Location || {{para|location|location of publisher}}
|-
| Publisher || {{para|publisher|who published the source}}
|-
| Date || {{para|date|2007-09-21}} (date of source)
|-
| Year || {{para|year|year of source}}
|-
| Accessed date || {{para|access-date|2008-12-25}} (only if url= is included)
|-
| A complete reference tag || {{tag|ref|o|params=name="Wiki markup"}}<code><nowiki>{{cite web |url=https://en.wikipedia.org/wiki/Help:Wiki_markup |title=Help:Wiki markup |publisher=Wikimedia Foundation}}</nowiki></code>{{tag|ref|c}}
|-
| Referencing this again || {{tag|ref|s|params=name="Wiki markup"}}
|-
| Citation needed || {{tlx|Citation needed|{{tls|DATE}}}}
|}
 
==Templates and transcluding pages==
{{main|Wikipedia:Transclusion}}
{{see also|Help:Template#Noinclude, includeonly, and onlyinclude}}
 
Examples for templates: <nowiki>{{pad|...}}, {{math|...}}, {{as of|...}}, {{edit}}</nowiki>
 
'''[[Help:Template|Templates]]''' are segments of wiki markup that are meant to be copied automatically ("transcluded") into a page.
They are specified by putting the template's name in <nowiki>{{double braces}}</nowiki>. Most templates are pages in the [[WP:Template namespace|Template namespace]], but it is possible to transclude mainspace pages (articles) by using <nowiki>{{:colon and double braces}}</nowiki>.
 
There are three pairs of [[html element|tags]] that can be used in [[wikitext]] to control how transclusion affects parts of a template or article.
They determine whether or not wikitext renders, either in its own article, which we will call "'''here'''", or in another article where it is transcluded, which we will call "'''there'''".
* '''<nowiki><noinclude></nowiki>: ''' the content '''will not be rendered ''there'''''. These tags have no effect ''here''.
* '''<nowiki><includeonly></nowiki>: ''' the content  '''will render only ''there''''', and  '''will not render ''here''''' (like [[invisible ink]] made visible by means of transclusion).
* '''<nowiki><onlyinclude></nowiki>: ''' the content '''will render ''here''''' and '''will render ''there''''', but it will only render ''there'' what is between these tags.
There can be several such section "[[HTML#Elements|elements]]". Also, they can be nested. All possible renderings are achievable. For example, to render ''there'' one or more sections of the page ''here'' use '''<nowiki><onlyinclude></nowiki>''' tags. To append text ''there'', wrap the addition in '''<nowiki><includeonly></nowiki>''' tags before, within, or after the section. To omit portions of the section, nest '''<nowiki><noinclude></nowiki>''' tags within it.
 
If a page is transcluded without transclusion markup, it may cause an unintentional [[Help:Category#Putting_pages_in_categories|categorization]]. Any page transcluding it will contain the same category as the original page. Wrap the category markup with '''<nowiki><noinclude></nowiki>''' tags to prevent incorrect categorization.
{{anchor|hovertext}}
Some templates take ''parameters'', as well, which you separate with the pipe character <code>|</code>.
 
{| class="wikitable"
!width="500"| What you type
!width="1000"| What it looks like
|-
|
<pre>{{Transclusion demo}}</pre>
|
{{Transclusion demo}}
|-
|
<pre>{{Help:Transclusion demo}}</pre>
|
{{Help:Transclusion demo}}
|-
|
<pre>
This template takes two parameters,
and creates underlined text with a
hover box for many modern browsers
supporting CSS:
 
{{Tooltip|Hover your mouse over this text
|This is the hover text}}
 
Go to this page to see the Tooltip
template itself: {{tl|Tooltip}}
</pre>
|
 
This template takes two parameters,
and creates underlined text with a
hover box for many modern browsers
supporting CSS:
 
{{Tooltip|Hover your mouse over this text
|This is the hover text}}
 
Go to this page to see the Tooltip
template itself: {{tl|Tooltip}}
 
|}
 
==Talk and project pages==
These are likely to be helpful on [[Help:Using talk pages|talk]] and [[Wikipedia:Project namespace|project pages]].
 
===Signing comments===
 
*The  ''[[tilde]]'' character (~) is used when signing a comment on a talk page. Your username provides a link to your [[Wikipedia:user page|user page]].
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
|
''You should sign your comments by appending four tildes to the comment, which adds your user name plus date/time.''
|
<code><nowiki>~~~~</nowiki></code>
|
[[Special:Mypage|Username]] ([[Special:Mytalk|talk]]) {{CURRENTTIME}}, {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} (UTC)
|-
|
''Adding three tildes will add just your user name.''
|
<code><nowiki>~~~</nowiki></code>
|
[[Special:Mypage|Username]] ([[Special:Mytalk|talk]])
|-
|
''Adding five tildes gives the date/time alone.''
|
<code><nowiki>~~~~~</nowiki></code>
|
{{CURRENTTIME}}, {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} (UTC)
|}
 
===Linking to old revisions of pages, diffs, and specific history pages===
 
*The external link function is mainly used for these. Open an old revision or diff, and copy the [[URL]] from the address bar, pasting it where you want it.
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[//en.wikipedia.org/w/index.php?title=Help:Wiki_markup&diff=330350877&oldid=330349143 Diff between revisions 330349143 and 330350877]</nowiki></code>
|
[//en.wikipedia.org/w/index.php?title=Help:Wiki_markup&diff=330350877&oldid=330349143 Diff between revisions 330349143 and 330350877]
|}
 
*You can also use an [[Help:Diff#Internal links|internal diff link]]. '''Unlike the template {{tl|diff}}, this kind of link can even be used in edit summaries.'''
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[Special:Diff/330349143/330350877|Diff between revisions 330349143 and 330350877]]</nowiki></code>
|
[[Special:Diff/330349143/330350877|Diff between revisions 330349143 and 330350877]]
|}
 
*If the diff intended to be shown is between an immediately previous revision, the first parameter can be dropped.
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[Special:Diff/330350877|Diff between revisions 330349143 and 330350877]]</nowiki></code>
|
[[Special:Diff/330350877|Diff between revisions 330349143 and 330350877]]
|} 
 
*For an old revision, you can also use a [[Help:Permanent link|permalink]]. Though here only the main text is guaranteed to be retained (images and templates will be shown as they are today, not as they were at the time).
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[Special:Permalink/330350877|Revision 330350877]]</nowiki></code>
|
[[Special:Permalink/330350877|Revision 330350877]]
|}
 
===What links here, and recent changes linked===
 
*The following markup can be used. For example, for the article [[Beetroot]]:
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>[[Special:WhatLinksHere/Beetroot]]</nowiki></code>
|
[[Special:WhatLinksHere/Beetroot]]
|-
|
<code><nowiki>[[Special:RecentChangesLinked/Beetroot]]</nowiki></code>
|
[[Special:RecentChangesLinked/Beetroot]]
|}
 
===User edits===
 
*Link to a user's [[Help:User contributions|contributions page]].
 
{| class="wikitable"
! Description
! What you type
! What it looks like
|-
| ''Username (registered users).''
| <code><nowiki>[[Special:Contributions/UserName]]</nowiki></code>
| [[Special:Contributions/UserName]]
|-
| ''[[IPv4]] address (unregistered users).''
| <code><nowiki>[[Special:Contributions/192.0.2.0]]</nowiki></code>
| [[Special:Contributions/192.0.2.0]]
|-
| ''[[IPv6]] address (unregistered users).''
| <code><nowiki>[[Special:Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329]]</nowiki></code>
| [[Special:Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329]]
|}
 
===Coloring and highlighting text===
 
*Using the {{tl|Color}} and {{tl|Font color}} templates:
{| class="wikitable"
! What you type
! What it looks like
|-
|
 
<code><nowiki>I will change the color in {{color|blue|the middle part of}} this sentence.</nowiki></code>
 
|
 
I will change the color in {{color|blue|the middle part of}} this sentence.
 
|-
|
 
<code><nowiki>This is how to {{Font color||yellow|highlight part of a sentence}}.</nowiki></code>
 
|
 
This is how to {{Font color||yellow|highlight part of a sentence}}.
|}
 
===Example text===
The {{tlx|xt}} family of templates can be used on help pages and user pages to highlight e'''x'''ample tex'''t'''.
 
{{!bxt|These do not work in mainspace; that is, in articles.}}
{| class=wikitable
!What you type
!What you get
|-
|<kbd><nowiki>This is an {{</nowiki>'''xt'''<nowiki>|A correct example}} for comparison {{tick}}</nowiki></kbd>
|This is an {{xt|A correct example}} for comparison {{tick}}
|-
|<kbd><nowiki>this is an {{</nowiki>'''!xt'''<nowiki>|An incorrect example}} for example {{cross}}</nowiki></kbd>
|this is an {{!xt|An incorrect example}} for example {{cross}}
|-
|<kbd><nowiki>this is an {{</nowiki>'''mxt'''<nowiki>|In monospace}} for comparison</nowiki></kbd>
|this is an {{mxt|In monospace}} for comparison
|-
|<kbd><nowiki>this is an {{</nowiki>'''!mxt'''<nowiki>|In monospace}} for comparison</nowiki></kbd>
|this is an {{!mxt|In monospace}} for comparison
|-
|<kbd><nowiki>this is an {{</nowiki>'''bxt'''<nowiki>|in bold}} for comparison</nowiki></kbd>
|this is an {{bxt|In bold}} for comparison
|-
|<kbd><nowiki>this is an {{</nowiki>'''!bxt'''<nowiki>|In bold}} for comparison</nowiki></kbd>
|this is an {{!bxt|In bold}} for comparison
|}
 
===Show deleted or inserted text===
{{details|Wikipedia:Talk page guidelines#Editing own comments}}
* When editing regular Wikipedia articles, just make your changes, and do not mark them up in any special way, except when the article itself discusses deleted or inserted content, such as an amendment to a statute:
** to indicate deleted content, use {{tag|del}}
** to indicate inserted content, use {{tag|ins}}
* This also applies to changing one's own talk page comments. For more details, see [[WP:REDACT]].
 
{| class="wikitable"
! What you type
! What it looks like
|-
|
<code><nowiki>You can <del>indicate deleted material</del> and <ins>inserted material</ins>.</nowiki></code>
|
You can <del>indicate deleted material</del> and <ins>inserted material</ins>.
|}
 
===<span class="anchor" id="Strikethrough"></span> Strike through ===
{{see also|Help:HTML in wikitext#s}}
The {{tl|strike}} template marks up a span of text with the {{tag|s}} tag. This is usually renderend visually by drawing a horizontal line through it. Outside of articles, it can be used to mark something as no longer accurate or relevant without removing it from view. Do not use it, however, to indicate document edits. For that, use the {{tag|del}} tag instead. See {{slink||Show deleted or inserted text}} for details.
{| class=wikitable
!What you type
!What you get
|-
|<kbd><nowiki>This is {{</nowiki>'''strike'''<nowiki>|an obsolete stretch of text}} for comparison</nowiki></kbd>
|This is {{strike|an obsolete stretch of text}} for comparison
|}
 
=={{anchor|Limiting formatting}} Limiting formatting / escaping wiki markup==
 
A few different kinds of formatting will tell the wiki to display things as you typed them – what you see is what you get!
 
{| class="wikitable" style="margin-right:0em;"
|-
!What you type
!What it looks like
|-
|
<syntaxhighlight lang="tid">
'''&lt;nowiki&gt; tag:'''
 
<nowiki>
The <nowiki> tag ignores [[wiki]]
''markup''. It reformats text by
removing newlines and    multiple
spaces.      It still interprets
characters specified by
&amp;name;: &rarr;
</nowiki>
</syntaxhighlight>
|
'''&lt;nowiki&gt; tag:'''
 
<nowiki>
The <nowiki> tag ignores [[wiki]]
''markup''. It reformats text by
removing newlines and    multiple
spaces.      It still interprets
characters specified by
&amp;name;: &rarr;
</nowiki>
|-
|
<syntaxhighlight lang="tid">
'''&lt;pre&gt; tag:'''
 
<pre>The &lt;pre&gt; tag ignores [[wiki]]
''markup'' as does the &lt;nowiki&gt;
tag. Additionally, &lt;pre&gt; displays
in a mono-spaced font, and does
not  reformat    text    spaces.
It still interprets special
characters: &rarr;</pre>
</syntaxhighlight>
|
'''&lt;pre&gt; tag:'''
 
<pre>The &lt;pre&gt; tag ignores [[wiki]]
''markup'' as does the &lt;nowiki&gt;
tag. Additionally, &lt;pre&gt; displays
in a mono-spaced font, and does
not  reformat    text    spaces.
It still interprets special
characters: &rarr;</pre>
|-
|
<pre>'''[Text without a URL]:'''
 
Single square brackets holding
[text without a HTTP URL] are
preserved, but single square
brackets containing a URL are
treated as being an external
[https://example.com/ Web link].</pre>
|
'''[Text without a URL]:'''
 
Single square brackets holding
[text without a HTTP URL] are
preserved, but single square
brackets containing a URL are
treated as being an external
[https://example.com/ Web link].
|-
|
<syntaxhighlight lang="tid">'''Leading space:'''
 
Leading spaces are another way
to preserve formatting.
Putting a space at the
beginning of each line
stops the text  from
being reformatted.
It still interprets [[wiki]]
''markup'' and special characters: &amp;</syntaxhighlight>
|
'''Leading space:'''
 
Leading spaces are another way
to preserve formatting.
Putting a space at the
beginning of each line
stops the text  from
being reformatted.
It still interprets [[wiki]]
''markup'' and special characters: &rarr;
|}
 
===Nowiki===
{{anchor|NOWIKI}}
{{redirect|WP:NOWIKI|the essay about the name "Wiki"|Wikipedia:Don't abbreviate "Wikipedia" as "Wiki"!}}
{{shortcut|H:NOWIKI|WP:NOWIKI}}
 
:{{tag|nowiki}} (wiki markup contained between these two tags is displayed as normal text)
:{{tag|nowiki|s}} (wiki markup that is interrupted by this tag is displayed as normal text, as detailed in examples below)
 
These two kinds of nowiki operate in different ways, but both neutralize the rendering of wiki markup as shown in the examples below. For example, the characters that have wiki markup meaning at the beginning of a line ({{code|*}}, {{code|#}}, {{code|;}} and {{code|:}}) can be rendered in normal text. Editors can normalize the font of characters trailing a wikilink, which would otherwise appear in the wikilink font. And newlines added to wikitext for readability can be ignored.
 
Note to template editors: tag {{tag|nowiki|o}} works only on its source page, not the target.
 
{{markup
|<nowiki># Ordered list</nowiki>
|{{crlf2}}
# Ordered list
|<nowiki><nowiki /># Ordered list</nowiki>
|{{crlf2}}
<nowiki /># Ordered list
|<nowiki>A [[micro-]]second.</nowiki>
|A [[micro-]]second.
|<nowiki>A [[micro-]]<nowiki />second.</nowiki>
|A [[micro-]]<nowiki />second.
|<nowiki>a<nowiki>
 
</nowiki>b</nowiki>
|a<nowiki>
 
</nowiki>b
|<nowiki>'<nowiki />'Italics' markup'<nowiki />'</nowiki>
|'<nowiki />'Italics' markup'<nowiki />'
|<nowiki><nowiki>[[Example]]</nowiki></nowiki>
|<nowiki>[[Example]]</nowiki>
|&lt;nowiki>&lt;!-- revealed -->&lt;/nowiki>
|  <nowiki>  <!-- revealed -->    </nowiki>
}}
 
The rest of the section consists of simple, live examples showing how a single nowiki tag escapes entire linkage structures, beyond [[&nbsp;wikilink&nbsp;<nowiki />]] and {{&nbsp;template&nbsp;<nowiki />}}:
 
:[[ ''[[wp:fullpagename|fullpagename]]'' <nowiki />| ''label'' ]]
:{{ ''pagename'' <nowiki />| ''parameter'' }}
:[[ ''fullpagename'' | {{ ''pagename'' }<nowiki />} ]<nowiki />]
:{{ ''pagename'' | [[ ''fullpagename'' ]<nowiki />] }}
:{{ ''pagename'' <nowiki />| {{ ''pagename'' }<nowiki />} }}
 
Unless you use the two "balanced" nowiki tags, troubleshooting [[help:strip markers|strip marker]] errors and template parameter-handling inconsistencies is a risk. Also, a rendering error may arise when two <kbd>[<nowiki />[...]]</kbd> square brackets are on the same line, or two <kbd>{<nowiki />{...}}</kbd> curly brackets are in the same section, but only when the two have the nowiki markup placed inconsistently.
 
====Displaying wikilinks====
 
(These are all live examples.)
 
<pre>
[[ wp:pagename | page name ]]
[<nowiki />[ wp:pagename | page name ]]
[[<nowiki /> wp:pagename | page name ]]
[[ wp:pagename <nowiki />| page name ]]
[[ wp:pagename | page name ]<nowiki />]</pre>
 
<poem>
:[[ wp:pagename | page name ]]
:[<nowiki />[ wp:pagename | page name ]]
:[[<nowiki /> wp:pagename | page name ]]
:[[ wp:pagename <nowiki />| page name ]]
:[[ wp:pagename | page name ]<nowiki />]
</poem>
 
For '''nested structures''', escaping an inner structure escapes its outer structure too.
 
<pre>
[[ wp: {{ 1x | pagename }} ]]
[[ wp: {<nowiki />{ 1x | pagename }} ]]
[[ wp: {{<nowiki /> 1x | pagename }} ]]
[[ wp: {{ 1x <nowiki />| pagename }} ]]</pre>
 
<poem>
:[[ wp: {{ 1x | pagename }} ]]
:[[ wp: {<nowiki />{ 1x | pagename }} ]]
:[[ wp: {{<nowiki /> 1x | pagename }} ]]
:[[ wp: {{ 1x <nowiki />| pagename }} ]]
</poem>
 
For '''two, first pipes''', two nowiki tags are required:
 
<pre>
[[ wp: pagename | {{ 1x | label }} ]]
[[ wp: pagename <nowiki />| {{ 1x <nowiki />| label }} ]]
&lt;nowiki>[[ wp: pagename | {{ 1x | label }} ]] &lt;/nowiki></pre>
 
<poem>
:[[ wp: pagename | {{ 1x | label }} ]]
:[[ wp: pagename <nowiki />| {{ 1x <nowiki />| label }} ]]
:<nowiki>[[ wp: pagename | {{ 1x | label }} ]] </nowiki>
</poem>
 
====Displaying template calls====
{{See also|Template:tl}}
 
For templates, put nowiki before the first pipe.
If a parameter has a wikilink, put it in that, an inmost position.
 
<pre>
{<nowiki />{ val | u=&amp;gt; [[ms]] | 49082 }}
{{<nowiki /> val | u=&amp;gt; [[ms]] | 49082 }}
{{ val <nowiki />| u=&amp;gt; [[ms]] | 49082 }}
{{ val | u= &gt; [[ms]] | 49082 }<nowiki />}
{{ val | u= &gt; [[ ms ]<nowiki />] | 49082 }} </pre>
 
<poem>
:{<nowiki />{ val | u=&gt; [[ms]] | 49082 }}
:{{ val | u= &gt; [[ms]] | 49082 }<nowiki />}
:{{<nowiki /> val | u=&gt; [[ms]] | 49082 }}
:{{ val <nowiki />| u=&gt; [[ms]] | 49082 }}
:{{ val | u= &gt; [[ ms ]<nowiki />] | 49082 }} {{OK}}
</poem>
 
====Displaying magic words====
{{Further|Help:Magic words|Help:Parser function}}
 
For input '''parameters''', {{{1}}}, {{{2}}}, just write them out, unless they have a default (which goes behind their pipe):
{{&lt;nowiki />{1|default}}} &rarr; {{<nowiki />{1|default}}}
 
For a '''parser function''' nowiki goes between bracketing-pair characters, or anywhere before the : colon.
 
<pre>
{{ #ifeq: inYes | inYes | outYes | outNo }}
{<nowiki />{ #ifeq: inYes | inYes | outYes | outNo }}
{{<nowiki /> #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq<nowiki />: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }<nowiki />}</pre>
 
<poem>
:{{ #ifeq: inYes | inYes | outYes | outNo }}
:{<nowiki />{ #ifeq: inYes | inYes | outYes | outNo }}
:{{<nowiki /> #ifeq: inYes | inYes | outYes | outNo }}
:{{ #ifeq<nowiki />: inYes | inYes | outYes | outNo }}
:{{ #ifeq: inYes | inYes | outYes | outNo }<nowiki />}
</poem>
 
'''Behavioral switches''' expect the tag anywhere:
 
<pre>
1. __HIDDENCAT__
2. __HIDDENCAT<nowiki />__</pre>
 
:1. __HIDDENCAT__{{break}}
:2. __HIDDENCAT<nowiki />__
 
====Displaying tags====
 
Tags do not display; they are just markup. If you want them to, insert {{tag|nowiki|s}} after an {{code|<}} opening angle bracket; it goes only in the very front. Opening tags and closing tags must be treated separately.
 
<pre>
<span style=color:blue> Blue </span>
<<nowiki />span style=color:blue> Blue <<nowiki />/span>
<section end=la<nowiki />bel />
<<nowiki />section end=label /></pre>
 
<poem>
:<span style=color:blue> Blue </span>
:<<nowiki />span style=color:blue> Blue <<nowiki />/span>
:<section end=la<nowiki />bel /> {{cross}}
:<<nowiki />section end=label /> {{tick}}
</poem>
 
Use template {{tl|tag}} instead of nowiki tags to display parser tags:
 
'''Character entities''', nowiki cannot escape. 
To escape HTML or special character entities, replace <code>&</code> with <code>&amp;amp;</code>.
For example, <code>&amp;amp;lt;</code> &rarr; <code>&amp;lt;</code>
 
To '''display a nowiki tag''', you can (1) use {{tl|tag}}, (2) replace the < left angle bracket with its HTML character entity, or (3) nest nowiki tags in each other:
 
<pre>
{{ tag | nowiki }}
<code>&amp;lt; nowiki>...&amp;lt;/ nowiki ></code>
<code><<nowiki />nowiki>...<<nowiki />/ nowiki ></code></pre>
 
<poem>
:{{ tag | nowiki }}
:<code>&lt; nowiki>...&lt;/ nowiki ></code>
:<code><<nowiki /> nowiki>...<<nowiki />/ nowiki ></code>
</poem>
 
<pre>
{{ tag | nowiki | s }}
<code>&amp;lt; nowiki /></code>
<code>&lt;&lt;nowiki /> nowiki /></code>
<code>&lt;nowiki>&lt; nowiki />&lt;/nowiki></code></pre>
 
<poem>
:{{ tag | nowiki | s }}
:<code>&lt; nowiki /></code>
:<code><<nowiki /> nowiki /></code>
:<code><nowiki>< nowiki /></nowiki></code>
</poem>
 
Nowiki tags do not otherwise nest, so it is the second and fourth that displays:
 
<pre>
1&lt;nowiki>2&lt;nowiki>3</nowiki>4</nowiki>
&lt;nowiki>{{!}}&lt;nowiki></nowiki>{{!}}</nowiki>
</pre>
 
<poem>
:1<nowiki>2<nowiki>3</nowiki>4</nowiki> {{spaces|5}} ''{{small|second and fourth}}''
:<nowiki>{{!}}<nowiki></nowiki>{{!}}</nowiki>
</poem>
 
These simply scan from left to right.
The paired tags cannot overlap, because the very first pair-match nullifies any intervening tags inside. Unbalanced tags always display.
 
Nowiki tags do not display table markup, use {{tag|pre}}.
 
===Pre===
{{shortcut|WP:PRE}}
 
{{tag|pre|o}} is a parser tag that emulates the HTML {{tag|pre|o}} tag. It defines preformatted text that is displayed in a fixed-width font and is enclosed in a dashed box. HTML and wiki markups are escaped and spaces and line breaks are preserved, but HTML entities are parsed.
 
{{markup|title={{tag|pre|o}} examples
|<syntaxhighlight lang="tid"><pre><!--Comment-->
 
[[wiki]] markup &amp;</pre></syntaxhighlight>
|<syntaxhighlight lang="text"><!--Comment-->
 
[[wiki]] markup &amp;</syntaxhighlight>
}}
 
As {{tag|pre|o}} is a parser tag, it escapes wikitext and HTML tags. This can be prevented with the use of <nowiki><includeonly></includeonly></nowiki> within the {{tag|pre|o}}, making it act more like its HTML equivalent:
 
{{markup|title={{tag|pre|o}} with <nowiki><includeonly></includeonly></nowiki> example
|<syntaxhighlight lang="tid"><pre<includeonly></includeonly>><!--Comment-->
 
[[wiki]] markup &amp;</pre></syntaxhighlight>
|<pre<includeonly></includeonly>><!--Comment-->
 
[[wiki]] markup &amp;</pre>
}}
 
Invisible HTML {{tag|pre|o}} tags can also be inserted by preceding text with a space character, like:
 
<!--Comment-->
[[wiki]] markup &amp;
 
Alternatively, consider using {{tl|pre}} template or {{xtag|syntaxhighlight|p|params=lang="text"}}.
 
==Invisible text (comments)==
{{see also|Help:Hidden text}}
 
It's uncommon{{spaced ndash}}but on occasion acceptable for notes to other editors{{spaced ndash}}to add a hidden comment within the text of an article. These comments are visible only when editing or viewing the source of a page. Most comments should go on the appropriate [[Wikipedia:Talk page|Talk page]]. <!-- This is an example of text that is not visible except in "edit" mode. --> The format is to surround the hidden text with "<code>&lt;!--</code>" and "<code>--&gt;</code>" and may cover several lines, e.g.:
<nowiki><!-- An example of hidden comments
This won't be visible except in "edit" mode. --></nowiki>
 
Another way to include a comment in the wiki markup uses the {{tl|Void}} template, which can be abbreviated as {{tl|^}}. This template "expands" to the empty string, generating no HTML output; it is visible only to people editing the wiki source. Thus {{nowrap|1=<code>{{tlp|^|A lengthy comment here}}</code>}} operates similarly to the comment {{nowrap|1=<code>&lt;!-- A lengthy comment here --&gt;</code>}}. The main difference is that the template version can be nested, while attempting to nest HTML comments produces odd results.
 
==Variables==
 
{{seealso| Help:Magic words#Variables}}
 
{| style="text-align:center" class="wikitable"
|-
! Code
! Effect
! Notes
|-
| <nowiki>{{CURRENTWEEK}}</nowiki> || {{CURRENTWEEK}}
|
|-
| <nowiki>{{CURRENTDOW}}</nowiki> || {{CURRENTDOW}}
|
Monday = 1, Tuesday = 2, etc., but Sunday = 0
 
|-
| <nowiki>{{CURRENTMONTH}}</nowiki> || {{CURRENTMONTH}}
|
|-
| <nowiki>{{CURRENTMONTHNAME}}</nowiki>
| {{CURRENTMONTHNAME}}
|
|-
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki>
| {{CURRENTMONTHNAMEGEN}}
|
|-
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}
|
|-
| <nowiki>{{CURRENTDAYNAME}}</nowiki> || {{CURRENTDAYNAME}}
|
|-
| <nowiki>{{CURRENTYEAR}}</nowiki> || {{CURRENTYEAR}}
|
|-
| <nowiki>{{CURRENTTIME}}</nowiki> || {{CURRENTTIME}}
|
|-
| <nowiki>{{NUMBEROFARTICLES}}</nowiki>
| {{NUMBEROFARTICLES}}
|
|-
| <nowiki>{{NUMBEROFPAGES}}</nowiki>
| {{NUMBEROFPAGES}}
|
|-
| <nowiki>{{NUMBEROFUSERS}}</nowiki>
| {{NUMBEROFUSERS}}
|
|-
| <nowiki>{{PAGENAME}}</nowiki> || {{PAGENAME}}
|
|-
| <nowiki>{{NAMESPACE}}</nowiki> || {{NAMESPACE}}
|
|-
| <nowiki>{{REVISIONID}}</nowiki> || {{REVISIONID}}
|
|-
| <nowiki>{{REVISIONUSER}}</nowiki> || {{REVISIONUSER}}
|
|-
| <nowiki>{{localurl:pagename}}</nowiki>
| {{localurl:pagename}}
|
|-
| <nowiki>{{localurl:</nowiki>''Wikipedia:Sandbox''<nowiki>|action=edit}}</nowiki>
| {{localurl:Wikipedia:Sandbox|action=edit}}
|
|-
| <nowiki>{{fullurl:pagename}}</nowiki>
| {{fullurl:pagename}}
|
|-
| <nowiki>{{fullurl:pagename|</nowiki>''query_string''<nowiki>}}</nowiki>
| {{fullurl:pagename|query_string}}
|
|-
| <nowiki>{{SERVER}}</nowiki> || {{SERVER}}
|
|-
| <nowiki>{{ns:1}}</nowiki> || {{ns:1}}
|
<nowiki>{{ns:</nowiki>''index''<nowiki>}} e.g. {{ns:1}}</nowiki>  &rarr;  full name of namespace
 
|-
| <nowiki>{{SITENAME}}</nowiki> || {{SITENAME}}
|
|}
 
'''{{tlf|NUMBEROFARTICLES}}''' is the number of pages in the main namespace that contain a link and are not a redirect. This includes full articles, stubs containing a link, and disambiguation pages.
 
'''{{tlf|CURRENTMONTHNAMEGEN}}''' is the genitive (possessive) grammatical form of the month name, as used in some languages but not in English; '''{{tlf|CURRENTMONTHNAME}}''' is the nominative (subject) form, as usually seen in English.
 
In languages where it makes a difference, you can use constructs like <code><nowiki>{{grammar:case|word}}</nowiki></code> to convert a word from the nominative case to some other case. For example, <code><nowiki>{{grammar:genitive|{{CURRENTMONTHNAME}}}}</nowiki></code> means the same as <code><nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki></code>. <!-- Is there a reference for this, other than the source code (for example, phase3/languages/Lnaguage*.php) ? -->
 
==HTML==
{{main|Help:HTML in wikitext}}
 
Many [[HTML]] tags can be used in wiki markup. You can check your HTML by using [[Help:Markup validation|markup validation]].
 
==Common templates==
{{quicktemplates |state=expanded}}
 
==Notes==
{{Notelist}}
 
==See also==
{{Help desk}}
See the 'Coding wiki markup' section of the Help navigation navbox below for additional links.
*[[Wikipedia:User page design center/Style]]
*[[Wikipedia:Extended image syntax]]: advanced [[Help:Visual file markup|visual file markup]].
*[[Help:A quick guide to templates]]: an introduction to [[Help:Template|templates]].
*[[Help:Substitution]]: substitution is an alternative way of including templates than [[Wikipedia:Transclusion|transclusion]].
*[[Help:Score]]: how to render musical scores.
*[[Help:Displaying a formula]]: displaying mathematical formulae.
*{{wikibooks-inline|Editing Wikitext}}.
*[[mw:Parsoid|Parsoid]]: MediaWiki application that allows for converting back and forth between wikitext and HTML.
*{{tl|Syntaxhighlight}}: template to show wrapped syntax-highlighted text.
{{Help navigation}}
{{Wikipedia technical help|state=collapsed}}
{{Tools |state=collapsed}}
 
[[Category:Wikipedia how-to]]
[[Category:Wikipedia editor help]]
[[Category:Wikipedia text help]]
[[Category:Wikipedia article elements help]]

Revision as of 05:00, 12 January 2023

Yahamaga.lk (යහමග) අඩවිය

'ඇදහීමට හෝ පිලිගැනීමට නොව බුද්ධිමත් විමසුම පිණිසයි' යන තේමාව යටතේ හෙළ බසින් ඉස්ලාම් දහම පිලිබදව සාකච්චා කෙරෙන මෙම WikiYahamaga අඩවිය යහමග Yahamaga.LK අඩවියට සමගාමීව ඉදිරිපත් කෙරේ...

Getting started

Template:Short description Template:Pp-move-indef Template:Pp-vandalism Template:For Template:Redirect Template:Locutions pages header Template:Wikipedia how to Template:Wikitext navbox 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.)Template:Efn 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 Help:HTML in wikitext for information on this. Template:TOC limit

Layout

Sections

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

Template:See

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.

{{#lst:Help:HTML in wikitext|WIKI_section}}

Templates: Template:Tl for use in documentation.

Horizontal rule

Template:See

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.

Template:Markup

HTML equivalent: Template:Tag (which can be indented, whereas ---- always starts at the left margin.)

Table of contents

Template:See

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.
  • Template:Tl template 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

Template:See

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 Template:Key press twice.
  • Pressing Template: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.
  • Blank lines within indented wikitext should not be added due to accessibility issues.

Template:Markup

HTML equivalent: Template:Tag or Template:Tag can be used to break line layout.

Templates for line breaks:

  • Template:Tl adds multiple line breaks.
  • Template:Tl and Template:Tl adds a break with styling, to clear floating elements. (often used to prevent text from flowing next to unrelated tables or images)

Unbulleted list:

Indent text

Template:See

Indentation is most commonly used on talk pages.

Template:Markup

Templates: Template:Tl, Template:Tl

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. Template:Markup This uses an HTML tag; template Template:Tl results in the same render.

Center text

Template:See also Template:Markup

Template Template:Tl uses the same markup. To center a table, see Help:Table#Centering tables. Please do not use Template:Tag tags, as it is obsolete.

Align text to right

You can align content in a separate container:

Template:Markup

Or; make the text float around it:

Template:Markup

Lists

Template:See

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

Template:Shortcut

Template:Markup

Ordered lists

Template:Shortcut

Template:Markup

Template:AnchorDescription lists

Template:Anchors Template:Shortcut

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.

Template:Hatnote-inline

Template:Markup

HTML equivalent: Template:Tag Template:Tag, Template:Tag Template:Tag

Templates: Template:Tl

Retaining newlines and spaces

Template: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 Template:Tag tags to maintain newlines and spaces. These tags may be used inside other tags such as Template:Tag; the template Template:Tlx provides a convenient shorthand. CSS styles may be applied to this tag, e.g.: <poem style="margin-left: 2em;">.

Template:Markup

Poems and their translation can be presented side by side, and the language can be indicated with lang="xx". Following the last side-by-side block, Template:Tlx must be used to cancel "float:left;" and to re-establish normal flow. Note that this method does not require a table and its columns to achieve the side-by-side presentation.

Markup <syntaxhighlight lang="xml"><poem lang="fr" style="float:left;">Frère Jacques, frère Jacques, Dormez-vous? Dormez-vous? Sonnez les matines! Sonnez les matines! Ding, dang, dong. Ding, dang, dong.</poem> <poem style="margin-left:2em; float:left;">Are you sleeping? Are you sleeping? Brother John, Brother John, Morning bells are ringing! Morning bells are ringing! Ding, dang, dong. Ding, dang, dong.</poem>Template:Clear</syntaxhighlight> Renders as <poem lang="fr" style="float:left;">Frère Jacques, frère Jacques, Dormez-vous? Dormez-vous? Sonnez les matines! Sonnez les matines! Ding, dang, dong. Ding, dang, dong.</poem> <poem style="margin-left:2em; float:left;">Are you sleeping? Are you sleeping? Brother John, Brother John, Morning bells are ringing! Morning bells are ringing! Ding, dang, dong. Ding, dang, dong.</poem>Template:Clear

Format

Text formatting

Description What you type What it looks like

italics, bold, Template: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 {{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.

To reverse this effect where it has been automatically applied, use Template:Tl and Template:Tl.

For text as Template:Smallcaps, use the template Template:Tl.

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.

See here for a full list of supported languages that can be put in lang="????"

<syntaxhighlight lang="cpp">
#include <iostream>
int m2 (int ax, char *p_ax) {
  std::cout <<"Hello World!";
  return 0;
}</syntaxhighlight>

<syntaxhighlight lang="cpp">

  1. include <iostream>

int m2 (int ax, char *p_ax) {

 std::cout <<"Hello World!";
 return 0;

}</syntaxhighlight>

Small text

<syntaxhighlight lang="html"> Use small text only when necessary. </syntaxhighlight>

Use small text only when necessary.

a <small> span

<syntaxhighlight lang="html"> 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%. </syntaxhighlight>

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

<syntaxhighlight lang="html"> Better not use big text, unless it's within small text. </syntaxhighlight>

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

To prevent two words from becoming separated by a linewrap (e.g. Mr. Smith or 400 km/h) a non-breaking space, sometimes also called a "non-printing character", may be used between them. (For three or more words, the template Template:Tl is probably more suitable.)

Mr.&nbsp;Smith or 400&nbsp;km/h

Mr. Smith or 400 km/h

Extra spacing within text is usually best achieved using the Template:Tl template.

Mary {{pad|4.0em}} had a little lamb.

Mary Template:Pad had a little lamb.

Special characters

Template:See also 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

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

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; ' "

Escaping punctuation characters

The [[#Pre|Template:Tag]], [[#Nowiki|Template:Tag]], and [[#Code|Template:Tag]] markup tags are also available, for writing "[", "{", "&", "}", "]" for example. These tags prevent these characters from being recognised as wiki markup, which is a possibility in some circumstances.

Commercial symbols

Using character entity references.

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

Greek characters

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; Τ Υ Φ Χ Ψ Ω

Egyptian hieroglyphs

Template:Main

WikiHiero is a software extension that renders Egyptian hieroglyphs as PNG images using Template:Xtag HTML-like tags.

Example: Template:Markup

Chess symbols

Template:Main

For example, &#9812; displays ♔

Subscripts and superscripts

  • The Manual of Style prefers the Template:Tag and Template:Tag formats, for example xTemplate:Tag. 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

<syntaxhighlight lang="html"> x1 x2 x3 or

x₀ x₁ x₂ x₃ x₄

x₅ x₆ x₇ x₈ x₉ </syntaxhighlight>

x1 x2 x3 or

x₀ x₁ x₂ x₃ x₄

x₅ x₆ x₇ x₈ x₉

Superscripts

<syntaxhighlight lang="html"> x1 x2 x3 or

x⁰ x¹ x² x³ x⁴

x⁵ x⁶ x⁷ x⁸ x⁹ </syntaxhighlight>

x1 x2 x3 or

x⁰ x¹ x² x³ x⁴

x⁵ x⁶ x⁷ x⁸ x⁹

Combined

<syntaxhighlight lang="tid"> ε0 = 8.85 × 10−12 C² / J m

1 hectare = 1 E+4 m² </syntaxhighlight>

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

1 hectare = 1 E+4 m²

Characters in the Private Use Area, and invisible formatting characters

Template:Main

Invisible and PUA (Private Use Areas) characters should be avoided where possible. When needed, they should both be replaced with their (hexa)decimal code values (as "&#(x)...;"). This renders invisible characters visible, for manual editing, and allows AWB to process pages with PUA characters. The latter should also be tagged with the Template:Tl template for tracking and future maintenance.

Mathematical characters and formulae

Mathematical characters

What you type What it looks like
&int; &sum; &prod; &radic; ∫ ∑ ∏ √
&minus; &plusmn; &infin; − ± ∞
&asymp; &prop; &equiv; &ne; ≈ ∝ ≡ ≠
&le; &ge; ≤ ≥
&times; &middot; &divide; &part; × · ÷ ∂
&prime; &Prime; ′ ″
&nabla; &permil; &deg; &there4; &alefsym; ∇ ‰ ° ∴ ℵ
&oslash; ø
&isin; &notin; &cap; &cup; ∈ ∉ ∩ ∪
&sub; &sup; &sube; &supe; ⊂ ⊃ ⊆ ⊇
&not; &and; &or; &exist; &forall; ¬ ∧ ∨ ∃ ∀
&rArr; &lArr; &dArr; &uArr; &hArr; ⇒ ⇐ ⇓ ⇑ ⇔
&rarr; &larr; &darr; &uarr; &harr; → ← ↓ ↑ ↔

Mathematical formulae

Template:Main

  • The Template:Tag tag typesets using LaTeX markup,Template:Efn which may render as an image or as HTML, depending on environmental settings. The Template:Tag tag is best for the complex formula on its own line in an image format. If you use this tag to put a formula in the line with text, put it in the Template:Tl template.
  • The Template:Tl template uses HTML, and will size-match a serif font, and will also prevent line-wrap. All templates are sensitive to the = sign, so remember to replace = with Template:Tl in template input, or start the input with 1=. Use wiki markup '' and ''' inside the Template:Tl template, as well as other HTML entities. The Template:Tl template is best for typeset formulas in line with the text.

Template:Markup

Spacing in simple math formulae

  • Using &nbsp; to prevent line break is not needed; the Template:Tl template will prevent line breaks anyway; you can use Template:Tag if you need an explicit line break inside a formula.

Template:Markup

Complicated formulae

Template:Markup Indenting by using the colon (:) character (i.e. using :<math></math> instead of <math display=block></math>) is discouraged for accessibility reasons.

Links and URLs

Template:Main

Wikilinks

Wikilinks are used in wikitext markup to produce internal links between pages. You create wikilinks by putting double square brackets around text designating the title of the page you want to link to. Thus, [[Texas]] will be rendered as Texas. Optionally, you can use a vertical bar (|) to customize the link title. For example, typing [[Texas|Lone Star State]] will produce Lone Star State, a link that is displayed as "Lone Star State" but in fact links to Texas.

Link to another wiki article

  • Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).
  • Thus the link hereafter is to the Web address en.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also Canonicalization.
  • A red link is a page that doesn't exist yet; it can be created by clicking on the link.
  • A link to its own page will appear only as bold text.

Template:Markup

Renamed link

  • Same target, different name.
  • The target ("piped") text must be placed first, then the text to be displayed second.
What you type What it looks like

New York also has [[public transport|public transportation]].

New York also has public transportation.

Automatically rename links

  • Simply typing the pipe character | after a link will automatically rename the link in certain circumstances. The next time you open the edit box you will see the expanded piped link. When previewing your edits, you will not see the expanded form until you press Save and Edit again. The same applies to links to sections within the same page.
  • See Pipe trick for details.
Description What you type What it looks like

Automatically hide stuff in parentheses

[[kingdom (biology)|]]

kingdom

Automatically hide the comma and following text [[Seattle, Washington|]] Seattle

Automatically hide namespace

[[Wikipedia:Village pump|]]

Village pump

Or both

[[Wikipedia:Manual of Style (headings)|]]

Manual of Style

But this doesn't work for section links

[[Wikipedia:Manual of Style#Links|]]

[[Wikipedia:Manual of Style#Links|]]

Blend link

  • Endings are blended into the link.
    • Exception: a trailing apostrophe (') and any characters following the apostrophe are not blended.
  • Preferred style is to use this instead of a piped link, if possible.
  • Blending can be suppressed by using the [[#Nowiki|Template:Tag]] tag, which may be desirable in some instances.
Description What you type What it looks like
Blending active

San Francisco also has [[public transport]]ation. Examples include [[bus]]es, [[taxicab]]s, and [[tram]]s.

San Francisco also has public transportation. Examples include buses, taxicabs, and trams.
A [[micro-]]second A micro-second

Blending suppressed

A [[micro-]]<nowiki />second.

A micro-second

Link to a section of a page

  • The part after the hash sign (#) must match a section heading on the page. Matches must be exact in terms of spelling, case, and punctuation. Links to non-existent sections are not broken; they are treated as links to the beginning of the page.
  • Include "| link title" to create a stylish (piped) link title.
  • If sections have the same title, add a number to link to any but the first. #Example section 3 goes to the third section named "Example section". You can use the pipe and retype the section title to display the text without the # symbol.
What you type What it looks like

[[Wikipedia:Manual of Style#Italics]] is a link to a section within another page.

Wikipedia:Manual of Style#Italics is a link to a section within another page.

[[#Links and URLs]] is a link to another section on the current page. [[#Links and URLs|Links and URLs]] is a link to the same section without showing the # symbol.

#Links and URLs is a link to another section on the current page. Links and URLs is a link to the same section without showing the # symbol.

[[Wikipedia:Manual of Style#Italics|Italics]] is a piped link to a section within another page.

Italics is a piped link to a section within another page.

Create a page link

  • To create a new page:
    1. Create a link to it on some other (related) page.
    2. Save that page.
    3. Click on the link you just made. The new page will open for editing.
  • For more information, see starting an article and check out Wikipedia's naming conventions.
  • Please do not create a new article without linking to it from at least one other article.
Description What you type What it looks like

Links to pages that don't exist yet look red.

The article about [[cardboard sandwiches]] doesn't exist yet.

The article about cardboard sandwiches doesn't exist yet.

Redirects

Template:Main

  • Redirect one article title to another by placing a directive like the one shown to the right on the first line of the article (such as at a page titled "US").
  • It is possible to redirect to a section. For example, a redirect to United States#History will redirect to the History section of the United States page, if it exists.
Description What you type

Redirect to an article

#REDIRECT [[United States]]

Redirect to a section

#REDIRECT [[United States#History]]

Link to another namespace

  • The full page name should be included in double square brackets.
What you type What it looks like

See the [[Wikipedia:Manual of Style]].

See the Wikipedia:Manual of Style.

Link to the same article in another language (interlanguage links)

Template:Main Template:Notice

  • To link to a corresponding page in another language, use the form: [[language code:Foreign title]].
  • It is recommended interlanguage links be placed at the very end of the article.
  • Interlanguage links are NOT visible within the formatted article, but instead appear as language links on the sidebar (to the left) under the menu section "languages".
Description What you type

Link from English article "Plankton" to the Spanish article "Plancton".

"es" is the language code for "Template:Lang" (the Spanish language).

[[es:Plancton]]

Other examples: French (fr for Template:Lang), German (de for Template:Lang), Russian (ru), and simple English (simple).

[[fr:Plancton]]
[[de:Plankton]]
[[ru:Планктон]]
[[simple:Plankton]]

Interwiki link

Description What you type What it looks like

Linking to a page on another wiki in English.

All of these forms lead to the URL https://en.wiktionary.org/wiki/hello.

Simple link.

Without prefix.

Named link.

[[Wiktionary:hello]]

[[Wiktionary:hello|]]

[[Wiktionary:hello|Wiktionary definition of "hello"]]

Wiktionary:hello

hello

Wiktionary definition of "hello"

Linking to a page on another wiki in another language.

All of these forms lead to the URL https://fr.wiktionary.org/wiki/bonjour.

Simple link.

Without prefix.

Named link.

[[Wiktionary:fr:bonjour]]

[[Wiktionary:fr:bonjour|]]

[[Wiktionary:fr:bonjour|bonjour]]

Wiktionary:fr:bonjour

fr:bonjour

bonjour

Categories

  • To put an article in a category, place a link like [[Category:Example]] into the article. As with interlanguage links, placing these links at the end of the article is recommended.
  • To link to a category page without putting the article into the category, use a colon prefix (":Category") in the link.
Description What you type What it looks like

Categorize an article.

[[Category:Character sets]]

Link to a category.

[[:Category:Character sets]]

Category:Character sets

Without prefix.

[[:Category:Character sets|]]

Character sets

External links

  • Single-square brackets indicate an external link. Note the use of a space (not a pipe |) to separate the URL from the link text in a named link. Square brackets may be used as normal punctuation when not linking to anything – [like this].
  • A URL must begin with a supported URI scheme: https:// (preferably) and http:// will be supported by all browsers; irc://, ircs://, ftp://, <syntaxhighlight lang="text" inline>news://</syntaxhighlight>, mailto:, and gopher:// will require a plugin or an external application. IPv6 addresses in URLs are currently not supported.
  • A URL containing certain characters will display and link incorrectly unless those characters are percent encoded. For example, a space must be replaced by %20. Encoding can be achieved by:
  • Use the link button File:OOjs UI icon link-ltr.svg on the enhanced editing toolbar to encode the link; this tool will add the bracket markup and the linked text, which may not always be desirable.
  • Or manually encode the URL by replacing these characters:
space " ' , ; < > ? [ ]
%20 %22 %27 %2c %3b %3c %3e %3f %5b %5d
  • Or use the {{urlencode:}} magic word. See Help:Magic words in the MediaWiki documentation for more details.
Description What you type What it looks like

Named link with an external link icon

[https://www.wikipedia.org Wikipedia]

Wikipedia

Unnamed link

(Used only within article body for footnotes)

[https://www.wikipedia.org]

[1]

Bare URL

(Bad style)

use <nowiki></nowiki> to keep this bad style from showing

https://www.wikipedia.org

https://www.wikipedia.org

Link without arrow

(Not often used)

<span class="plainlinks">[https://www.wikipedia.org Wikipedia]</span>

Wikipedia

Miscellaneous

"As of" template

  • The "as of" technique generates phrases like "As of April 2009" or "as of April 2009", and categorize information that will need updating. For an explanation of the parameters see the Template:Tl template documentation.
What you type What it looks like

{{As of|2009|4|df=us}}

Template:As of

{{As of|2009|4|df=us|lc=y}}

Template:As of

Media link

  • To include links to non-image uploads such as sounds, use a "media" link. For images, see next section.
  • Some uploaded sounds are listed at Commons:Sound.
What you type What it looks like

[[media:Classical guitar scale.ogg|Sound]]

Sound

Links directly into edit mode

  • These create links that directly go to the edit or view source tab. For example, to create links to the edit tab for this page, either of the following works:
Description What you type What it looks like

Using the Template:Tl template

[{{fullurl:Help:Wiki markup|action=edit}} edit]

edit

Using the Template:Tl template

{{edit}}

Template:Edit

Links partially italicized

  • Linking to a page with a title containing words that are usually italicized, such as the Hindenburg disaster article.
What you type What it looks like

[[Hindenburg disaster|''Hindenburg'' disaster]]

Hindenburg disaster

Pronunciation aids

It is often desirable to provide an aid to pronunciation for a word. The IPAc-en and Respell templates can be of assistance.

What you type What it looks like

'''Konjac''' {{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}}

Konjac Template:IPAc-en

'''Konjac''' ({{IPAc-en|lang|pron|ˈ|k|oʊ|n|j|æ|k}} {{respell|KOHN|yak}})

Konjac (Template:IPAc-en Template:Respell)

''Konjac'' is pronounced {{IPAc-en|ˈ|k|oʊ|n|j|æ|k}} in English.

Konjac is pronounced Template:IPAc-en in English.

Refer to Wikipedia:Manual of Style (pronunciation) for more information.

Musical notation

Template:Main Musical notation is added by using the Template:Xtag extension HTML-like tag. For example:

Template:Markup

Images

Template:Main page Only images that have been uploaded to Wikipedia or Wikimedia Commons can be used. To upload images, use the Commons upload wizard for photos you have taken, and the Wikipedia upload page if there may be copyright issues. You can find the uploaded image on the image list.

See the Wikipedia's image use policy for the policy used on Wikipedia.

For further help on images, including some more versatile abilities, see the picture tutorial and extended image syntax.

What you type What it looks like Notes
The image name, the word thumb then the caption : 
[[File:wiki.png|thumb|Wikipedia logo]]
The image name, the word thumb then the caption :
Puzzle globe
Wikipedia logo
Template:Clear
  • The thumb tag automatically allows the image to be enlarged and positions it (floats) automatically to the right of the page.
  • An enlarge icon is placed in the lower right corner.
  • See note below about adding an alt tag
  • This is the basic markup for most images


A picture: [[File:wiki.png]]
A picture: File:Wiki.png
  • The picture name alone places the image in the text, or on the next line if there is insufficient space.
  • Embedding the image in the text is only possible for very small images.
  • Embedding the image will affect the vertical formatting of text.
With alternative text: 
[[File:wiki.png|alt=Puzzle globe logo]]
With alternative text:

Puzzle globe logo

  • Template:AnchorAlternative text, used when the image is unavailable or when the image is loaded in a text-only browser, or when spoken aloud, is strongly encouraged. See Alternative text for images for help on choosing it.
With link: 
[[File:wiki.png|link=Wikipedia]]
With link:

File:Wiki.png Template:Clear

  • The link directs to the Wikipedia page, Wikipedia, instead of the image file page.
<syntaxhighlight lang="moin" style="white-space: pre-wrap;">Forced to the centre of the page

using the frame tag (attribute), a centre tag and a caption:

Puzzle globe
Wikipedia logo
</syntaxhighlight>
Forced to the centre of the page using the frame tag (attribute), a centre tag and a caption:
Puzzle globe
Wikipedia logo
Template:Clear
  • The frame tag automatically floats the image right.
  • The frame tag is only of use with very small images or ones using the px tag
  • The attributes left, center or centre override this, and places the image to the left or the centre of the page. Template:Anchor
  • The last parameter is the caption that appears below the image.
<syntaxhighlight lang="moin" style="white-space: pre-wrap;">Forced to the left side of the page

using the thumb attribute, the left attribute and a caption:

Puzzle globe
Wikipedia logo
</syntaxhighlight>
Forced to the left side of the page using the thumb attribute, the left attribute and a caption:
Puzzle globe
Wikipedia logo
Template:Clear
  • The thumb tag automatically floats the image right.
  • An enlarge icon is placed in the lower right corner.
  • The attributes left, center or centre override this, and places the image to the left or the centre of the page.
<syntaxhighlight lang="moin" style="white-space: pre-wrap;">Forced to the right side of the page

without a caption:

Wikipedia encyclopedia
Wikipedia encyclopedia
</syntaxhighlight>
Forced to the right side of the page without a caption:
Wikipedia encyclopedia
Wikipedia encyclopedia
  • Captions are only displayed when the thumb or frame attributes are present
  • The picture tutorial explains more options.
A picture resized to 50 pixels... 
[[File:wiki.png|50 px|Wikipedia encyclopedia]]
A picture resized to 50 pixels width...

Wikipedia encyclopedia

  • Template:AnchorThe picture tutorial explains more options.
  • Sizing in pixels is deprecated and should be used very sparingly.
  • There is an upright attribute that should be used instead. These tags are optimised for both laptop and mobile phone screens.
Linking directly to the description page of an image: 
[[:File:wiki.png]]
Linking directly to the description page of an image:

File:wiki.png

  • Clicking on an image displayed normally on a page also leads to the description page.
Linking directly to an image without displaying it: 
[[Media:wiki.png|Image of jigsaw globe]]
Linking directly to an image without displaying it:

Image of jigsaw globe

  • To include links to images shown as links instead of drawn on the page, use a "media" link.

<syntaxhighlight lang="html">Example:

</syntaxhighlight>

Example:

  • Using the span or div elements to separate images from text (note that this may allow images to cover text).
Example:

{| align=right
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|-
|
[[File:wiki.png|50 px]]
|}

Example:

File:Wiki.png

File:Wiki.png

File:Wiki.png

  • Using wiki markup to make a table in which to place a vertical column of images (this helps edit links match headers, especially in Firefox browsers).

Tables

Template:Main Template:See also There are two ways to build tables:

Columns

Template:Main Use Template:Tl and Template:Tl templates to produce columns.

References and citing sources

Template:Main Template:See also

Making a reference citing a printed or online source can be accomplished by using the Template:Tag wiki markup tags. Inside these tags details about the reference are added.

Details about the citation can be provided using a structure provided by various templates; the table below lists some typical citation components.

What it's for What you type
Template:Nowrap Template:Tag
To cite a book Template:Tlx
To cite a web source Template:Tlx
Book ISBN Template:Para (ISBN of the book)
Web URL Template:Para
Title Template:Para
Author Template:Para
First name Template:Para
Last name Template:Para
Location Template:Para
Publisher Template:Para
Date Template:Para (date of source)
Year Template:Para
Accessed date Template:Para (only if url= is included)
A complete reference tag Template:Tag{{cite web |url=https://en.wikipedia.org/wiki/Help:Wiki_markup |title=Help:Wiki markup |publisher=Wikimedia Foundation}}Template:Tag
Referencing this again Template:Tag
Citation needed Template:Tlx

Templates and transcluding pages

Template:Main Template:See also

Examples for templates: {{pad|...}}, {{math|...}}, {{as of|...}}, {{edit}}

Templates are segments of wiki markup that are meant to be copied automatically ("transcluded") into a page. They are specified by putting the template's name in {{double braces}}. Most templates are pages in the Template namespace, but it is possible to transclude mainspace pages (articles) by using {{:colon and double braces}}.

There are three pairs of tags that can be used in wikitext to control how transclusion affects parts of a template or article. They determine whether or not wikitext renders, either in its own article, which we will call "here", or in another article where it is transcluded, which we will call "there".

  • <noinclude>: the content will not be rendered there. These tags have no effect here.
  • <includeonly>: the content will render only there, and will not render here (like invisible ink made visible by means of transclusion).
  • <onlyinclude>: the content will render here and will render there, but it will only render there what is between these tags.

There can be several such section "elements". Also, they can be nested. All possible renderings are achievable. For example, to render there one or more sections of the page here use <onlyinclude> tags. To append text there, wrap the addition in <includeonly> tags before, within, or after the section. To omit portions of the section, nest <noinclude> tags within it.

If a page is transcluded without transclusion markup, it may cause an unintentional categorization. Any page transcluding it will contain the same category as the original page. Wrap the category markup with <noinclude> tags to prevent incorrect categorization. Template:Anchor Some templates take parameters, as well, which you separate with the pipe character |.

What you type What it looks like
{{Transclusion demo}}

Template:Transclusion demo

{{Help:Transclusion demo}}

Help:Transclusion demo

This template takes two parameters,
and creates underlined text with a
hover box for many modern browsers
supporting CSS:

{{Tooltip|Hover your mouse over this text
|This is the hover text}}

Go to this page to see the Tooltip
template itself: {{tl|Tooltip}}

This template takes two parameters, and creates underlined text with a hover box for many modern browsers supporting CSS:

Template:Tooltip

Go to this page to see the Tooltip template itself: Template:Tl

Talk and project pages

These are likely to be helpful on talk and project pages.

Signing comments

  • The tilde character (~) is used when signing a comment on a talk page. Your username provides a link to your user page.
Description What you type What it looks like

You should sign your comments by appending four tildes to the comment, which adds your user name plus date/time.

~~~~

Username (talk) 15:09, 28 April 2024 (UTC)

Adding three tildes will add just your user name.

~~~

Username (talk)

Adding five tildes gives the date/time alone.

~~~~~

15:09, 28 April 2024 (UTC)

Linking to old revisions of pages, diffs, and specific history pages

  • The external link function is mainly used for these. Open an old revision or diff, and copy the URL from the address bar, pasting it where you want it.
What you type What it looks like

[//en.wikipedia.org/w/index.php?title=Help:Wiki_markup&diff=330350877&oldid=330349143 Diff between revisions 330349143 and 330350877]

Diff between revisions 330349143 and 330350877

What you type What it looks like

[[Special:Diff/330349143/330350877|Diff between revisions 330349143 and 330350877]]

Diff between revisions 330349143 and 330350877

  • If the diff intended to be shown is between an immediately previous revision, the first parameter can be dropped.
What you type What it looks like

[[Special:Diff/330350877|Diff between revisions 330349143 and 330350877]]

Diff between revisions 330349143 and 330350877

  • For an old revision, you can also use a permalink. Though here only the main text is guaranteed to be retained (images and templates will be shown as they are today, not as they were at the time).
What you type What it looks like

[[Special:Permalink/330350877|Revision 330350877]]

Revision 330350877

What links here, and recent changes linked

  • The following markup can be used. For example, for the article Beetroot:
What you type What it looks like

[[Special:WhatLinksHere/Beetroot]]

Special:WhatLinksHere/Beetroot

[[Special:RecentChangesLinked/Beetroot]]

Special:RecentChangesLinked/Beetroot

User edits

Description What you type What it looks like
Username (registered users). [[Special:Contributions/UserName]] Special:Contributions/UserName
IPv4 address (unregistered users). [[Special:Contributions/192.0.2.0]] Special:Contributions/192.0.2.0
IPv6 address (unregistered users). [[Special:Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329]] Special:Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329

Coloring and highlighting text

What you type What it looks like

I will change the color in {{color|blue|the middle part of}} this sentence.

I will change the color in Template:Color this sentence.

This is how to {{Font color||yellow|highlight part of a sentence}}.

This is how to Template:Font color.

Example text

The Template:Tlx family of templates can be used on help pages and user pages to highlight example text.

Template:!bxt

What you type What you get
This is an {{xt|A correct example}} for comparison {{tick}} This is an Template:Xt for comparison Template:Tick
this is an {{!xt|An incorrect example}} for example {{cross}} this is an Template:!xt for example Template:Cross
this is an {{mxt|In monospace}} for comparison this is an Template:Mxt for comparison
this is an {{!mxt|In monospace}} for comparison this is an Template:!mxt for comparison
this is an {{bxt|in bold}} for comparison this is an Template:Bxt for comparison
this is an {{!bxt|In bold}} for comparison this is an Template:!bxt for comparison

Show deleted or inserted text

Template:Details

  • When editing regular Wikipedia articles, just make your changes, and do not mark them up in any special way, except when the article itself discusses deleted or inserted content, such as an amendment to a statute:
  • This also applies to changing one's own talk page comments. For more details, see WP:REDACT.
What you type What it looks like

You can <del>indicate deleted material</del> and <ins>inserted material</ins>.

You can indicate deleted material and inserted material.

Strike through

Template:See also The Template:Tl template marks up a span of text with the Template:Tag tag. This is usually renderend visually by drawing a horizontal line through it. Outside of articles, it can be used to mark something as no longer accurate or relevant without removing it from view. Do not use it, however, to indicate document edits. For that, use the Template:Tag tag instead. See Template:Slink for details.

What you type What you get
This is {{strike|an obsolete stretch of text}} for comparison This is Template:Strike for comparison

Template:Anchor Limiting formatting / escaping wiki markup

A few different kinds of formatting will tell the wiki to display things as you typed them – what you see is what you get!

What you type What it looks like

<syntaxhighlight lang="tid"> <nowiki> tag:

The <nowiki> tag ignores [[wiki]] ''markup''. It reformats text by removing newlines and multiple spaces. It still interprets characters specified by &name;: → </syntaxhighlight>

<nowiki> tag:

The <nowiki> tag ignores [[wiki]] ''markup''. It reformats text by removing newlines and multiple spaces. It still interprets characters specified by &name;: →

<syntaxhighlight lang="tid"> <pre> tag:

The <pre> tag ignores [[wiki]]
''markup'' as does the <nowiki>
tag. Additionally, <pre> displays
in a mono-spaced font, and does
not  reformat    text    spaces.
It still interprets special
characters: →

</syntaxhighlight>

<pre> tag:

The <pre> tag ignores [[wiki]]
''markup'' as does the <nowiki>
tag. Additionally, <pre> displays
in a mono-spaced font, and does
not  reformat    text    spaces.
It still interprets special
characters: →
'''[Text without a URL]:'''

Single square brackets holding
[text without a HTTP URL] are
preserved, but single square
brackets containing a URL are
treated as being an external
[https://example.com/ Web link].

[Text without a URL]:

Single square brackets holding [text without a HTTP URL] are preserved, but single square brackets containing a URL are treated as being an external Web link.

<syntaxhighlight lang="tid">Leading space:

Leading spaces are another way to preserve formatting.

Putting a space at the
beginning of each line
stops the text   from
being reformatted.
It still interprets wiki
markup and special characters: &</syntaxhighlight>

Leading space:

Leading spaces are another way to preserve formatting.

Putting a space at the
beginning of each line
stops the text   from
being reformatted.
It still interprets wiki
markup and special characters: →

Nowiki

Template:Anchor Template:Redirect Template:Shortcut

Template:Tag (wiki markup contained between these two tags is displayed as normal text)
Template:Tag (wiki markup that is interrupted by this tag is displayed as normal text, as detailed in examples below)

These two kinds of nowiki operate in different ways, but both neutralize the rendering of wiki markup as shown in the examples below. For example, the characters that have wiki markup meaning at the beginning of a line (Template:Code, Template:Code, Template:Code and Template:Code) can be rendered in normal text. Editors can normalize the font of characters trailing a wikilink, which would otherwise appear in the wikilink font. And newlines added to wikitext for readability can be ignored.

Note to template editors: tag Template:Tag works only on its source page, not the target.

Template:Markup

The rest of the section consists of simple, live examples showing how a single nowiki tag escapes entire linkage structures, beyond [[ wikilink ]] and {{ template }}:

[[ fullpagename | label ]]
{{ pagename | parameter }}
[[fullpagename | {{ pagename }} ]]
{{ pagename | [[ fullpagename ]] }}
{{ pagename | {{ pagename }} }}

Unless you use the two "balanced" nowiki tags, troubleshooting strip marker errors and template parameter-handling inconsistencies is a risk. Also, a rendering error may arise when two [[...]] square brackets are on the same line, or two {{...}} curly brackets are in the same section, but only when the two have the nowiki markup placed inconsistently.

Displaying wikilinks

(These are all live examples.)

[[ wp:pagename | page name ]]
[<nowiki />[ wp:pagename | page name ]]
[[<nowiki /> wp:pagename | page name ]]
[[ wp:pagename <nowiki />| page name ]]
[[ wp:pagename | page name ]<nowiki />]

<poem>

page name
[[ wp:pagename | page name ]]
[[ wp:pagename | page name ]]
[[ wp:pagename | page name ]]
[[wp:pagename | page name ]]

</poem>

For nested structures, escaping an inner structure escapes its outer structure too.

[[ wp: {{ 1x | pagename }} ]]
[[ wp: {<nowiki />{ 1x | pagename }} ]]
[[ wp: {{<nowiki /> 1x | pagename }} ]]
[[ wp: {{ 1x <nowiki />| pagename }} ]]

<poem>

[[ wp: Template:1x ]]
[[ wp: {{ 1x | pagename }} ]]
[[ wp: {{ 1x | pagename }} ]]
[[ wp: {{ 1x | pagename }} ]]

</poem>

For two, first pipes, two nowiki tags are required:

[[ wp: pagename | {{ 1x | label }} ]]
[[ wp: pagename <nowiki />| {{ 1x <nowiki />| label }} ]]
<nowiki>[[ wp: pagename | {{ 1x | label }} ]] </nowiki>

<poem>

[[wp: pagename | Template:1x ]]
[[ wp: pagename | {{ 1x | label }} ]]
[[ wp: pagename | {{ 1x | label }} ]]

</poem>

Displaying template calls

Template:See also

For templates, put nowiki before the first pipe. If a parameter has a wikilink, put it in that, an inmost position.

{<nowiki />{ val | u=&gt; [[ms]] | 49082 }}
{{<nowiki /> val | u=&gt; [[ms]] | 49082 }}
{{ val <nowiki />| u=&gt; [[ms]] | 49082 }}
{{ val | u= > [[ms]] | 49082 }<nowiki />}
{{ val | u= > [[ ms ]<nowiki />] | 49082 }} 

<poem>

{{ val | u=> ms | 49082 }}
{{ val | u= > ms | 49082 }}
{{ val | u=> ms | 49082 }}
{{ val | u=> ms | 49082 }}
{{ val | u= > [[ ms ]] | 49082 }} Template:OK

</poem>

Displaying magic words

Template:Further

For input parameters, {{{1}}}, {{{2}}}, just write them out, unless they have a default (which goes behind their pipe): {{<nowiki />{1|default}}} → {{{1|default}}}

For a parser function nowiki goes between bracketing-pair characters, or anywhere before the : colon.

{{ #ifeq: inYes | inYes | outYes | outNo }}
{<nowiki />{ #ifeq: inYes | inYes | outYes | outNo }}
{{<nowiki /> #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq<nowiki />: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }<nowiki />}

<poem>

{{ #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }}
{{ #ifeq: inYes | inYes | outYes | outNo }}

</poem>

Behavioral switches expect the tag anywhere:

 1. __HIDDENCAT__
 2. __HIDDENCAT<nowiki />__
1. Template:Break
2. __HIDDENCAT__

Displaying tags

Tags do not display; they are just markup. If you want them to, insert Template:Tag after an Template:Code opening angle bracket; it goes only in the very front. Opening tags and closing tags must be treated separately.

<span style=color:blue> Blue </span>
<<nowiki />span style=color:blue> Blue <<nowiki />/span>
<section end=la<nowiki />bel /> 
<<nowiki />section end=label />

<poem>

Blue
<span style=color:blue> Blue </span>
<section end=label /> Template:Cross
<section end=label /> Template:Tick

</poem>

Use template Template:Tl instead of nowiki tags to display parser tags:

Character entities, nowiki cannot escape. To escape HTML or special character entities, replace & with &amp;. For example, &amp;lt;&lt;

To display a nowiki tag, you can (1) use Template:Tl, (2) replace the < left angle bracket with its HTML character entity, or (3) nest nowiki tags in each other:

{{ tag | nowiki }}
<code>&lt; nowiki>...&lt;/ nowiki ></code>
<code><<nowiki />nowiki>...<<nowiki />/ nowiki ></code>

<poem>

Template:Tag
< nowiki>...</ nowiki >
< nowiki>...</ nowiki >

</poem>

{{ tag | nowiki | s }}
<code>&lt; nowiki /></code>
<code><<nowiki /> nowiki /></code>
<code><nowiki>< nowiki /></nowiki></code>

<poem>

Template:Tag
< nowiki />
< nowiki />
< nowiki />

</poem>

Nowiki tags do not otherwise nest, so it is the second and fourth that displays:

1<nowiki>2<nowiki>3</nowiki>4</nowiki>
<nowiki>{{!}}<nowiki></nowiki>{{!}}</nowiki>

<poem>

12<nowiki>34</nowiki> Template:Spaces Template:Small
{{!}}<nowiki>|</nowiki>

</poem>

These simply scan from left to right. The paired tags cannot overlap, because the very first pair-match nullifies any intervening tags inside. Unbalanced tags always display.

Nowiki tags do not display table markup, use Template:Tag.

Pre

Template:Shortcut

Template:Tag is a parser tag that emulates the HTML Template:Tag tag. It defines preformatted text that is displayed in a fixed-width font and is enclosed in a dashed box. HTML and wiki markups are escaped and spaces and line breaks are preserved, but HTML entities are parsed.

Template:Markup

As Template:Tag is a parser tag, it escapes wikitext and HTML tags. This can be prevented with the use of <includeonly></includeonly> within the Template:Tag, making it act more like its HTML equivalent:

Template:Markup

Invisible HTML Template:Tag tags can also be inserted by preceding text with a space character, like:

wiki markup &

Alternatively, consider using Template:Tl template or Template:Xtag.

Invisible text (comments)

Template:See also

It's uncommonTemplate:Spaced ndashbut on occasion acceptable for notes to other editorsTemplate:Spaced ndashto add a hidden comment within the text of an article. These comments are visible only when editing or viewing the source of a page. Most comments should go on the appropriate Talk page. The format is to surround the hidden text with "<!--" and "-->" and may cover several lines, e.g.:

<!-- An example of hidden comments
 This won't be visible except in "edit" mode. -->

Another way to include a comment in the wiki markup uses the Template:Tl template, which can be abbreviated as Template:Tl. This template "expands" to the empty string, generating no HTML output; it is visible only to people editing the wiki source. Thus Template:Nowrap operates similarly to the comment Template:Nowrap. The main difference is that the template version can be nested, while attempting to nest HTML comments produces odd results.

Variables

Template:Seealso

Code Effect Notes
{{CURRENTWEEK}} 17
{{CURRENTDOW}} 0

Monday = 1, Tuesday = 2, etc., but Sunday = 0

{{CURRENTMONTH}} 04
{{CURRENTMONTHNAME}} April
{{CURRENTMONTHNAMEGEN}} April
{{CURRENTDAY}} 28
{{CURRENTDAYNAME}} Sunday
{{CURRENTYEAR}} 2024
{{CURRENTTIME}} 15:09
{{NUMBEROFARTICLES}} 717
{{NUMBEROFPAGES}} 2,213
{{NUMBEROFUSERS}} 1,380
{{PAGENAME}} Welcome to Yahamaga
{{NAMESPACE}}
{{REVISIONID}} 19
{{REVISIONUSER}} Abuarshed
{{localurl:pagename}} /index.php/Pagename
{{localurl:Wikipedia:Sandbox|action=edit}} https://en.wikipedia.org/wiki/Sandbox?action=edit
{{fullurl:pagename}} https://yahamaga.lk/index.php/Pagename
{{fullurl:pagename|query_string}} https://yahamaga.lk/index.php?title=Pagename&query_string
{{SERVER}} https://yahamaga.lk
{{ns:1}} Talk

{{ns:index}} e.g. {{ns:1}} → full name of namespace

{{SITENAME}} Yahamaga

Template:Tlf is the number of pages in the main namespace that contain a link and are not a redirect. This includes full articles, stubs containing a link, and disambiguation pages.

Template:Tlf is the genitive (possessive) grammatical form of the month name, as used in some languages but not in English; Template:Tlf is the nominative (subject) form, as usually seen in English.

In languages where it makes a difference, you can use constructs like {{grammar:case|word}} to convert a word from the nominative case to some other case. For example, {{grammar:genitive|{{CURRENTMONTHNAME}}}} means the same as {{CURRENTMONTHNAMEGEN}}.

HTML

Template:Main

Many HTML tags can be used in wiki markup. You can check your HTML by using markup validation.

Common templates

Template:Quicktemplates

Notes

Template:Notelist

See also

Template:Help desk See the 'Coding wiki markup' section of the Help navigation navbox below for additional links.

Template:Help navigation Template:Wikipedia technical help Template:Tools