File Formats Wiki
Register
Advertisement

Wikitext (wiki markup) is a markup language used to write web pages in wiki websites. It is also used to talk to everyone, you can edit everything and anything.

Smallwikipedialogo.png Wikipedia has an article related to:

Syntax[]

The syntax discussed here is for MediaWiki-based wikis such as Wikipedia and Wikia.

Line breaks[]

Text separated by a single line break is rendered as if they were in the same line, separated by a space. However, an empty line will start a new paragraph. Some syntax in the succeeding line such as section headings will automatically end the current paragraph.

Formatting[]

Bold and italic text

Bold text is enclosed with three apostrophes ('''). Italic text is enclosed with two apostrophes (''). These can be combined together, provided with proper nesting. Other instances of two or more instances of apostrophes must be escaped, for example by using the <nowiki> tag or by using an XML entity. Examples:

Wikitext Rendered text
'''Bold text''' Bold text
''Italic text'' Italic text
I have '''nested bold ''and'' italic ''' text! I have nested bold and italic text!

Linking[]

Internal links[]

Internal hyperlinks (that is, a link to another page in the same wiki) are enclosed with double square brackets ([[...]]). A link to the same page is usually rendered as bold non-linked text. (This proves effective in navigational boxes.) Pages that do not exist in the wiki are replaced with a red link to create that page. Illegal text are not rendered. Example:

Wikitext Rendered text
[[Extensible Markup Language]] Extensible Markup Language
[[This page does not exist]] This page does not exist
[[Wikitext]] Wikitext (assuming the title of the page is "Wikitext")
[[Illegal }link]] [[Illegal }link]]

Sections and anchors may be linked to using a number sign "#", as in HTML. For sections in the same page, the page name is omitted. Example:

Wikitext Rendered text
[[Extensible Markup Language#Entity references]] Extensible Markup Language#Entity references
[[#Piped links]] #Piped links
Piped links[]

To specify text with the link, add a pipe then append the text. This is called a piped link. Some wikis support automatic conversion when a pipe is added at the end but no text is apecified, for example, [[Some link|]], such as omission of the namespace name and omission of text in parentheses. Plural forms and similar text transformations may be achieved without using pipes by appending immediately after the closing bracket. When detected, they are rendered as "inside" the link.

Input wikitext Converted wikitext Rendered text
[[Extensible Markup Language|XML]] Same XML
[[Help:Editing|]] [[Help:Editing|Editing]] Editing
[[Byte]]s Same Bytes

External links[]

External hyperlinks can be specified explicitly. To specify text with the link, a space is appended after the link and the text follows, then the whole thing is enclosed in single square brackets. E-mail addresses may also be specified this way. Examples:

Wikitext Rendered text
http://example.net/ http://example.net
[http://example.com Example pages] Example pages

Sections[]

Section text is enclosed by equal signs ("="). The topmost heading has one equal sign ("=Heading 1="), the second-level heading has two ("==Heading2=="), and so on. The page title is equivalent to the top-level heading, so using one equal sign is not recommended. Section headings must be in a new line.

Images and media[]

Images[]

Images can be generated using internal link syntax, for example, "[[Image:Flowers.jpg]]". For images, an image caption can be added using piped link syntax, for example, [[Image:Flowers.jpg|A garden of blueberries]]. Additional parameters for the image syntax exist: left (floats to the left), right (floats to the right), none (goes inline with text), thumb (appears in the thumbnail with a caption), frame (appears in a frame), and <size><unit> (width is adjusted to <size> in units specified by <unit>, aspect ratio preserved). <width>x<height><unit> specifies an area boundary for the image: the image cannot be larger than that area, but it still maintains its aspect ratio. By default, large images are sized down, and such formats as SVG are converted, for example, to PNG.

To link to the image or media itself, use the Media keyword, for example "[[Media:Flowers.jpg]]" directly links to the file "Flowers.jpg". To link to the description page, insert a colon at the beginning, for example, "[[:Image:Flowers.jpg]]".

Lists and indentation[]

Unordered list items start with an asterisk (*) on each line. Ordered list items start with a number sign (#) and are automatically numbered, depending on the style. Indentation can be increased using a colon (:). These three may also be nested and repeated within each other. For example:

Wikitext Rendered text
* Item 1
* Item 2
** Item 2.1
*# Hydrogen
*# Helium
*: Indented text
: Just indented
  • Item 1
  • Item 2
    • Item 2.1
    1. Hydrogen
    2. Helium
    Indented text
Just indented

Categories[]

Pages can be categorized using link syntax to the Category page of the category, for example, "[[Category:Entertainment]]". This kind of text is not rendered in the page body, but all categories in a page is displayed in a separate section. To link to the category itself, insert a colon at the beginning, for example, "[[:Category:Entertainment]]".

Sort keys are specified by appending a pipe followed by the sort key after the category name. Sort keys are used to modify a page's sort order as it appears in a Category page. For example, it is a convention to sort English people by surname, so a sort key like "Smith, John" (for example, [[Category:Representative names|Smith, John]]).

Interwiki links[]

A link to another language version of the wiki or another wiki (a list of these wikis is stored in an interwiki table) may be specified using link syntax, as in the Categories section. Inter-language links themselves are not displayed, but all such links are displayed in a separate section.

Tables[]

Table content is enclosed in a bracket and vertical bar combination ("{| ... |}"), that must be in separate lines. Table rows start with a vertical bar and hyphen combination ("|-") and end with another of such or the end of the table. Table cells / data can be specified in separate lines starting with a pipe ("|") or in a single line starting with a pipe with two pipes ("||") separating each cell. Combinations of these may also be used.

Table captions may be specified using a pipe and plus sign combination ("|+") at the start of the line.

Table headings may be in either the start of the table (without starting a row) or in a row, using the exclamation mark ("!").

Preformatted text[]

Preformatted text can be rendered by using leading spaces in each line. Equivalent HTML markup for this is the <pre> tag.

Transclusion[]

Templates may be transcluded into the current page by enclosing the template's name in double curly brackets ("{{ ... }}"). Pages other than those in the Template namespace may also transcluded by including the namespace name. (Pages in the Main namespace are just preceded by a colon. For example, "{{:Example page}}".

In a template, parameters may be specified by a parameter name enclosed in triple curly brackets ("{{{ ... }}}"). Parameters are called by adding a pipe, followed by the parameter name, the equals sign, and the parameter value in the template call. When the parameter name is not specified, numbers are assumed, starting from 1. Examples:

Template name Template content Template call Rendered text
[Template:]Disp age Age: {{{age}}} {{Disp age|age=12}} Age: 12
[Template:]T1 a{{{1}}}c {{T1|ggg}} agggc
[Template:]T1 a{{{1}}}c {{T1|1=ggg}} agggc
Parameters

Default parameter values can be specified by adding a pipe followed by the default text to the parameter name. Just a pipe added indicates blank default value. If there is no default text, the parameter name together with the triple brackets will not be rendered. Examples:

Template name Template content Template call Rendered text
[Template:]T1 a{{{1|b}}}c {{T1}} abc
[Template:]T1 a{{{1|}}}c {{T1}} ac
[Template:]T1 a{{{1}}}c {{T1}} a{{{1}}}c

Templates, parameters and default values may be nested (together with their wikitext). The pipe character is escaped by using an XML entity or by using a page, usually named Template:!, with the content "|". Transcluding this template has the effect of not making it a default parameter value separator.

Encapsulation

You may choose not to include text in transclusion by enclosing it with <noinclude> tags. On the other hand, you may choose text to be only included in transclusion and not displayed in the page text by enclosing it with <includeonly> tags. <onlyinclude> tags will only include the text within it, and also displays the text in the page.

Substitution

Templates may be substituted, that is, the template call will itself be replaced with its content, by inserting "subst:" before the template name. Rules of encapsulation of wikitext also apply.

Signatures[]

Users of a MediaWiki-based site can sign a signature specified in their preferences using four tildes ("~~~~"), which will usually substitute their username or IP address followed by a link to their talk page, followed by the date and time the page was saved. Three tildes will only substitute their username, while five tildes will substitute an extended signature format.

Redirection[]

Pages that redirect to another page, called a "redirect page", by using "#REDIRECT" followed by a simple internal link to the page. When the redirect page is rendered, it does not technically redirect to the target page, the target page itself is rendered, with a link back to the redirect page. Template calls to a redirect page will transclude the target page itself.

Magic words[]

Magic words are special strings of text that do certain effects on the page. One of these is the directive-like #REDIRECT. Another useful magic word is the <nowiki> tag, which instructs the parser not to parse its content and leave it as-is. (Even a simple single nowiki tag slightly breaks the parsing of content)

Double underscores

Magic words with double underscore specify more control over the rendering of the page than content. Some of these are __NOTOC__ (do not render table of contents), __TOC__ (render table of contents here) and __NOEDITSECTION__ (hide edit links beside section headings).

Variables

A number of variables exist, each of which look like a template call to a template in all caps. Some may even be substituted. Some of these are time variables that return the current date or time in either UTC or local time (CURRENTDAY, CURRENTTIME, LOCALTIMESTAMP, ...), page information (PAGENAME, FULLPAGENAME, REVISIONID, SITENAME, SERVER, ...), site statistics (NUMBEROFPAGES, CURRENTVERSION, ...), and others (PAGESIZE, ...).

Template modifiers

These exist to disambiguate between templates, magic word variables, and also provide access to the MediaWiki namespace. Some of these int:<system message name> (access the page in the MediaWiki namespace, considering the language), msg:<template name> (override any magic words with the name and use the template), and subst: (substitute the template).


Parser functions

These are special calls that act as functions acting on its input. Most look like a template call to a template preceded with a number sign "#" (which is impossible to create). Aside from the standard set of parser functions, more may be defined using extensions Togel Terpercaya.

Miscellaneous magic words
Magic word Description
{{DISPLAYTITLE:<new title>}} Replaces the title of the pages. Proves useful for changing its captilization.
{{DEFAULTSORT:<sort key>}} Specifies a default sort key.

Extensions[]

Extensions are add-ons added to a wiki that may add some additional functionality. Some standard parser-based extensions are "ParserFunctions", a set of programming language-like parser functions (which greatly aid in templates), "Cite", support of references using the <ref> tag (citation item) and <references/> tag (citation list of all items in the page), "Poem", automatically adds line breaks, overriding the default parsing of text in it, "CharInsert", adds a <charinsert> tag that inserts text into a text box when clicked, "ImageMap", rendering of HTML image maps using the <imagemap> tag, and "EasyTimeline", renders a timeline image using the <timeline> tag.

Math[]

Math symbols and formulae may be rendered using the <math> tag. Formulae must be in a TeX format.

Horizontal rule[]

A horizontal rule can be rendered using four hyphens ("----"), but usage of such is not recommended.

Comments[]

Comments are enclosed in <!-- ... --> tags, as in XML. These are ignored by the parser itself and is ignored, thus it does not show up in the page's source.

Usage of HTML[]

Main article: HyperText Markup Language

A subset of HTML is sometimes supported in some wikis. For instance, this is the standard set of HTML that can be used in a MediaWiki website:

  • <b> (bold text)
  • <big> (large text)
  • <blockquote> (quoted text)
  • <br> (line break)
  • <caption> (table caption)
  • <center> (centered text)
  • <cite> (citation)
  • <code> (code)
  • <dd> (definition)
  • <del> (deleted text/text with strikethrough)
  • <div> (container)
  • <dl> (definition list)
  • <dt> (definition term)
  • <em> (emphasized text/italic text)
  • <font>
  • <h1> (top-level heading)
  • <h2> (heading 2)
  • <h3> (heading 3)
  • <h4> (heading 4)
  • <h5> (heading 5)
  • <h6> (heading 6)
  • <hr> (horizontal rule)
  • <i> (italic text)
  • <ins> (inserted text/underlined text)
  • <li> (list item)
  • <ol> (ordered list)
  • <p> (paragraph)
  • <pre> (pre-formatted text)
  • <rb> (ruby text body)
  • <rp> (ruby parenthesis)
  • <rt> (ruby text)
  • <ruby> (ruby text marker)
  • <s> (text with strikethrough)
  • <small> (small text)
  • <span> (inline span)
  • <strike> (text with strikethrough)
  • <strong> (strong emphasis/bold text)
  • <sub> (subscript)
  • <sup> (superscript)
  • <table> (table)
  • <td> (table data)
  • <th> (table heading)
  • <tr> (table row)
  • <tt> (teletype)
  • <u> (underlined text)
  • <ul> (unordered list)
  • <var> (source code variable)
  • <!-- ... --> (comment)

References[]

  • Help:Editing - Meta-Wiki (Wikimedia)
  • ( The contained information is FALSE, wikepedia is a silly little website
Advertisement