| Ligne 32 : | Ligne 32 : | ||
Voir {{weblink |link=https://pygments.org/docs/lexerdevelopment/}} | Voir {{weblink |link=https://pygments.org/docs/lexerdevelopment/}} | ||
* Cloner la repository de pygments en local | |||
{{indent |Le site est {{githublink |link=pygments/pygments}}}} | {{indent |Le site est {{githublink |link=pygments/pygments}}}} | ||
{{syntaxhighlight |lang=git |code = git clone https://github.com/pygments/pygments.git}} | {{syntaxhighlight |lang=git |code = git clone https://github.com/pygments/pygments.git}} | ||
* Ajouter le lexer souhaité sous le répertoire {{File |pygments/lexers}} en respectant bien les champs à remplir | |||
{{syntaxhighlight |lang=python|code={{#!: | {{syntaxhighlight |lang=python|code={{#!: | ||
class ClearcaseLexer(RegexLexer): | class ClearcaseLexer(RegexLexer): | ||
| MediaWiki/Mes Extensions/SyntaxHighlight | |
|---|---|
| Nom | SyntaxHighlight |
| Lien | |
| Github | |
Mise en forme de code
MediaWiki/Mes_Extensions
La nouvelle version utilise la librairie Pygments .
Elle permet d'ajouter un langage.
Pour cela il faut modifier la librarie utilisée qui est pygments
J'ai ajouté le langage Clearcase
Je l'utilise au travers du modèle Modèle:Syntaxhighlight
{{syntaxhighlight | lang=php|code=require_once("$IP/extensions/SyntaxHighlight_GeSHin/SyntaxHighlight_GeSHi.php");}}
require_once("$IP/extensions/SyntaxHighlight_GeSHin/SyntaxHighlight_GeSHi.php");
Voir
https://pygments.org/docs/lexerdevelopment/
Le site est pygments/pygments
git clone https://github.com/pygments/pygments.gitclass ClearcaseLexer(RegexLexer):
"""
Lexer for (ba|k|z|)sh shell scripts.
"""
name = 'Clearcase'
mimetypes = ['application/text']
filenames = ['*.clr']
aliases = ['clearcase']
url = 'https://fr.wikipedia.org/wiki/Rational_ClearCase'
version_added = '2.19.1'