Meryam Sahin (talk | contribs) No edit summary |
Meryam Sahin (talk | contribs) No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<status color="green" light="true">done</status> <br> | |||
Wikitext is a simplified markup language used to format and structure content in wiki systems. Wikitext can be entered directly in '''source editing''' mode. VisualEditor also generates Wikitext when content is formatted in the visual editor. | Wikitext is a simplified markup language used to format and structure content in wiki systems. Wikitext can be entered directly in '''source editing''' mode. VisualEditor also generates Wikitext when content is formatted in the visual editor. | ||
==Edit Wikitext== | ==Edit Wikitext== | ||
When editing a page, switch between visual editing and source editing using the editor toolbar. | When editing a page, switch between visual editing and source editing using the editor toolbar. | ||
[[File.png|alt= | [[File:visualeditor-switch-edit-mode.png|alt=VisualEditor menu for switching between edit modes|center]] | ||
Source editing allows direct access to the Wikitext that defines the page content. VisualEditor generates Wikitext in the background. For example, when text is formatted as bold in VisualEditor, the corresponding Wikitext is <code><nowiki>'''bold'''</nowiki></code>. <br> | Source editing allows direct access to the Wikitext that defines the page content. VisualEditor generates Wikitext in the background. For example, when text is formatted as bold in VisualEditor, the corresponding Wikitext is <code><nowiki>'''bold'''</nowiki></code>. <br> | ||
Use source editing when a formatting option is not available in VisualEditor or when existing Wikitext needs to be corrected directly. | Use source editing when a formatting option is not available in VisualEditor or when existing Wikitext needs to be corrected directly. | ||
Latest revision as of 14:47, 19 August 2026
done
Wikitext is a simplified markup language used to format and structure content in wiki systems. Wikitext can be entered directly in source editing mode. VisualEditor also generates Wikitext when content is formatted in the visual editor.
Edit Wikitext
When editing a page, switch between visual editing and source editing using the editor toolbar.
Source editing allows direct access to the Wikitext that defines the page content. VisualEditor generates Wikitext in the background. For example, when text is formatted as bold in VisualEditor, the corresponding Wikitext is '''bold'''.
Use source editing when a formatting option is not available in VisualEditor or when existing Wikitext needs to be corrected directly.
Common Wikitext syntax
The following examples show common Wikitext syntax for formatting and structuring content.
Format text
Use apostrophes or HTML tags to format text:
'''bold'''- bold''italic''- italic<u>underlined</u>— underlined
Structure content
Wikitext uses equal signs for headings and asterisks for unordered lists.
== Heading ==- heading* List item- unordered list
Use Wikitext syntax to define tables. For example:
{| class="wikitable"
|-
! Header 1
! Header 2
|-
| Row 1, cell 1
| Row 1, cell 2
|-
| Row 2, cell 1
| Row 2, cell 2
|}
Create links
Use double square brackets to create links to pages within the wiki.
[[Wikipage|Label]] [[Pancake|Best Pancake]]
Use single square brackets to create links to external websites.
[url label] [https://wikipedia.org Wikipedia]
Wikitext can also create links with parameters.
For example:
<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page]</span>
This example creates a link that opens the referenced page in edit mode in a new tab.
Add files
Use the File: namespace to embed a file on a page:
[[File:image-or-pdf-name.png]]
If the wiki can generate a preview for the file type, the wiki embeds the preview on the page. Otherwise, the wiki creates a link to the file description page.
The following file types can be embedded:
- TIFF, with the appropriate extension
Microsoft Office and LibreOffice files, shell scripts, and similar file types cannot be embedded.
Use the Media: namespace to create a direct link to a file:
[[Media:image-or-pdf-name.png]]
To link to the file description page instead, add a colon before the namespace:
[[:File:image-or-pdf-name.png]]
Magic words
Magic words are special Wikitext strings that MediaWiki interprets as a specific value or function.
| Type of Wikitext | Example |
|---|---|
| Special character | ã
ç
UTF-8 characters are also supported. |
| Comment | <!-- unnoticed --> |
| Display Wikitext without rendering it | <nowiki>{{!}}-{{!}}</nowiki> |
| Table of contents | TOC and NOTOC |
| Signature | --~~~ |
| Redirect | #REDIRECT [[targetpage]] |
| Template | {{template name}} |
The <nowiki> tag prevents Wikitext from being interpreted. This is useful when Wikitext syntax needs to be displayed as text, for example when documenting Wikitext.
For a complete list of magic words, see MediaWiki:Magic words.
HTML in Wikitext
Some HTML tags can be used in Wikitext. Paragraph and character formatting tags are particularly useful for formatting templates or pages, but are usually not required for basic page editing.
Allowed HTML tags
The following HTML tags are supported:
- Paragraph and character formatting:
<div>,<span>,<p>,<br>,<hr> - Table formatting:
<table>,<tr>,<td>,<th> - Headings:
<h1>,<h2>
For a complete list of supported HTML tags, see MediaWiki:HTML in wikitext.
Disallowed HTML tags
The following HTML tags are not allowed in Wikitext:
<a><img><script><form><fieldset><head><title>
Related MediaWiki documentation
Most source-editing functionality originates from MediaWiki. The following pages provide detailed information about Wikitext syntax:
| Topic | MediaWiki documentation |
|---|---|
| Wikitext | MediaWiki:Formatting |
| Links | MediaWiki:Links |
| Images | MediaWiki:Images |
| Magic words | MediaWiki:Magic words |
| Parser functions | MediaWiki:Extension:ParserFunctions |
| Wikitext examples | MediaWiki:Wikitext examples |
| HTML in Wikitext examples | MediaWiki:HTML in Wikitext |