« Modèle:Code » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 23 : Ligne 23 :
{{#tag: syntaxhighlight |{{{code}}}| lang={{{lang}}} | class={{{class|}}}}}
{{#tag: syntaxhighlight |{{{code}}}| lang={{{lang}}} | class={{{class|}}}}}
|}
|}
{{#if: {{{collapsed}}} | collapsed | NOT collapsed}}<br>
{{#ifeq:{{{collapsed|}}}|{{{collapsed}}}| collapsed was defined (and may be empty) | collapsed was not defined }}
{{#if: {{{p1|}}} | p1: {{{p1}}} | No p1}}
</includeonly>
</includeonly>

Version du 20 avril 2023 à 01:57

Ajout d'une image à gauche du code et coloration syntaxique avec syntaxhighlight

Utilisation

Mediawiki.svg
{{code | lang=bash | code=cd $home}}

{{#ifeq:|{{{collapsed}}}| collapsed was defined (and may be empty) | collapsed was not defined }}


Exemple

Bash.svg
cd $home

{{#ifeq:|{{{collapsed}}}| collapsed was defined (and may be empty) | collapsed was not defined }}


Code

Mediawiki.svg
{| class="kode"
|[[File:{{{lang}}}.svg|40px|link=]]
|
{{#tag: syntaxhighlight |{{{code}}}| lang={{{lang}}} | class="{{{class|}}}"}}
|}

{{#ifeq:|{{{collapsed}}}| collapsed was defined (and may be empty) | collapsed was not defined }}