« PowerShell/Personnalisation » : différence entre les versions

Aller à la navigation Aller à la recherche
 
(15 versions intermédiaires par le même utilisateur non affichées)
Ligne 13 : Ligne 13 :
** présentation.
** présentation.


=== Console foncée, éditeur foncé ===
=== PowerShell ISE, Console foncée, éditeur foncé ===
Avec "jetons du volet de script"
Avec "jetons du volet de script"


Ligne 57 : Ligne 57 :
| Variable                            || {{CouleurHexa|ff4500}} || Orangé
| Variable                            || {{CouleurHexa|ff4500}} || Orangé
|}
|}
=== MediaWiki, Highlight Integration ===
Article :
* https://www.mediawiki.org/wiki/Extension:Highlightjs_Integration
Pour que l'extension Highlight Integration présente les scripts PowerShell comme dans l'interface PowerShell ISE, console foncée :
* modifier le fichier <code>...\extensions\Highlightjs_Integration\extension.json</code>
avant modification :
<source>
            "styles": [
                "custom.css",
                "highlight/styles/vs2015.min.css"
            ],
</source>
après modification :
<source>
            "styles": [
                "custom.css",
                "highlight/styles/vs2015.css"
            ],
</source>


{| class="wikitable"
{| class="wikitable"
|+ vs2015
|+ vs2015.css, tableau des modifications
|-
! Classe CSS                              !! Couleur (hexadécimal) !! Nouvelle couleur
|-
| .hljs                                  || {{CouleurHexa|1E1E1E}} || {{CouleurHexa|012456}}
|-
| .hljs-keyword, .hljs-literal, .hljs-symbol, .hljs-name || {{CouleurHexa|569CD6}} || {{CouleurHexa|ffe4b5}} 
|-
| .hljs-link                              || {{CouleurHexa|569CD6}} || {{CouleurHexa|ffe4b5}} 
|-
| .hljs-built_in, .hljs-type              || {{CouleurHexa|4EC9B0}} || {{CouleurHexa|e0ffff}} 
|-
|-
! Classe CSS                              !! Couleur (hexadécimal) !!
| .hljs-comment, .hljs-quote              || {{CouleurHexa|57a64a}} || {{CouleurHexa|98fb98}}
|-
|-
| .hljs-comment, .hljs-quote              || {{CouleurHexa|57a64a}} ||  
| .hljs-variable, .hljs-template-variable || {{CouleurHexa|BD63C5}} || {{CouleurHexa|ff4500}}
|-
|-
| .hljs-variable, .hljs-template-variable || {{CouleurHexa|BD63C5}} ||  
| .hljs-attr, .hljs-attribute            || {{CouleurHexa|9CDCFE}} || {{CouleurHexa|b0c4de}}
|-
|-
| .hljs-attr, .hljs-attribute            || {{CouleurHexa|9CDCFE}} ||  
| .hljs-string, .hljs-meta .hljs-string  || {{CouleurHexa|D69D85}} || {{CouleurHexa|#D69D85}}
|-
|-
| .hljs-string, .hljs-meta .hljs-string  || {{CouleurHexa|D69D85}} ||  
| .hljs-number, .hljs-class              || {{CouleurHexa|B8D7A3}} || {{CouleurHexa|ffe4c4}}
|}
|}
Fichier <code>vs2015.css</code> après modification :
<source>
pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em
}
code.hljs {
  padding: 3px 5px
}
/*
* Visual Studio 2015 dark style
* Author: Nicolas LLOBERA <nllobera@gmail.com>
*/
.hljs {
  background: #012456;
  color: #DCDCDC
}
.hljs-keyword,
.hljs-literal,
.hljs-symbol,
.hljs-name {
  color: #ffe4b5
}
.hljs-link {
  color: #ffe4b5;
  text-decoration: underline
}
.hljs-built_in,
.hljs-type {
  color: #e0ffff
}
.hljs-number,
.hljs-class {
  color: #ffe4c4
}
.hljs-string,
.hljs-meta .hljs-string {
  color: #D69D85
}
.hljs-regexp,
.hljs-template-tag {
  color: #9A5334
}
.hljs-subst,
.hljs-function,
.hljs-title,
.hljs-params,
.hljs-formula {
  color: #DCDCDC
}
.hljs-comment,
.hljs-quote {
  color: #98fb98;
  font-style: italic
}
.hljs-doctag {
  color: #608B4E
}
.hljs-meta,
.hljs-meta .hljs-keyword,
.hljs-tag {
  color: #9B9B9B
}
.hljs-variable,
.hljs-template-variable {
  color: #ff4500
}
.hljs-attr,
.hljs-attribute {
  color: #b0c4de
}
.hljs-section {
  color: gold
}
.hljs-emphasis {
  font-style: italic
}
.hljs-strong {
  font-weight: bold
}
/*.hljs-code {
  font-family:'Monospace';
}*/
.hljs-bullet,
.hljs-selector-tag,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: #D7BA7D
}
.hljs-addition {
  background-color: #144212;
  display: inline-block;
  width: 100%
}
.hljs-deletion {
  background-color: #600;
  display: inline-block;
  width: 100%
}
</source>
=== Notepad++ ===
Mode sombre : menu Paramètres > Préférences, rubrique "Mode sombre"
{| class="wikitable"
|+
|-
! Style              !! Couleur (hexadécimal)  !! Nouvelle couleur
|-
| bgcolor            || {{CouleurHexa|2B0F01}} || {{CouleurHexa|012456}}
|-
| DEFAULT            || {{CouleurHexa|B7975D}} || {{CouleurHexa|F8F8F8}}
|-
| COMMENT            || {{CouleurHexa|208008}} || {{CouleurHexa|98FB98}} 
|-
| STRING              || {{CouleurHexa|BCBB80}} || {{CouleurHexa|EE82EE}} 
|-
| CHARACTER          || {{CouleurHexa|BCBB80}} || {{CouleurHexa|EE82EE}} 
|-
| NUMBER              || {{CouleurHexa|AFA7D6}} || {{CouleurHexa|98FB98}}
|-
| VARIABLE            || {{CouleurHexa|CFBA28}} || {{CouleurHexa|FF4500}}
|-
| OPERATOR            || {{CouleurHexa|D6C479}} || {{CouleurHexa|B0C4DE}}
|-
| INSTRUCTION WORD    || {{CouleurHexa|4AD231}} || {{CouleurHexa|D69D85}}
|-
| CMDLET              || {{CouleurHexa|0088CE}} || {{CouleurHexa|E0FFFF}}
|-
| ALIAS              || {{CouleurHexa|D92B10}} || {{CouleurHexa|E0FFFF}}
|-
| HERE STRING        || {{CouleurHexa|CC9393}} || {{CouleurHexa|CC9393}}
|-
| HERE CHARACTER      || {{CouleurHexa|CC9393}} || {{CouleurHexa|CC9393}}
|-
| COMMENT STREAM      || {{CouleurHexa|FFE4C4}} || {{CouleurHexa|FFE4C4}}
|-
| COMMENT DOC KEYWORD || {{CouleurHexa|FFE4C4}} || {{CouleurHexa|FFE4C4}}
|}
Fichier paramètre de style :
* <code>C:\Users\phil\AppData\Roaming\Notepad++\themes\Konophil.xml</code>
<source>
        <LexerType name="powershell" desc="PowerShell" ext="">
            <WordsStyle name="DEFAULT" styleID="0" fgColor="F8F8F8" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="COMMENT" styleID="1" fgColor="98FB98" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="STRING" styleID="2" fgColor="EE82EE" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="CHARACTER" styleID="3" fgColor="EE82EE" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="NUMBER" styleID="4" fgColor="FFE4C4" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="VARIABLE" styleID="5" fgColor="FF4500" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="">if else for while</WordsStyle>
            <WordsStyle name="OPERATOR" styleID="6" fgColor="B0C4DE" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="">bool long int char</WordsStyle>
            <WordsStyle name="INSTRUCTION WORD" styleID="8" fgColor="D69D85" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" keywordClass="instre1" />
            <WordsStyle name="CMDLET" styleID="9" fgColor="E0FFFF" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" keywordClass="instre2" />
            <WordsStyle name="ALIAS" styleID="10" fgColor="E0FFFF" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" keywordClass="type1" />
            <WordsStyle name="HERE STRING" styleID="14" fgColor="CC9393" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="HERE CHARACTER" styleID="15" fgColor="CC9393" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="COMMENT STREAM" styleID="13" fgColor="FFE4C4" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="COMMENT DOC KEYWORD" styleID="16" fgColor="FFE4C4" bgColor="012456" fontName="Lucida Console" fontStyle="1" fontSize="" keywordClass="type4" />
        </LexerType>
