Le 17/07/2016 à 12:29, RealET a écrit :
Mist. GraphX a écrit le 17/07/2016 à 12:16 :
Bonjour,
je teste l'ajout de raccourcis à textwheel, depuis un plugin, mais pour
le moment sans succès.
Tu as au moins 2 plugins qui y arrivent :
- dame blanche
- todo
Ça devrait t'inspirer 
Bon dimanche
C'est bien ce que j'avais vu.
Donc en ajoutant le <necessite >
+ ajout dans prefix_plugin_options.php
$GLOBALS['spip_wheels']['raccourcis'][] = 'prefix_plugin.yaml';
après avoir compris que l'ordre de déclaration est important et qu'un critère priorité est applicable, ça fonctionne.
mais pas complètement dans le privé.
il faut vider manuellement le dossier /cache/wheels/ du site
au final donc avec un fichier yaml, on peut réécrire typo_enluminée 
--- # Syntaxe des raccourcis SPIP, version 0.0.1
#
# Si on nomme une regle, elle devient surchargeable
intertitre4:
# raccourcis en {{{..}}}
# intertitres
match: ['{{{***', '}}}']
replace: ["\n\n\n<h4>", "</h4>\n\n\n"]
if_str: '{{{***'
type: str
priority: -40
intertitre3:
# raccourcis en {{{..}}}
# intertitres
match: ['{{{**', '}}}']
replace: ["\n\n\n<h3>", "</h3>\n\n\n"]
if_str: '{{{**'
type: str
priority: -40
intertitre2:
# raccourcis en {{{..}}}
# intertitres
match: ['{{{*', '}}}']
replace: ["\n\n\n<h2 class='coucou'>", "</h2>\n\n\n"]
if_str: '{{{*'
type: str
priority: -40
intertitres:
# raccourcis en {{{..}}}
# intertitres
match: ['{{{', '}}}']
replace: ["\n\n\n<h3 class=\"spip\">", "</h3>\n\n\n"]
if_str: '{{{'
type: str
priority: -10
center:
# Balise depreciee <center>
match: ['<center>', '</center>']
replace: ["\n\n\n<div class=\"center\">", "</div>\n\n\n"]
if_str: '<center>'
type: str
clear:
# racourcis <clear>
match: '<clear>'
replace: "<hr class=\"clear\" />"
if_str: '<clear>'
type: str
surligne2:
# raccourcis en [** Un texte surligne 2 ]
# intertitres
match: [ '[**', ']' ]
replace: ["\n\n\n<span class=\"surligne2\">", "</span>\n\n\n"]
if_str: '[**'
type: str
surligne1:
# raccourcis en [* Un texte surligne ]
# intertitres
match: [ '[*', ']' ]
replace: ["\n\n\n<span class=\"surligne1\">", "</span>\n\n\n"]
if_str: '[*'
type: str
plus propre non ?
--
Bonne journée
Arnaud B. (Mist. GraphX)