<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wiki.nefald.fr/index.php?action=history&amp;feed=atom&amp;title=Module%3AInfobox%2FSousPages</id>
	<title>Module:Infobox/SousPages - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.nefald.fr/index.php?action=history&amp;feed=atom&amp;title=Module%3AInfobox%2FSousPages"/>
	<link rel="alternate" type="text/html" href="https://wiki.nefald.fr/index.php?title=Module:Infobox/SousPages&amp;action=history"/>
	<updated>2026-08-04T05:27:47Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.nefald.fr/index.php?title=Module:Infobox/SousPages&amp;diff=5795&amp;oldid=prev</id>
		<title>Hiob : Port depuis codex.nefald.fr : détection automatique des sous-pages dans l&#039;infobox (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.nefald.fr/index.php?title=Module:Infobox/SousPages&amp;diff=5795&amp;oldid=prev"/>
		<updated>2026-08-03T09:31:30Z</updated>

		<summary type="html">&lt;p&gt;Port depuis codex.nefald.fr : détection automatique des sous-pages dans l&amp;#039;infobox (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Construit la liste des sous-pages en wikiliens, séparateur • sur une ligne.&lt;br /&gt;
-- config.sousPagesNamespace : namespace DPL à interroger (&amp;#039;&amp;#039; = espace principal, &amp;#039;Plugin&amp;#039; = ns Plugin, etc.)&lt;br /&gt;
-- Retourne nil si aucune sous-page, ou si args.sous_pages == &amp;#039;non&amp;#039; (opt-out manuel).&lt;br /&gt;
--&lt;br /&gt;
-- Si la page courante est elle-même une sous-page (ex. Plugin:NefaldCore/API), on liste les&lt;br /&gt;
-- pages sœurs (enfants de la racine, ex. NefaldCore) et la page courante apparaît en gras,&lt;br /&gt;
-- non cliquable (.infobox-souspage-active), comme sur Modèle:Navigation_sous-pages.&lt;br /&gt;
-- Sinon (page principale), on liste ses propres sous-pages, aucune n&amp;#039;est la page courante.&lt;br /&gt;
function p.build(args, config, frame)&lt;br /&gt;
    if args.sous_pages == &amp;#039;non&amp;#039; then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local title = mw.title.getCurrentTitle()&lt;br /&gt;
    local namespace = (config and config.sousPagesNamespace) or &amp;#039;&amp;#039;&lt;br /&gt;
    local base = (title.text ~= title.rootText) and title.rootText or title.text&lt;br /&gt;
&lt;br /&gt;
    -- Séparateur &amp;#039;@@&amp;#039; improbable dans un titre : évite tout souci de trim d&amp;#039;espaces/retours&lt;br /&gt;
    -- à la ligne par MediaWiki sur les arguments de #dpl.&lt;br /&gt;
    -- skipthispage=no : DPL exclut par défaut la page appelante de ses propres résultats ;&lt;br /&gt;
    -- sur une sous-page on veut au contraire qu&amp;#039;elle apparaisse (pour le bold .infobox-souspage-active).&lt;br /&gt;
    local dpl = &amp;#039;{{#dpl:namespace=&amp;#039; .. namespace&lt;br /&gt;
        .. &amp;#039;|titlematch=&amp;#039; .. base .. &amp;#039;/%&amp;#039;&lt;br /&gt;
        .. &amp;#039;|format=,%PAGE%,@@,&amp;#039;&lt;br /&gt;
        .. &amp;#039;|skipthispage=no&amp;#039;&lt;br /&gt;
        .. &amp;#039;|ignorecase=true|order=ascending|ordermethod=title}}&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    local raw = frame:preprocess(dpl)&lt;br /&gt;
    if not raw then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
    raw = mw.text.trim(raw)&lt;br /&gt;
    if raw == &amp;#039;&amp;#039; then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local parts = {}&lt;br /&gt;
    for fullTitle in (raw .. &amp;#039;@@&amp;#039;):gmatch(&amp;#039;(.-)@@&amp;#039;) do&lt;br /&gt;
        local trimmed = mw.text.trim(fullTitle)&lt;br /&gt;
        if trimmed ~= &amp;#039;&amp;#039; then&lt;br /&gt;
            local display = trimmed:match(&amp;#039;([^/]+)$&amp;#039;) or trimmed&lt;br /&gt;
            if trimmed == title.prefixedText then&lt;br /&gt;
                table.insert(parts, &amp;#039;&amp;lt;span class=&amp;quot;infobox-souspage-active&amp;quot;&amp;gt;&amp;#039; .. display .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;)&lt;br /&gt;
            else&lt;br /&gt;
                table.insert(parts, &amp;#039;[[&amp;#039; .. trimmed .. &amp;#039;|&amp;#039; .. display .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if #parts == 0 then&lt;br /&gt;
        return nil&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return frame:preprocess(table.concat(parts, &amp;#039; • &amp;#039;))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Hiob</name></author>
	</entry>
</feed>