</source>


== MediaWiki et Highlightjs Integration ==
== MediaWiki et Highlightjs Integration ==
Ligne 78 : Ligne 273 :
* après modification :
* après modification :
** <source inline>.code2highlight {line-height: 1.1em;}</source>
** <source inline>.code2highlight {line-height: 1.1em;}</source>
Ajout des langages suivants :
* apache ;
* arduino ;
* css ;
* dos ;
* gcode ;
* groovy ;
* ini ;
* javascript ;
* json ;
* lua ;
* php ;
* powershell ;
* python ;
* sql ;
* vbscript ;
* xml ;
* yaml.


== Voir aussi ==
== Voir aussi ==

Dernière version du 26 juillet 2024 à 10:55

Quelques éléments de personnalisation

PowerShell ISE

L'interface PowerShell ISE peut être personnalisée concernant l'affichage (menu Outils > Options ; onglet "couleurs et polices") :

  • thème :
    • console foncée, éditeur clair (par défaut),
    • console claire, éditeur foncé,
    • console foncée, éditeur foncé,
    • console claire, éditeur clair,
    • vert monochrome,
    • présentation.

PowerShell ISE, Console foncée, éditeur foncé

Avec "jetons du volet de script"

Elément PowerShell ISE
couleur (hexadécimal)
Nom de la couleur
Arrière-plan    #012456 Couleur personnalisée
Attribut    #b0c4de Bleu acier clair
Commande    #e0ffff Cyan clair
Argument de commande    #ee82ee Violet
Paramètre de commande    #ffe4b5 Beige mocassin
Commentaire    #98fb98 Vert pâle
Fin de groupe    #f5f5f5 Blanc fumée
Début de groupe    #f5f5f5 Blanc fumée
Mot clé    #0effff Cyan clair
Continuation de ligne (accent grave)    #f5f5f5 Blanc fumée
Etiquette de boucle    #0effff Cyan clair
Membre    #f5f5f5 Blanc fumée
Numéro    #ffe4c4 Beige bisque
Opérateur    #d3d3d3 Gris clair
Séparateur d'instruction (point-virgule)    #f5f5f5 Blanc fumée
Chaîne    #db7093 Cristal violet pâle
Type    #8fbc8f Vert marin foncé
Variable    #ff4500 Orangé

