Manual:Extending wiki markup/fr

MediaWiki fournit un marquage standard du texte pounvant être facilement adapté. Il est possible de faire à la fois des adaptations individuelles et des adaptations globales :


 * 1) ajouter des types de balises standards : l'approche classique du marquage MediaWiki personnalisé est d'ajouter de nouvelles marques qui ressemblent aux balises XML déjà embarquées dans MediaWiki, aux modèles , ou aux balises de liens.


 * adding custom token types: Some extensions define new token types. For example, Extension:ParserPhase2, adds several token types: ,  , and.


 * fundamental changes to the parser: A few extensions attempt to fundamentally change the parsing strategy so that markup from other sorts of wikis and content management can be used (must be used?) instead of the standard wiki markup.

Ajouts aux types de balises standards
When  is implemented as a parser function, it passes its template parameters to a PHP function instead of the usual template article. This function returns a string of wiki text that replaces the parameterized template. Parser functions are used to handle wiki text generation that involves logic that is too complex or confusing to write using normal template-writing techniques.
 * Parser function extensions: Parser function extensions extend parameterized template processing and typically look something like this: .  Although any "template name" can be used, custom extensions always begin the function name with a #, as in the example above. Other parser function names are reserved for use by the MediaWiki core.

Instead of the usual article transclusion,  is associated with a PHP function that returns a string of wiki text that replaces it. They are usually used to insert system information into wiki markup (e.g., the current time, the current page).
 * Variable extensions: Variable extensions extend parameterless template processing.

 some text The text between the tags gets passed on to a PHP function which parses the contents of the tag and returns an HTML string that replaces the tag and text. The content inside the tags may be wiki markup, straight text, or text with formatting rules specific to the tag. It is up to the extension implementer. Please check documentation of individual extensions.
 * XML markup extensions: XML markup extensions (also known as tag extensions) define custom XML-style tags in the wikitext:


 * Link markup extensions: Link markup extensions change the way MediaWiki interprets internal links, i.e., wiki markup of the form ....


 * Extended syntax extensions: Extended syntax extensions, mostly Magic Word extensions, add to the list of MediaWiki Magic Words, such as . Usually, a specific PHP function interprets these words, and either replaces them with something, or sets some conditions for later processing during output generation, or both. Most usually, the replacement is the empty string; that is, the Magic Word is deleted, and nothing is shown in its place. Altered processing may involve addition of an extra piece of CSS, or suppression of user preference settings during page generation, and can be almost anything.

Adding new token types
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 hooks:
 * Category:ParserBeforeStrip extensions rely on the ParserBeforeStrip hook.


 * Category:ParserAfterStrip extensions rely on the ParserAfterStrip hook.


 * Category:ParserBeforeInternalParse extensions rely on the ParserBeforeInternalParse hook.


 * Category:OutputPageBeforeHTML extensions rely on the OutputPageBeforeHTML hook.


 * Category:ParserBeforeTidy extensions s'appuie sur l'accroche ParserBeforeTidy.


 * Category:ParserAfterTidy extensions s'appuie sur l'accroche ParserAfterTidy.

Voir aussi

 * - fournit les instructions générales pour trouver, installer et écrire des extensions.