Meryam Sahin (talk | contribs)
Created page with "<bookshelf src="Book:User manual" /> <section begin="training-intro" /> <div class="training"> Wikitext is a simplified markup language that is used to format and structure text and other data. <section end="training-intro" /><section end="training-intro" /> While HTML is the most common markup language for web pages, Wikitext is used in wiki systems. Like HTML, it uses tags to mark parts of text or other data. ==How do I use Wikitext?== When you edit a page, you can s..."
 
Meryam Sahin (talk | contribs)
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<bookshelf src="Book:User manual" />
<status color="green" light="true">done</status> <br>
<section begin="training-intro" />
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.
<div class="training">
==Edit Wikitext==
Wikitext is a simplified markup language that is used to format and structure text and other data. <section end="training-intro" /><section end="training-intro" />
When editing a page, switch between visual editing and source editing using the editor toolbar.  
 
[[File:visualeditor-switch-edit-mode.png|alt=VisualEditor menu for switching between edit modes|center]]
While HTML is the most common markup language for web pages, Wikitext is used in wiki systems. Like HTML, it uses tags to mark parts of text or other data.
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.
==How do I use Wikitext?==
==Common Wikitext syntax==
When you edit a page, you can switch between visual editing and source editing using the editor toolbar.
The following examples show common Wikitext syntax for formatting and structuring content.
[[File:editing.png|alt=Screenshot: Visual Editor switch edit mode|center]]
===Format text===
 
Use apostrophes or HTML tags to format text:
Wikitext can be entered in source editing mode. When you are in visual editing mode, VisualEditor inserts Wikitext "behind the scenes". If VisualEditor doesn't format elements on a page correctly, you can always switch to source editing to correct the issues directly in Wikitext.<br />
*<code><nowiki>'''bold'''</nowiki></code> - '''bold'''
 
*<code><nowiki>''italic''</nowiki></code> - ''italic''
==Examples of Wikitext==
*<code><nowiki><u>underlined</u></nowiki></code> — <u>underlined</u>
Here are some typical examples of Wikitext:
===Structure content===
<section begin="training" />
Wikitext uses equal signs for headings and asterisks for unordered lists.
===Text formatting===
*<code>== Heading ==</code> - heading
<section begin="training-slide1" />
*<code>* List item</code> - unordered list <br>
 