MediaWiki, Highlight Integration

Article :

Pour que l'extension Highlight Integration présente les scripts PowerShell comme dans l'interface PowerShell ISE, console foncée :

  • modifier le fichier ...\extensions\Highlightjs_Integration\extension.json

avant modification :

            "styles": [
                "custom.css",
                "highlight/styles/vs2015.min.css"
            ],

après modification :

            "styles": [
                "custom.css",
                "highlight/styles/vs2015.css"
            ],
vs2015.css, tableau des modifications
Classe CSS Couleur (hexadécimal) Nouvelle couleur
.hljs    #1E1E1E    #012456
.hljs-keyword, .hljs-literal, .hljs-symbol, .hljs-name    #569CD6    #ffe4b5
.hljs-link    #569CD6    #ffe4b5
.hljs-built_in, .hljs-type    #4EC9B0    #e0ffff
.hljs-comment, .hljs-quote    #57a64a    #98fb98
.hljs-variable, .hljs-template-variable    #BD63C5    #ff4500
.hljs-attr, .hljs-attribute    #9CDCFE    #b0c4de
.hljs-string, .hljs-meta .hljs-string    #D69D85    ##D69D85
.hljs-number, .hljs-class    #B8D7A3    #ffe4c4

Fichier vs2015.css après modification :

pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em
}
code.hljs {
  padding: 3px 5px
}
/*
 * Visual Studio 2015 dark style
 * Author: Nicolas LLOBERA <nllobera@gmail.com>
 */
