Extension:HTML Tags/fr

L'extension HTML Tags définit la balise utilisable pour afficher sur les pages wiki, des balises HTML qui seraient refusées par l'analyseur MediaWiki.

HTML Tags a été développée intialement pour autoriser la prise en charge de l'utilisation des balises LRMI (Learning Resource Metadata Initiative) à l'intérieur des pages MediaWiki. Voir Implémenter LRMI pour savoir comment implémenter ces éléments en utilisant des balises HTML. Tags.

Un autre usage potentiel des balises HTML est de pouvoir inclure des microdonnées (particulièrement d'un type qui ne peut déja pas être inclus en utilisant ).

Une démonstration de base de cette exension est disponible ici.



Code et téléchargement
Télécharger le .zip du code des balises HTML.

Ou bien télécharger le code directement de Git à partir du répertoire de code source MediaWiki. A partir de la ligne de commande, entrez :

Pour afficher le code en ligne, y compris l'historique des versions de chaque fichier, allez ici.

Installation
After you've obtained an 'HTMLTags' directory (either by extracting a compressed file or downloading via Git), place this directory within the main MediaWiki 'extensions' directory. Then, in the file 'LocalSettings.php' in the main MediaWiki directory, add the following line:

You then need to specify the allowed set of HTML tags, and the allowed set of attributes for each one, using the global variable $wgHTMLTagsAttributes. For instance, to allow the tag, and to allow only the attributes "href" and "class" for it, you would add the following to LocalSettings.php, after the inclusion of LocalSettings.php:

If you wanted to allow the tag, but without any allowed attributes, you would add the following:

Utilisation
Once a set of allowed tags and attributes are specified, you can use to place those tags on the page. You use the attribute "tagname" to specify the actual tag, and then add the other attributes exactly as you want them to appear. The "contents" of the tag become the contents of.

For instance, if the above lines are added, and you want to add a link on some page using the tag, you could add something to the page like:

This will add the following to the page's HTML source:

Calling with a tag name that is not allowed will result in an error message; calling it with an attribute that is not allowed will simply lead to the attribute being ignored.

See Implementing LRMI for a full description of how this extension, along with some templates, can be used to allow for easy adding of LRMI metadata to pages.

Auteurs
HTML Tags was written by Yaron Koren, reachable at yaron57 -at- gmail.com.

This extension was funded by Creative Commons as part of the LRMI project.



Historique des versions
HTML Tags is currently at version 0.3.

The version history is:
 * 0.1 - November 1, 2012 - Initial version
 * 0.2 - May 27, 2014 - i18n messages moved into JSON files; various fixes
 * 0.3 - January 22, 2020 - converted to extension registration



Voir aussi

 * - list of extensions that allow for the inclusion of raw HTML
 * Extension:AnchorHandler – Allows inserting anchor tags into wikitext