19a366708SLORTET====== Newpagefill Plugin ====== 29a366708SLORTET 39a366708SLORTET---- plugin ---- 49a366708SLORTETdescription: Assistant de création de page avec préremplissage et support de @TITLE@ 59a366708SLORTETauthor : Valentin LORTET 69a366708SLORTETemail : contact@valentinlortet.fr 79a366708SLORTETtype : Action 89a366708SLORTETlastupdate : 2026-03-13 99a366708SLORTETcompatible : Librarian 109a366708SLORTETdepends : 119a366708SLORTETconflicts : 129a366708SLORTETsimilar : 139a366708SLORTETtags : Page, Création, Template, Namespace, JavaScript 149a366708SLORTET 159a366708SLORTETdownloadurl: https://github.com/Lortet/dokuwiki-plugin-newpagefill/zipball/master 169a366708SLORTETbugtracker : https://github.com/Lortet/dokuwiki-plugin-newpagefill/issues 179a366708SLORTETsourcerepo : https://github.com/Lortet/dokuwiki-plugin-newpagefill/ 189a366708SLORTETdonationurl: 199a366708SLORTETscreenshot_img : 209a366708SLORTET---- 219a366708SLORTET 22*3f49ec0bSLORTET **Français** | [[plugin:newpagefill| English]] | [[de:plugin:newpagefill| Deutsch]] | [[es:plugin:newpagefill| Español]] 23*3f49ec0bSLORTET 249a366708SLORTET===== Installation ===== 259a366708SLORTET 269a366708SLORTETInstaller le plugin depuis le [[fr:plugin:extension|Gestionnaire d'extensions]]. 279a366708SLORTET 289a366708SLORTET===== Description ===== 299a366708SLORTET 309a366708SLORTETLe plugin **newpagefill** ajoute un assistant léger pour créer une nouvelle page : 319a366708SLORTET * saisie d'un titre ; 329a366708SLORTET * proposition automatique d'un identifiant de page ; 339a366708SLORTET * saisie optionnelle du namespace ; 349a366708SLORTET * choix du mode de création selon la configuration ; 359a366708SLORTET * ouverture directe de l'éditeur sur la page cible. 369a366708SLORTET 379a366708SLORTETIl complète aussi le système de templates natif de DokuWiki : 38*3f49ec0bSLORTET * utilisation de ''_template.txt'' ou ''%%__template.txt%%'' si présents ; 399a366708SLORTET * ajout du placeholder ''@TITLE@'' dans le contenu injecté ; 409a366708SLORTET * fallback vers un template propre au plugin si aucun template natif n'existe. 419a366708SLORTET 429a366708SLORTET===== Configuration ===== 439a366708SLORTET 449a366708SLORTET^ Nom ^ Description ^ Valeur par défaut ^ 459a366708SLORTET| template | Template de secours utilisé si aucun template natif DokuWiki n'est trouvé. | ''===== @TITLE@ ====='' | 469a366708SLORTET| default_start_mode | Mode par défaut de création. | ''start'' | 479a366708SLORTET 489a366708SLORTETValeurs possibles pour ''default_start_mode'' : 499a366708SLORTET * ''ask'' : affiche un sélecteur dans la popup ; 509a366708SLORTET * ''start'' : crée une page de démarrage ; 519a366708SLORTET * ''none'' : crée une page directe ; 529a366708SLORTET * ''same'' : crée une sous-page du même nom. 539a366708SLORTET 549a366708SLORTET===== Placeholders ===== 559a366708SLORTET 569a366708SLORTETLe template du plugin peut contenir : 579a366708SLORTET * ''@TITLE@'' : titre calculé par le plugin (spécifique à newpagefill) ; 589a366708SLORTET * tous les placeholders natifs DokuWiki : ''@ID@'', ''@NS@'', ''@PAGE@'', ''@USER@'', ''@DATE@'', etc. (gérés par le core DokuWiki, pas par ce plugin). 599a366708SLORTET 609a366708SLORTET===== Comportement de @TITLE@ ===== 619a366708SLORTET 629a366708SLORTETLa valeur de ''@TITLE@'' est calculée ainsi : 639a366708SLORTET * la valeur ''title'' de la requête est prioritaire ; 649a366708SLORTET * sinon, le plugin tente d'extraire un titre depuis l'URL de création ; 659a366708SLORTET * si la page créée correspond à la page de démarrage du namespace, le nom du namespace parent est utilisé ; 669a366708SLORTET * les caractères ''_'' sont remplacés par des espaces. 679a366708SLORTET 689a366708SLORTET===== Compatibilité templates ===== 699a366708SLORTET 709a366708SLORTETLe plugin respecte l'ordre suivant : 719a366708SLORTET * template déjà fourni par DokuWiki ; 729a366708SLORTET * ''_template.txt'' dans le dossier cible ; 73*3f49ec0bSLORTET * %%__template.txt%% dans le namespace courant ou parent ; 749a366708SLORTET * template de secours configuré dans le plugin. 759a366708SLORTET 769a366708SLORTET===== Fonction JavaScript ===== 779a366708SLORTET 789a366708SLORTETLe plugin expose la fonction globale : 799a366708SLORTET 809a366708SLORTET<code javascript> 819a366708SLORTETwindow.NewPageFill.openCreatePageDialog(options) 829a366708SLORTET</code> 839a366708SLORTET 849a366708SLORTETExemple : 859a366708SLORTET 869a366708SLORTET<code javascript> 879a366708SLORTETwindow.NewPageFill.openCreatePageDialog({ 889a366708SLORTET namespace: 'wiki:documentation', 899a366708SLORTET initialTitle: 'Nouvelle page' 909a366708SLORTET}); 919a366708SLORTET</code> 929a366708SLORTET 939a366708SLORTETOptions utiles : 949a366708SLORTET * ''namespace'' : namespace DokuWiki de destination ; 959a366708SLORTET * ''initialTitle'' : titre prérempli ; 969a366708SLORTET * ''start'' : 979a366708SLORTET * ''undefined'' ou ''null'' : utilise la configuration du plugin ; 989a366708SLORTET * ''@ask@'' : force l'affichage du choix de mode ; 999a366708SLORTET * ''true'' : utilise la page de démarrage du wiki ; 1009a366708SLORTET * ''false'' : crée la page directement ; 1019a366708SLORTET * ''@same@'' : crée une sous-page portant le même nom que l'identifiant ; 1029a366708SLORTET * toute autre chaîne : crée une sous-page avec cette valeur ; 1039a366708SLORTET * ''sepchar'' : séparateur utilisé pour générer l'identifiant. 1049a366708SLORTET 1059a366708SLORTETSi ''start'' n'est pas fourni et que ''default_start_mode = ask'', la popup propose : 1069a366708SLORTET * page directe ; 1079a366708SLORTET * page de démarrage ; 1089a366708SLORTET * sous-page du même nom. 109