.hljs {
  background: #012456;
  color: #DCDCDC
}
.hljs-keyword,
.hljs-literal,
.hljs-symbol,
.hljs-name {
  color: #ffe4b5
}
.hljs-link {
  color: #ffe4b5;
  text-decoration: underline
}
.hljs-built_in,
.hljs-type {
  color: #e0ffff
}
.hljs-number,
.hljs-class {
  color: #ffe4c4
}
.hljs-string,
.hljs-meta .hljs-string {
  color: #D69D85
}
.hljs-regexp,
.hljs-template-tag {
  color: #9A5334
}
.hljs-subst,
.hljs-function,
.hljs-title,
.hljs-params,
.hljs-formula {
  color: #DCDCDC
}
.hljs-comment,
.hljs-quote {
  color: #98fb98;
  font-style: italic
}
.hljs-doctag {
  color: #608B4E
}
.hljs-meta,
.hljs-meta .hljs-keyword,
.hljs-tag {
  color: #9B9B9B
}
.hljs-variable,
.hljs-template-variable {
  color: #ff4500
}
.hljs-attr,
.hljs-attribute {
  color: #b0c4de
}
.hljs-section {
  color: gold
}
.hljs-emphasis {
  font-style: italic
}
.hljs-strong {
  font-weight: bold
}
/*.hljs-code {
  font-family:'Monospace';
}*/
.hljs-bullet,
.hljs-selector-tag,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: #D7BA7D
}
.hljs-addition {
  background-color: #144212;
  display: inline-block;
  width: 100%
}
.hljs-deletion {
  background-color: #600;
  display: inline-block;
  width: 100%
}

Notepad++

Mode sombre : menu Paramètres > Préférences, rubrique "Mode sombre"

Style Couleur (hexadécimal) Nouvelle couleur
bgcolor    #2B0F01    #012456
DEFAULT    #B7975D    #F8F8F8
COMMENT    #208008    #98FB98
STRING    #BCBB80    #EE82EE
CHARACTER    #BCBB80    #EE82EE
NUMBER    #AFA7D6    #98FB98
VARIABLE    #CFBA28    #FF4500
OPERATOR    #D6C479    #B0C4DE
INSTRUCTION WORD    #4AD231    #D69D85
CMDLET    #0088CE    #E0FFFF
ALIAS    #D92B10    #E0FFFF
HERE STRING    #CC9393    #CC9393
HERE CHARACTER    #CC9393    #CC9393
COMMENT STREAM    #FFE4C4    #FFE4C4
COMMENT DOC KEYWORD    #FFE4C4    #FFE4C4

Fichier paramètre de style :

  • C:\Users\phil\AppData\Roaming\Notepad++\themes\Konophil.xml
        <LexerType name="powershell" desc="PowerShell" ext="">
            <WordsStyle name="DEFAULT" styleID="0" fgColor="F8F8F8" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="COMMENT" styleID="1" fgColor="98FB98" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="STRING" styleID="2" fgColor="EE82EE" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="CHARACTER" styleID="3" fgColor="EE82EE" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="NUMBER" styleID="4" fgColor="FFE4C4" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="VARIABLE" styleID="5" fgColor="FF4500" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="">if else for while</WordsStyle>
            <WordsStyle name="OPERATOR" styleID="6" fgColor="B0C4DE" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="">bool long int char</WordsStyle>
            <WordsStyle name="INSTRUCTION WORD" styleID="8" fgColor="D69D85" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" keywordClass="instre1" />
            <WordsStyle name="CMDLET" styleID="9" fgColor="E0FFFF" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" keywordClass="instre2" />
            <WordsStyle name="ALIAS" styleID="10" fgColor="E0FFFF" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" keywordClass="type1" />
            <WordsStyle name="HERE STRING" styleID="14" fgColor="CC9393" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="HERE CHARACTER" styleID="15" fgColor="CC9393" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="COMMENT STREAM" styleID="13" fgColor="FFE4C4" bgColor="012456" fontName="Lucida Console" fontStyle="0" fontSize="" />
            <WordsStyle name="COMMENT DOC KEYWORD" styleID="16" fgColor="FFE4C4" bgColor="012456" fontName="Lucida Console" fontStyle="1" fontSize="" keywordClass="type4" />
        </LexerType>

MediaWiki et Highlightjs Integration

La hauteur de ligne pour le code a été modifié, via la page MediaWiki:Common.css :

  • avant modification :
    • néant,
  • après modification :
    • .code2highlight {line-height: 1.1em;}

Ajout des langages suivants :

  • apache ;
  • arduino ;
  • css ;
  • dos ;
  • gcode ;
  • groovy ;
  • ini ;
  • javascript ;
  • json ;
  • lua ;
  • php ;
  • powershell ;
  • python ;
  • sql ;
  • vbscript ;
  • xml ;
  • yaml.

Voir aussi

  •