diff --git a/README.md b/README.md index c245070..03bf612 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -#Snippets SPIP pour vscodium \ No newline at end of file +#Snippets SPIP pour vscodium + +https://code.visualstudio.com/docs/editor/userdefinedsnippets diff --git a/package.json b/package.json new file mode 100644 index 0000000..83a45e4 --- /dev/null +++ b/package.json @@ -0,0 +1,49 @@ +{ + "name": "spip-html", + "displayName": "SPIP codes for html (snippets)", + "description": "Just snippet for create SPIP codes in html", + "version": "0.0.1", + "publisher": "gamuza", + "engines": { + "vscode": "^1.0.0" + }, + "categories": [ + "Snippets" + ], + "contributes": { + "snippets": [ + { + "language": "html", + "path": "./snippets/spip-html.json" + }, + { + "language": "scss", + "path": "./snippets/spip-scss.json" + }, + { + "language": "css", + "path": "./snippets/spip-scss.json" + }, + { + "language": "js", + "path": "./snippets/spip-js.json" + }, + { + "language": "html", + "path": "./snippets/spip-js.json" + }, + { + "language": "xml", + "path": "./snippets/spip-xml.json" + }, + { + "language": "php", + "path": "./snippets/spip-php.json" + } + ] + }, + "repository": { + "type": "git", + "url": "https://git.gamuza.fr/snippet/vscodium" + } +} diff --git a/snippets/spip-html.json b/snippets/spip-html.json new file mode 100644 index 0000000..19c8ee2 --- /dev/null +++ b/snippets/spip-html.json @@ -0,0 +1,210 @@ +{ + "b": { + "prefix": "b", + "body": [ + "", + "$0", + "" + ], + "description": "SPIP " + }, + "bb": { + "prefix": "bb", + "body": [ + "", + "${5}", + "", + "$0", + "", + "${6}", + "" + ], + "description": "SPIP " + }, + "id_rub": { + "prefix": "id_rub", + "body": "#ID_RUBRIQUE${0}", + "description": "SPIP #ID_RUBRIQUE" + }, + "id_mot": { + "prefix": "id_mot", + "body": "#ID_MOT", + "description": "SPIP #ID_MOT" + }, + "http_header": { + "prefix": "http_header", + "body": "#HTTP_HEADER{Content-Type: text/plain; charset=#CHARSET}", + "description": "SPIP #HTTP_HEADER{}" + }, + "autoriser": { + "prefix": "autoriser", + "body": "[(#AUTORISER{${1:action},${2:objet}}|oui)${3}]", + "description": "SPIP [(#AUTORISER{" + }, + "rem": { + "prefix": "rem", + "body": "[(#REM)\n\t1\n]\n${0}" + }, + "edit": { + "prefix": "edit", + "body": "#EDIT{1}${0}", + "description": "SPIP #EDIT{ VISUAL }" + }, + "env**": { + "prefix": "env**", + "body": "[
(#ENV**|unserialize|print_r{1})
]\n${0}", + "description": "SPIP tout l'env" + }, + "env": { + "prefix": "env", + "body": "#ENV{${1}}${0}", + "description": "SPIP #ENV{}" + }, + "set": { + "prefix": "set", + "body": "#SET{${1},$2}${0}", + "description": "SPIP #SET{}" + }, + "get": { + "prefix": "get", + "body": "#GET{${1}}${0}", + "description": "SPIP #GET{}" + }, + "chemin": { + "prefix": "chemin", + "body": "[(#CHEMIN{${1}})]${0}", + "description": "SPIP #CHEMIN{}" + }, + "cache": { + "prefix": "cache", + "body": "#CACHE{0}\n${0}", + "description": "SPIP #CACHE{0}" + }, + "url_page": { + "prefix": "url_page", + "body": "[(#URL_PAGE{1}${0})]", + "description": "SPIP #URL_PAGE{}" + }, + "action": { + "prefix": "action", + "body": "[(#URL_ACTION_AUTEUR{${1:name},${2:var1/var2},${3:#SELF}})]${0}", + "description": "SPIP #URL_ACTION_AUTEUR{name,var1/var2,#SELF}" + }, + "foreachSpip": { + "prefix": "foreachSpip", + "body": "[(${1}|foreach)]\n${0}", + "description": "SPIP foreach" + }, + "config": { + "prefix": "config", + "body": "#CONFIG{${1}}${0}", + "description": "SPIP #CONFIG{}" + }, + "setenv": { + "prefix": "setenv", + "body": "[(#${1:balise}|setenv{${2:nom_env}})]${0}", + "description": "SPIP [(#BALISE|setenv{nom_env})]" + }, + "formulaire": { + "prefix": "formulaire", + "body": "`!p t[1] = t[1].upper()`\n[(#FORMULAIRE_${1}{${2}})]${0}", + "description": "SPIP #FORMULAIRE_" + }, + "use": { + "prefix": "use", + "body": "\n\t${6:}\n\t\n", + "description": "SPIP SVG use" + }, + "cptboucle": { + "prefix": "cptboucle", + "body": "#COMPTEUR_BOUCLE${0}", + "description": "SPIP #COMPTEUR_BOUCLE" + }, + "totboucle": { + "prefix": "totboucle", + "body": "#TOTAL_BOUCLE${0}", + "description": "SPIP #TOTAL_BOUCLE" + }, + "cvt": { + "prefix": "cvt", + "body": "
\n\n[

(#ENV*{message_erreur})

]\n[

(#ENV*{message_ok})

]\n\n[(#ENV{editable}|oui) ]\n\t
\n\t\t#ACTION_FORMULAIRE{#ENV{action}}\n\t\t
\n\n\t\t\t${1}\n\n\t\t
\n\t

\n\t
\n\n
", + "description": "SPIP formulaire CVT" + }, + "cvttext": { + "prefix": "cvttext", + "body": "
\n\t#SET{name,${1}}\n\t#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}\n\t#SET{obli,\"obligatoire\"}\n\t
\n\t\t\n\t\t[(#GET{erreurs})]\n\t\t\n\t
\n
\n${0}", + "description": "SPIP \n\t#SET{name,${1}}\n\t#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}\n\t#SET{obli,\"obligatoire\"}\n\t
\n\t\t\n\t\t[(#GET{erreurs})]\n\t\t\n\t
\n\n${0}", + "description": "SPIP