Use Wikitext syntax to define tables. For example:
*This is <code><nowiki>'''bold'''</nowiki></code>
<syntaxhighlight lang="text">
*This is <code><nowiki>''italic''</nowiki></code>
{| class="wikitable"
*This is <code><nowiki><u>underlined</u></nowiki></code><section end="training-slide1" />
|-
 
! Header 1
===Structuring===
! Header 2
<section begin="training-slide2" />
|-
 
| Row 1, cell 1
*This is a <code>==Heading==</code>
| Row 1, cell 2
*This is an <code>*unordered list element</code>
|-  
*Table:<syntaxhighlight lang="text">
| Row 2, cell 1
{| class="wikitable"
| Row 2, cell 2
|}
</syntaxhighlight>
===Create links===
Use double square brackets to create links to pages within the wiki. <br>
<syntaxhighlight lang="text"> [[Wikipage|Label]] [[Pancake|Best Pancake]] </syntaxhighlight> <br>
Use single square brackets to create links to external websites. <br>
<syntaxhighlight lang="text"> [url label] [https://wikipedia.org Wikipedia] </syntaxhighlight> <br>
Wikitext can also create links with parameters.<br>
For example:
<syntaxhighlight lang="text"> <span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page]</span> </syntaxhighlight> <br>
This example creates a link that opens the referenced page in edit mode in a new tab.
===Add files===
Use the <code>File:</code> namespace to embed a file on a page: <syntaxhighlight lang="text"> [[File:image-or-pdf-name.png]] </syntaxhighlight> <br>
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. <br>
The following file types can be embedded:
*PDF
*TIFF, with the appropriate extension <br>
Microsoft Office and LibreOffice files, shell scripts, and similar file types cannot be embedded. <br>
Use the <code>Media:</code> namespace to create a direct link to a file:
<syntaxhighlight lang="text"> [[Media:image-or-pdf-name.png]] </syntaxhighlight> <br>
To link to the file description page instead, add a colon before the namespace:
<syntaxhighlight lang="text"> [[:File:image-or-pdf-name.png]] </syntaxhighlight>
==Magic words==
Magic words are special Wikitext strings that MediaWiki interprets as a specific value or function.
{|class="wikitable"
|-
|-
!header 1
!Type of Wikitext
!header 2
!Example
|-
|-
|row 1, cell 1
|Special character
|row 1, cell 2
|<syntaxhighlight lang="text">&atilde;</syntaxhighlight>→ ã <br>
<syntaxhighlight lang="text">&ccedil;</syntaxhighlight>→ ç <br>
UTF-8 characters are also supported.
|-
|-
|row 2, cell 1
|Comment
|row 2, cell 2
|<code><nowiki><!-- unnoticed --></nowiki></code>
|}</syntaxhighlight><section end="training-slide2" />
 
=== Links / Embedded files ===
<section begin="training-slide3" />
 
'''Link to internal wiki page'''
<syntaxhighlight lang="text">
[[Wikipage|Label]]
[[Pancake|Best Pancake]]
</syntaxhighlight>
'''Link to external website'''
<syntaxhighlight lang="text">
[url label]
[https://wikipedia.org Wikipedia]
</syntaxhighlight>
'''Link with parameters'''
<syntaxhighlight lang="text">
<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page]</span>
</syntaxhighlight>
This link opens the referenced page in edit mode in a new tab.
<section end="training-slide3" />
 
'''Embed image/file'''
 
<br />
<section begin="training-slide4" />
 
*<code>[['''Datei:'''<nowiki>image-or-pdf-name.png]]</nowiki></code> - - - '''Image/PDF is embedded on page'''<section end="training-slide4" />
**the wiki checks, if a preview can be generated (e.g., for "png", "jpeg", "gif", "svg") and embeds the preview
**otherwise, a link to the file description page is created
***can be embedded: PDF, Tiff (with extension)
***cannot be embedded: Microsoft Office- und Libre Office-Dateien; Shell-Skripte, ...<section begin="training-slide4" />
*<code>[['''Media:'''<nowiki>image-or-pdf--name.png]]</nowiki></code> - - - - '''Links to image / PDF'''
*<code>[[''':Datei:'''<nowiki>image-or-pdf--name.png]]</nowiki></code> - - - '''Links to file description page'''
<section end="training-slide4" /></div>
<section end="training" />
 
===Magic words===
{| class="contenttable"
! style="" |Type of Wikitext
! style="" |Example
|-
|-
| style="" |Special character
|Display Wikitext without rendering it
| style="" |'''<code>&amp;atilde;</code> &rarr; &atilde;'''
|<code><nowiki><nowiki>{{!}}-{{!}}</nowiki></nowiki></code>
'''<code>&amp;ccedil;</code> &rarr; &ccedil;'''
 
UTF-8 is possible
|-
|-
| style="" |Comment
|Table of contents
| style="" |<code>'''<nowiki><!-- unnoticed --></nowiki>'''</code>
|<code><nowiki>TOC</nowiki></code> and <code><nowiki>NOTOC</nowiki></code>
|-
|-
| style="" |No "wiki translation"
|Signature
| style="" |<code>'''&lt;nowiki'''&gt;</code> and <code>'''</pre'''></code>
|<code><nowiki>--~~~</nowiki></code>
|-
|-
| style="" |Table of contents
|Redirect
| style="" |<code>'''<nowiki>__TOC__</nowiki>'''</code> and <code>'''<nowiki>__NOTOC__</nowiki>'''</code>
|<code><nowiki>#REDIRECT [[targetpage]]</nowiki></code>
|-
|-
| style="" |Signature
|Template
| style="" |<code>'''<nowiki>--~~~</nowiki>'''</code>
|<code><nowiki>{{template name}}</nowiki></code>
|}
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:Magic_words 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: <code><nowiki><div></nowiki></code>, <code><nowiki><span></nowiki></code>, <code><nowiki><p></nowiki></code>, <code><nowiki><br></nowiki></code>, <code><nowiki><hr></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>
For a complete list of supported HTML tags, see [https://www.mediawiki.org/wiki/Help:HTML_in_wikitext MediaWiki:HTML in wikitext].
===Disallowed HTML tags===
The following HTML tags are not allowed in Wikitext:
*<code><nowiki><a></nowiki></code>
*<code><nowiki><img></nowiki></code>
*<code><nowiki><script></nowiki></code>
*<code><nowiki><form></nowiki></code>
*<code><nowiki><fieldset></nowiki></code>
*<code><nowiki><head></nowiki></code>
*<code><nowiki><title></nowiki></code>
==Related MediaWiki documentation==
Most source-editing functionality originates from MediaWiki. The following pages provide detailed information about Wikitext syntax:
{|class="wikitable"
|-
|-
| style="" |Redirect
!Topic
| style="" |<code>'''<nowiki>#REDIRECT [[targetpage]]</nowiki>'''</code>
!MediaWiki documentation
|-
|-
| style="" |Template
|Wikitext
| style="" |<code>'''<nowiki>{{template name}}</nowiki>'''</code>
|[https://www.mediawiki.org/wiki/Help:Formatting MediaWiki:Formatting]
|}
<section end="wikitextTraining" />
 
Other magic words are available [[Manual:MagicWords|via this link]].
 
== HTML tags ==
Some html tags can be used in wikitext. The paragraph and character formatting tags in particular are useful for formatting templates or pages, but are not usually required for creating and editing a page itself.
 
=== <span style="color: rgb(0, 0, 0)">Allowed tags</span> ===
 
* <span style="color: rgb(0, 0, 0)">Paragraph and character formatting: <nowiki><div>, <span>, <p>, <br></nowiki>, <nowiki><hr></nowiki></span>
* <span style="color: rgb(0, 0, 0)">Table formatting: <nowiki><table>, <tr></nowiki>,<nowiki><td></nowiki>, <nowiki><th></nowiki></span>
* <span style="color: rgb(0, 0, 0)">Headings: <nowiki><h1>, <h2></nowiki></span>
 
Complete overview: https://www.mediawiki.org/wiki/Help:HTML_in_wikitext/de
 
=== <span style="color: rgb(0, 0, 0)">Not allowed tags</span> ===
 
* <span style="color: rgb(0, 0, 0)">Classic html tags are not allowed, like <a>, <img>, <script>, <form>, <fieldset>, and structural tgas like <head> or  <title>.</span>
== Help pages for source code editing ==
As most of the source code editing functions - such as formatting with wikitext - originate directly from MediaWiki, these functions are documented on mediawiki.org. Below you will find a selection of help pages on the subject of source text editing:
{| class="wikitable" style="width:100%;"
! style="width:200px;" |Topic
! style="" |Help page
|-
|-
| style="width:200px;" |Wikitext
|Links
| style="" |General information on formatting with Wikitext
|[https://www.mediawiki.org/wiki/Help:Links MediaWiki:Links]
https://www.mediawiki.org/wiki/Help:Formatting
|-
|-
| style="width:200px;" |Links
|Images
| style="" |Include links
|[https://www.mediawiki.org/wiki/Help:Images MediaWiki:Images]
https://www.mediawiki.org/wiki/Help:Links
|-
|-
| style="width:200px;" |Bilder
|Magic words
| style="" |Include images
|[https://www.mediawiki.org/wiki/Help:Magic_words MediaWiki:Magic words]
https://www.mediawiki.org/wiki/Help:Images
|-
|-
| style="width:200px;" |Magic words
|Parser functions
| style="" |Magic words are text strings that Mediawiki links to a return value or a function. These are also an example of wikitext.
|[https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions MediaWiki:Extension:ParserFunctions]
https://www.mediawiki.org/wiki/Help:Magic_words
|-
|-
| style="width:200px;" |Parser-Funktionen
|Wikitext examples
| style="" |Parser functions can be used to insert simple logical queries, e.g. in templates.
|[https://www.mediawiki.org/wiki/Help:Wikitext_examples MediaWiki:Wikitext examples]
https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions
|-
|-
| style="" |Semantic MediaWiki
|HTML in Wikitext examples
| style="" |Parser functions: https://www.semantic-mediawiki.org/wiki/Help:Parser_functions
|[https://www.mediawiki.org/wiki/Help:HTML_in_wikitext MediaWiki:HTML in Wikitext]
Properties: https://www.semantic-mediawiki.org/wiki/Help:Property_declaration
|}
|}
{{Box Links-en
|Topic1=https://meta.wikimedia.org/wiki/Help:Wikitext_examples
|Topic2=https://www.mediawiki.org/wiki/Help:HTML_in_wikitext
|Topic3=[[Manual:MagicWords|Magic words]]
|Topic4=[[Manual:Wikitext/Wikitext_reference|Wikitext reference]]}}
[[de:Handbuch:Wikitext]]
[[Category:Editing]]
[[Category:Concept]]

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.

VisualEditor menu for switching between edit modes

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 
|}

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:

  • PDF
  • 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
&atilde;
→ ã
&ccedil;
→ ç

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>

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