Meryam Sahin (talk | contribs) No edit summary |
Meryam Sahin (talk | contribs) No edit summary |
||
| Line 81: | Line 81: | ||
|} | |} | ||
The <code><nowiki><nowiki></nowiki></code> tag prevents Wikitext from being interpreted. This is useful when Wikitext syntax needs to be displayed as text, for example when documenting Wikitext. <br> | The <code><nowiki><nowiki></nowiki></code> tag prevents Wikitext from being interpreted. This is useful when Wikitext syntax needs to be displayed as text, for example when documenting Wikitext. <br> | ||
For a complete list of magic words, see [https://www.mediawiki.org/wiki/Help MediaWiki: | For a complete list of magic words, see [https://www.mediawiki.org/wiki/Help:Magic_words MediaWiki:Magic words]. | ||
==HTML in Wikitext== | ==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. | 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. | ||
| Line 89: | Line 89: | ||
*Table formatting: <code><nowiki><table></nowiki></code>, <code><nowiki><tr></nowiki></code>, <code><nowiki><td></nowiki></code>, <code><nowiki><th></nowiki></code> | *Table formatting: <code><nowiki><table></nowiki></code>, <code><nowiki><tr></nowiki></code>, <code><nowiki><td></nowiki></code>, <code><nowiki><th></nowiki></code> | ||
*Headings: <code><nowiki><h1></nowiki></code>, <code><nowiki><h2></nowiki></code> <br> | *Headings: <code><nowiki><h1></nowiki></code>, <code><nowiki><h2></nowiki></code> <br> | ||
For a complete list of supported HTML tags, see [https://www.mediawiki.org/wiki/Help MediaWiki: | For a complete list of supported HTML tags, see [https://www.mediawiki.org/wiki/Help:HTML_in_wikitext MediaWiki:HTMLin wikitext]. | ||
===Disallowed HTML tags=== | ===Disallowed HTML tags=== | ||
The following HTML tags are not allowed in Wikitext: | The following HTML tags are not allowed in Wikitext: | ||
Revision as of 07:45, 19 August 2026
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.
alt=Screenshot: Visual Editor switch edit mode|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 '''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:HTMLin 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 | Help:Formatting |
| Links | Help:Links |
| Images | Help:Images |
| Magic words | Help:Magic words |
| Parser functions | Help:Extension:ParserFunctions |
| Wikitext examples | Help:Wikitext examples |
| HTML in Wikitext examples | Help:HTML in Wikitext |