1*9a366708SLORTET====== Newpagefill Plugin ====== 2*9a366708SLORTET 3*9a366708SLORTET---- plugin ---- 4*9a366708SLORTETdescription: Assistant de création de page avec préremplissage et support de @TITLE@ 5*9a366708SLORTETauthor : Valentin LORTET 6*9a366708SLORTETemail : contact@valentinlortet.fr 7*9a366708SLORTETtype : Action 8*9a366708SLORTETlastupdate : 2026-03-13 9*9a366708SLORTETcompatible : Librarian 10*9a366708SLORTETdepends : 11*9a366708SLORTETconflicts : 12*9a366708SLORTETsimilar : 13*9a366708SLORTETtags : Page, Création, Template, Namespace, JavaScript 14*9a366708SLORTET 15*9a366708SLORTETdownloadurl: https://github.com/Lortet/dokuwiki-plugin-newpagefill/zipball/master 16*9a366708SLORTETbugtracker : https://github.com/Lortet/dokuwiki-plugin-newpagefill/issues 17*9a366708SLORTETsourcerepo : https://github.com/Lortet/dokuwiki-plugin-newpagefill/ 18*9a366708SLORTETdonationurl: 19*9a366708SLORTETscreenshot_img : 20*9a366708SLORTET---- 21*9a366708SLORTET 22*9a366708SLORTET===== Installation ===== 23*9a366708SLORTET 24*9a366708SLORTETInstaller le plugin depuis le [[fr:plugin:extension|Gestionnaire d'extensions]]. 25*9a366708SLORTET 26*9a366708SLORTET===== Description ===== 27*9a366708SLORTET 28*9a366708SLORTETLe plugin **newpagefill** ajoute un assistant léger pour créer une nouvelle page : 29*9a366708SLORTET * saisie d'un titre ; 30*9a366708SLORTET * proposition automatique d'un identifiant de page ; 31*9a366708SLORTET * saisie optionnelle du namespace ; 32*9a366708SLORTET * choix du mode de création selon la configuration ; 33*9a366708SLORTET * ouverture directe de l'éditeur sur la page cible. 34*9a366708SLORTET 35*9a366708SLORTETIl complète aussi le système de templates natif de DokuWiki : 36*9a366708SLORTET * utilisation de ''_template.txt'' ou ''__template.txt'' si présents ; 37*9a366708SLORTET * ajout du placeholder ''@TITLE@'' dans le contenu injecté ; 38*9a366708SLORTET * fallback vers un template propre au plugin si aucun template natif n'existe. 39*9a366708SLORTET 40*9a366708SLORTET===== Configuration ===== 41*9a366708SLORTET 42*9a366708SLORTET^ Nom ^ Description ^ Valeur par défaut ^ 43*9a366708SLORTET| template | Template de secours utilisé si aucun template natif DokuWiki n'est trouvé. | ''===== @TITLE@ ====='' | 44*9a366708SLORTET| default_start_mode | Mode par défaut de création. | ''start'' | 45*9a366708SLORTET 46*9a366708SLORTETValeurs possibles pour ''default_start_mode'' : 47*9a366708SLORTET * ''ask'' : affiche un sélecteur dans la popup ; 48*9a366708SLORTET * ''start'' : crée une page de démarrage ; 49*9a366708SLORTET * ''none'' : crée une page directe ; 50*9a366708SLORTET * ''same'' : crée une sous-page du même nom. 51*9a366708SLORTET 52*9a366708SLORTET===== Placeholders ===== 53*9a366708SLORTET 54*9a366708SLORTETLe template du plugin peut contenir : 55*9a366708SLORTET * ''@TITLE@'' : titre calculé par le plugin (spécifique à newpagefill) ; 56*9a366708SLORTET * tous les placeholders natifs DokuWiki : ''@ID@'', ''@NS@'', ''@PAGE@'', ''@USER@'', ''@DATE@'', etc. (gérés par le core DokuWiki, pas par ce plugin). 57*9a366708SLORTET 58*9a366708SLORTET===== Comportement de @TITLE@ ===== 59*9a366708SLORTET 60*9a366708SLORTETLa valeur de ''@TITLE@'' est calculée ainsi : 61*9a366708SLORTET * la valeur ''title'' de la requête est prioritaire ; 62*9a366708SLORTET * sinon, le plugin tente d'extraire un titre depuis l'URL de création ; 63*9a366708SLORTET * si la page créée correspond à la page de démarrage du namespace, le nom du namespace parent est utilisé ; 64*9a366708SLORTET * les caractères ''_'' sont remplacés par des espaces. 65*9a366708SLORTET 66*9a366708SLORTET===== Compatibilité templates ===== 67*9a366708SLORTET 68*9a366708SLORTETLe plugin respecte l'ordre suivant : 69*9a366708SLORTET * template déjà fourni par DokuWiki ; 70*9a366708SLORTET * ''_template.txt'' dans le dossier cible ; 71*9a366708SLORTET * ''__template.txt'' dans le namespace courant ou parent ; 72*9a366708SLORTET * template de secours configuré dans le plugin. 73*9a366708SLORTET 74*9a366708SLORTET===== Fonction JavaScript ===== 75*9a366708SLORTET 76*9a366708SLORTETLe plugin expose la fonction globale : 77*9a366708SLORTET 78*9a366708SLORTET<code javascript> 79*9a366708SLORTETwindow.NewPageFill.openCreatePageDialog(options) 80*9a366708SLORTET</code> 81*9a366708SLORTET 82*9a366708SLORTETExemple : 83*9a366708SLORTET 84*9a366708SLORTET<code javascript> 85*9a366708SLORTETwindow.NewPageFill.openCreatePageDialog({ 86*9a366708SLORTET namespace: 'wiki:documentation', 87*9a366708SLORTET initialTitle: 'Nouvelle page' 88*9a366708SLORTET}); 89*9a366708SLORTET</code> 90*9a366708SLORTET 91*9a366708SLORTETOptions utiles : 92*9a366708SLORTET * ''namespace'' : namespace DokuWiki de destination ; 93*9a366708SLORTET * ''initialTitle'' : titre prérempli ; 94*9a366708SLORTET * ''start'' : 95*9a366708SLORTET * ''undefined'' ou ''null'' : utilise la configuration du plugin ; 96*9a366708SLORTET * ''@ask@'' : force l'affichage du choix de mode ; 97*9a366708SLORTET * ''true'' : utilise la page de démarrage du wiki ; 98*9a366708SLORTET * ''false'' : crée la page directement ; 99*9a366708SLORTET * ''@same@'' : crée une sous-page portant le même nom que l'identifiant ; 100*9a366708SLORTET * toute autre chaîne : crée une sous-page avec cette valeur ; 101*9a366708SLORTET * ''sepchar'' : séparateur utilisé pour générer l'identifiant. 102*9a366708SLORTET 103*9a366708SLORTETSi ''start'' n'est pas fourni et que ''default_start_mode = ask'', la popup propose : 104*9a366708SLORTET * page directe ; 105*9a366708SLORTET * page de démarrage ; 106*9a366708SLORTET * sous-page du même nom. 107