<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://compusofia.com/w/index.php?action=history&amp;feed=atom&amp;title=Manual%3AExtending_wiki_markup%2Fen</id>
	<title>Manual:Extending wiki markup/en - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://compusofia.com/w/index.php?action=history&amp;feed=atom&amp;title=Manual%3AExtending_wiki_markup%2Fen"/>
	<link rel="alternate" type="text/html" href="https://compusofia.com/w/index.php?title=Manual:Extending_wiki_markup/en&amp;action=history"/>
	<updated>2026-04-18T20:21:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://compusofia.com/w/index.php?title=Manual:Extending_wiki_markup/en&amp;diff=7490&amp;oldid=prev</id>
		<title>FuzzyBot: Updating to match new version of source page</title>
		<link rel="alternate" type="text/html" href="https://compusofia.com/w/index.php?title=Manual:Extending_wiki_markup/en&amp;diff=7490&amp;oldid=prev"/>
		<updated>2026-04-17T09:12:32Z</updated>

		<summary type="html">&lt;p&gt;Updating to match new version of source page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
{{Magic words}}&lt;br /&gt;
MediaWiki provides a standard text markup that can be easily customized.&lt;br /&gt;
Extensions can customize wiki markup by:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Adding standard token types&amp;#039;&amp;#039;&amp;#039; &amp;amp;ndash; The standard approach to customized MediaWiki markup is to add new markup that looks like the built-in MediaWiki [[Special:MyLanguage/Manual:Tag extensions|XML tags]] (&amp;lt;code&amp;gt;&amp;amp;lt;&amp;#039;&amp;#039;tag&amp;#039;&amp;#039;&amp;amp;gt;&amp;lt;/code&amp;gt;), [[Special:MyLanguage/Help:Templates|template]] (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{...}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;), or link markup (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[...]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Adding custom token types&amp;#039;&amp;#039;&amp;#039; &amp;amp;ndash; Some extensions define new token types.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Making fundamental changes to the parser&amp;#039;&amp;#039;&amp;#039; &amp;amp;ndash;  A few extensions attempt to fundamentally change the parsing strategy so that other markup languages can be used instead of the standard wiki markup.&lt;br /&gt;
&lt;br /&gt;
== Adding to the standard token types ==&lt;br /&gt;
&lt;br /&gt;
The simplest way to extend wiki markup is by adding to a standard token type using one of these features.&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
A variable calls a PHP function that outputs a string of {{ll|wikitext}} that replaces the variable on the page.&lt;br /&gt;
Variables are usually used to insert system information into wiki markup, such as the current time or the current page.&lt;br /&gt;
&lt;br /&gt;
Syntax example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{VARIABLENAME}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define a variable, see {{ll|Manual:Variables}}.&lt;br /&gt;
For a list of extensions that define custom variables, see {{ll|Category:Variable extensions}}.&lt;br /&gt;
&lt;br /&gt;
=== Parser functions ===&lt;br /&gt;
Like variables, a parser function calls a PHP function and outputs a wikitext string that replaces the parser function on the page.&lt;br /&gt;
Unlike variables, a parser function can pass parameters to the PHP function.&lt;br /&gt;
Parser functions are used to handle wikitext generation that involves logic that is too complex or confusing to write using templates.&lt;br /&gt;
&lt;br /&gt;
Syntax example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{#functionname: param1 | param2}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define a parser function, see {{ll|Manual:Parser functions}}.&lt;br /&gt;
For a list of extensions that define custom parser functions, see {{ll|Category:Parser function extensions}}.&lt;br /&gt;
&lt;br /&gt;
=== Parser tags ===&lt;br /&gt;
Unlike variables and parser functions, which output wikitext, parser tags output HTML.&lt;br /&gt;
A parser tag is an [[w:XML|XML]] tag that calls a PHP function, parses the contents of the tag, and outputs HTML that replaces the tag and its contents on the page.&lt;br /&gt;
Parser tags can also pass arguments to the PHP function.&lt;br /&gt;
For example, {{tag|syntaxhighlight|open}} is a parser tag defined by {{ll|Extension:SyntaxHighlight}}.&lt;br /&gt;
&lt;br /&gt;
Syntax example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;tagname param1name=&amp;quot;param1value&amp;quot; param2name=&amp;quot;param2value&amp;quot;&amp;gt; some text &amp;lt;/tagname&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define a parser tag, see {{ll|Manual:Tag extensions}}.&lt;br /&gt;
For a list of extensions that define custom parser tags, see {{ll|Category:Tag extensions}}.&lt;br /&gt;
&lt;br /&gt;
=== Behavior switches ===&lt;br /&gt;
A behavior switch calls a PHP function, but, unlike other methods of extending wiki markup, behavior switches usually do not output any content.&lt;br /&gt;
Instead, they change the behavior of the page or set a page property.&lt;br /&gt;
For example, adding &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;__NOTOC__&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to a page hides the table of contents.&lt;br /&gt;
&lt;br /&gt;
Syntax example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;__SWITCHNAME__&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define a behavior switch, see {{ll|Manual:Magic words#Behavior switches (double underscore magic words)}}.&lt;br /&gt;
For a list of extensions that define custom behavior switches, see {{ll|Help:Magic words#From Extensions}}.&lt;br /&gt;
&lt;br /&gt;
=== Link markup ===&lt;br /&gt;
&lt;br /&gt;
Link markup customizations change the way MediaWiki interprets internal links.&lt;br /&gt;
&lt;br /&gt;
Syntax example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;[[ ... ]]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a list of extensions that define custom link markup, see {{ll|Category:Link markup extensions}}.&lt;br /&gt;
&lt;br /&gt;
== Adding new token types ==&lt;br /&gt;
&lt;br /&gt;
To add new token types or to change the entire markup strategy, implementers need to add functions to one or more of the various parser and page output [[Special:MyLanguage/Manual:Hooks|hooks]]:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;{{ll|Category:ParserBeforeInternalParse extensions}}&amp;#039;&amp;#039;&amp;#039; rely on the {{ll|Manual:Hooks/ParserBeforeInternalParse|ParserBeforeInternalParse}} hook.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;{{ll|Category:OutputPageBeforeHTML extensions}}&amp;#039;&amp;#039;&amp;#039; rely on the {{ll|Manual:Hooks/OutputPageBeforeHTML|OutputPageBeforeHTML}} hook.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;{{ll|Category:ParserAfterTidy extensions}}&amp;#039;&amp;#039;&amp;#039; rely on the {{ll|Manual:Hooks/ParserAfterTidy|ParserAfterTidy}} hook.&lt;br /&gt;
&lt;br /&gt;
See also {{ll|Category:Extensions by hook usage}}.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{ll|Manual:Extensions}} - provides general instructions for finding, installing, and writing extensions.&lt;br /&gt;
&lt;br /&gt;
{{Extension development}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Parser extensions{{#translation:}}|*{{PAGENAME}}]]&lt;br /&gt;
[[Category:Customization techniques{{#translation:}}|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>FuzzyBot</name></author>
	</entry>
</feed>