Modjoul:Dokimantasyon : Diférans ant vèrsyon
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Lign 149 : | Lign 149 : | ||
local tesBando = '<b>Sa %s ka posédé pyès [[Led:Dokimantasyon di modèl|dokimantasyon]] ' |
local tesBando = '<b>Sa %s ka posédé pyès [[Led:Dokimantasyon di modèl|dokimantasyon]] ' |
||
..'èsplikativ an sibpaj</b>, pa menm roun |
..'èsplikativ an sibpaj</b>, pa menm roun senp dèskripsyon.<br> ' |
||
..'Ou pouvé %s pou dokimanté sa %s adékwatman.' |
..'Ou pouvé %s pou dokimanté sa %s adékwatman.' |
||
if page.namespace == 828 then -- Modjoul |
if page.namespace == 828 then -- Modjoul |
||
Lign 182 : | Lign 182 : | ||
end |
end |
||
if args['kontni oto |
if args['kontni oto ba'] then |
||
res:newline() |
res:newline() |
||
:wikitext(arg['kontni oto |
:wikitext(arg['kontni oto ba']) |
||
end |
end |
||
Lign 199 : | Lign 199 : | ||
:css('margin', '1.5em 0 0') |
:css('margin', '1.5em 0 0') |
||
local |
local kontniParagraf = res |
||
:tag('p') |
:tag('p') |
||
:addClass('plainlinks') |
:addClass('plainlinks') |
||
Lign 206 : | Lign 206 : | ||
:css('font-style', 'italic') |
:css('font-style', 'italic') |
||
if |
if arg['non modèl'] then |
||
local |
local yannajLed = '[[Lèd:Modèl|modèl]]' |
||
if page.namespace == 828 then |
if page.namespace == 828 then |
||
yannajLed = '[[Lèd:Modjoul|modjoul]]' |
|||
end |
end |
||
kontniParagraf |
|||
contenuParagraphe |
|||
:wikitext(' |
:wikitext('[[Lèd:Dokimantasyon di modèl|dokimantasyon]] di sa ') |
||
:wikitext( |
:wikitext(yannajLed) |
||
:wikitext(' |
:wikitext(' sa jénéré pa modèl ') |
||
:wikitext(mw.getCurrentFrame():expandTemplate{title = 'm', |
:wikitext(mw.getCurrentFrame():expandTemplate{title = 'm', arg = {arg['non modèl']} }) |
||
:wikitext('.<br>') |
:wikitext('.<br>') |
||
else |
else |
||
kontniParagraf |
|||
contenuParagraphe |
|||
:tag('span') |
:tag('span') |
||
:addClass(' |
:addClass('lérò') |
||
:wikitext(' |
:wikitext('Lérò : paranmèt <kod>non modèl</kod> pa sa ransennyen.<br>') |
||
end |
end |
||
if |
if arg.konntni then |
||
kontniParagraf |
|||
contenuParagraphe |
|||
:wikitext(' |
:wikitext('Li sa dirèkman [[Lèd:Lenklizyon|enkli]] annan apèl-a di sa dannyé. ') |
||
:wikitext('Si |
:wikitext('Si sa paj protéjé, souplé ') |
||
:wikitext(' |
:wikitext('transféré kontni di dokimantasyon bò so ') |
||
:wikitext( |
:wikitext(yannajUrl(dok, 'sibpaj ki dédjé', 'edit', '')) |
||
:wikitext('.<br>') |
:wikitext('.<br>') |
||
elseif existeDoc then |
elseif existeDoc then |
||
kontniParagraf |
|||
contenuParagraphe |
|||
:wikitext(' |
:wikitext('Li sa [[Lèd:Lenklizyon|enkli]] dipi ') |
||
if |
if arg['paj dok'] then |
||
kontniParagraf |
|||
contenuParagraphe |
|||
:wikitext(' |
:wikitext('paj-a [[') |
||
:wikitext(tostring( |
:wikitext(tostring(dok)) |
||
:wikitext(']]. ') |
:wikitext(']]. ') |
||
else |
else |
||
kontniParagraf |
|||
contenuParagraphe |
|||
:wikitext(' |
:wikitext('so [[') |
||
:wikitext(tostring( |
:wikitext(tostring(dok)) |
||
:wikitext('| |
:wikitext('|sibpaj di dokimantasyon]] ') |
||
end |
end |
||
Lign 253 : | Lign 253 : | ||
:css('font-style', 'normal') |
:css('font-style', 'normal') |
||
:wikitext('(') |
:wikitext('(') |
||
:wikitext( |
:wikitext(yannajUrl(dok, 'listorik', 'history')) |
||
:wikitext(').') |
:wikitext(').') |
||
:done() |
:done() |
Vèrsyon di 5 janvyé 2020 à 16:41
-- Sa modjoul ka adapté modèl-a Erreur de script : la fonction « dokimantasyon » n’existe pas..
local p = {}
local function existePage(paj) return page and page.exists end
local function nonSibpaj(paj, sibpaj) --Nou pa annan roun sibpaj if not page.isSubpage then return page.subjectNsText .. ':' .. page.text .. '/' .. sibpaj end
--Nou pa annan roun sibpaj local sibPaj = page.subpageText if sibPaj == 'Dokimantasyon' or sibPaj == 'Batché sab' or sibPaj == 'Tès' then return page.subjectNsText .. ':' .. page.baseText .. '/' .. sibpaj else return page.subjectNsText .. ':' .. page.text .. '/' .. sibpaj end end
local function yannajUrl(nonPaj, titPaj, agsyon, pagePreload) local argument = {['action'] = action or 'edit'}
if pagePreload then argument['preload'] = 'Modèl:Dokimantasyon/Preload' .. pagePreload end
return mw.ustring.format('[%s %s]', nonPaj:fullUrl(argument), titPaj) end
local function lantet(arg, paj, dok, existeDoc) local res = mw.html.create('div')
res :css('margin-bottom', '1ex') :css('border-bottom', '1px solid #aaa') :css('padding-bottom', '3px')
:wikitext('')
:tag('span') :css('font-weight', 'bold') :css('font-size', '125%') :css('vertical-align', 'middle') :wikitext(' ') :wikitext(args.titre or 'Dokimantasyon') :done()
local ledisyonYannaj = res:tag('span') :addClass('mw-editsection plainlinks') :css('vertical-align', 'middle')
if not arg.kontni then ledisyonYannaj:wikitext('[') if existeDoc then ledisyonYannaj:wikitext(yannajUrl(dok, 'modifyé')) else if page.namespace == 828 then ledisyonYannaj:wikitext(yannajUrl(dok, 'kréyé', 'edit', 'Modjoul')) else ledisyonYannaj:wikitext(yannajUrl(dok, 'kréyé', 'edit', )) end end ledisyonYannaj:wikitext('] ') end
ledisyonYannaj :wikitext('[') :wikitext(yannajUrl(paj, 'prijé', 'prij')) :wikitext(']')
return res end
local function protegsyon(paj, dok, existeDoc, mesaj) -- Lensersyon otonmatik di modèl di protegsyon. local nivelProtegsyon = page.protectionLevels.edit
if nivelProtegsyon and nivelProtegsyon[1] then local tabProtegsyon = { autoconfirmed = {'simiProtegsyon', '{{%s*[Ss]imi%-protegsyon%s*[|}]', '{{%s*[Ss]imi%-protegsyon +lonng%s*[|}]'}, editextendedsemiprotected = {'simiProtegsyonLarj', '{{%s*[Ss]imi%-protegsyon +larj%s*[|}]'}, sysop = {'protegsyon', '{{%s*[Pp]rotegsyon%s*[|}]'}, } local protegsyon = tabProtegsyon[nivelProtegsyon[1]] if not protegsyon then return end
local alreadyShown = false if existeDoc then -- Vérifikasyon ki pa gen kaba roun modèl di -- protègsyon annan dokimantasyon-an di modèl. local kontniDok = doc:getContent() if kontniDok:match(protegsyon[2]) or (protegsyon[3] and kontniDok:match(protegsyon[3])) then alreadyShown = true end end
if not alreadyShown then if mesaj == then mesaj = nil end return require('Modjoul:Protegsyon').main({mesaj}, protegsyon[1], paj) end end end
-- pou batché sab-a, nou ka anlvé baliz-ya di katégori -- ki abitchwèlman sitchwé an "includeonly" an finisman di dokimantasyon-an local function anlveBalizKategori(kontniDok) local count repeat kontniDok, count = mw.ustring.gsub(kontniDok, '%[%[Katégori:[^%]]+%]%][\t\r\n\f ]*$', ) until count == 0
kontniDok, count = mw.ustring.gsub(kontniDok, '[\t\r\n\f ]*$', )
return kontniDok end
local function kontni(arg, dok, existeDoc) local paj = mw.title.getCurrentTitle() local res = mw.html.create():newline()
if arg['kontni oto rot'] then res:wikitext(args['kontni oto rot']) :newline() end
if arg.kontni then res:newline() :wikitext(arg.kontni) :newline()
elseif existeDoc then local kontniDok = mw.getCurrentFrame():expandTemplate{title = doc.prefixedText} if page.subpageText == 'Batché sab' or page.subpageText == 'Tes' then kontniDok = kaanlveBalizKategori(kontniDok) end res:newline() :wikitext(kontniDok) :newline()
elseif page.subpageText ~= 'Batché sab' and page.subpageText ~= 'Tes' and args['kontni ki fakiltativ'] == nil then
local tesBando = 'Sa %s ka posédé pyès dokimantasyon '
..'èsplikativ an sibpaj, pa menm roun senp dèskripsyon.
'
..'Ou pouvé %s pou dokimanté sa %s adékwatman.'
if page.namespace == 828 then -- Modjoul
tegsBando = tegsBando:forma(
'modjoul',
yannajUrl(dok, 'kréyé sa sibpaj', 'edit', 'Modjoul'),
'modjoul'
)
else -- Modèl
tegsBando = tegsBando:forma(
'modèl',
yannajUrl(dok, 'kréyé sa sibpaj', 'edit', ),
'modèl'
)
end
if page.namespace == 10 then -- Modèl
tegsBando = tegsBando ..
elseif page.namespace == 828 then -- Modjoul
if page.text:sub(1, 12) == 'Itilizatò:' then
-- Pa di katégorizasyon pou pseudo-namespace "Modjoul:Itilizatò:Toto/Non di modjoul"
elseif existeDoc == false then
tegsBando = tegsBando ..
end
end
local param = {
['likonn'] = 'OOjs_UI_icon_book-ltr.svg',
alt = 'MIT',
estil = 'width:80%;',
tegs = tegsBando,
}
res:wikitext(require('Modjoul:Bando')._bando(param))
end
if args['kontni oto ba'] then res:newline() :wikitext(arg['kontni oto ba']) end
res :tag('div') :css('clear', 'both')
return res end
local function notice(arg, paj, dok, existeDoc) local res = mw.html.create('div') :css('border-top', '1px solid #aaa') :css('margin', '1.5em 0 0')
local kontniParagraf = res :tag('p') :addClass('plainlinks') :css('margin-bottom', '0') :css('padding-left', '1em') :css('font-style', 'italic')
if arg['non modèl'] then local yannajLed = 'modèl' if page.namespace == 828 then yannajLed = 'modjoul' end
kontniParagraf
:wikitext('dokimantasyon di sa ')
:wikitext(yannajLed)
:wikitext(' sa jénéré pa modèl ')
:wikitext(mw.getCurrentFrame():expandTemplate{title = 'm', arg = {arg['non modèl']} })
:wikitext('.
')
else
kontniParagraf
:tag('span')
:addClass('lérò')
:wikitext('Lérò : paranmèt <kod>non modèl</kod> pa sa ransennyen.
')
end
if arg.konntni then
kontniParagraf
:wikitext('Li sa dirèkman enkli annan apèl-a di sa dannyé. ')
:wikitext('Si sa paj protéjé, souplé ')
:wikitext('transféré kontni di dokimantasyon bò so ')
:wikitext(yannajUrl(dok, 'sibpaj ki dédjé', 'edit', ))
:wikitext('.
')
elseif existeDoc then
kontniParagraf
:wikitext('Li sa enkli dipi ')
if arg['paj dok'] then kontniParagraf :wikitext('paj-a [[') :wikitext(tostring(dok)) :wikitext(']]. ') else kontniParagraf :wikitext('so [[') :wikitext(tostring(dok)) :wikitext('|sibpaj di dokimantasyon]] ') end
contenuParagraphe :tag('span') :css('font-size', '89%') :css('font-style', 'normal') :wikitext('(') :wikitext(yannajUrl(dok, 'listorik', 'history')) :wikitext(').') :done()
contenuParagraphe
:wikitext('Veuillez placer les catégories sur cette page là.
')
end
contenuParagraphe :wikitext('Les éditeurs peuvent travailler dans le ')
local titrePageBacasable = nomSouspage(page, 'Bac à sable') local pageBacasable = mw.title.new(titrePageBacasable)
if existePage(pageBacasable) then contenuParagraphe :wikitext('bac à sable ') :tag('span') :css('font-size', '89%') :css('font-style', 'normal') :wikitext('(') :wikitext(lienUrl(pageBacasable, 'modifier')) :wikitext(')') else local preLoad = '2' if page.namespace == 828 then preLoad = nil end contenuParagraphe :wikitext('bac à sable ') :tag('span') :css('font-size', '89%') :css('font-style', 'normal') :wikitext('(') :wikitext(lienUrl(pageBacasable, 'créer', 'edit', preLoad)) :wikitext(')') end
if page.namespace ~= 828 then contenuParagraphe:wikitext(' et la page de ')
local titrePageTest = nomSouspage(page, 'Test') local pageTest = mw.title.new(titrePageTest)
if existePage(pageTest) then contenuParagraphe :wikitext('test ') :tag('span') :css('font-size', '89%') :css('font-style', 'normal') :wikitext('(') :wikitext(lienUrl(pageTest, 'modifier')) :wikitext(')') else contenuParagraphe :wikitext('test ') :tag('span') :css('font-size', '89%') :css('font-style', 'normal') :wikitext('(') :wikitext(lienUrl(pageTest, 'créer', 'edit', '3')) :wikitext(')') end end contenuParagraphe:wikitext('.')
return res end
function p._documentation(args) local page = mw.title.getCurrentTitle() local titrePageDoc = args['page doc'] or nomSouspage(page, 'Documentation') local doc = mw.title.new(titrePageDoc) local existeDoc = existePage(doc) local res = mw.html.create()
--Bandeau pour les sous-pages /Bac à sable if page.subpageText == 'Bac à sable' then res :tag('div') :css('clear', 'both') :done() :wikitext(mw.getCurrentFrame():expandTemplate{title = 'Sous-page de bac à sable'}) end
--Génération de la documentation local couleur = '#ecfcf4' if page.namespace == 828 then couleur = '#ecf0fc' end
res :tag('div') :css('clear', 'both') :css('margin', '1em 0 0 0') :css('border', '1px solid #aaa') :css('background', couleur) :css('padding', '1em 1em 0.8em') :node(entete(args, page, doc, existeDoc)) :wikitext(protection(page, doc, existeDoc, args['message protection'])) :node(contenu(args, doc, existeDoc)) :node(notice(args, page, doc, existeDoc))
-- Catégorisation par défaut pour les modules sans documentation if page.namespace == 828 and page.subpageText ~= 'Bac à sable' and page.subpageText ~= 'Test' then if existeDoc == false then res:wikitext("Catégorie:Module en langage Lua") end end
return tostring(res) end
function p.documentation(frame) local args = {} local argsParent = frame:getParent().args
--Paramètres vides interprétés par Lua for cle, val in pairs(argsParent) do val = mw.text.trim(val) if val ~= then args[cle] = val end end
return p._documentation(args) end
return p
-- Sa modjoul ka adapté modèl-a {{Méta dokimantasyon di modèl}}.
local p = {}
local function existePage(paj)
return page and page.exists
end
local function nonSibpaj(paj, sibpaj)
--Nou pa annan roun sibpaj
if not page.isSubpage then
return page.subjectNsText .. ':' .. page.text .. '/' .. sibpaj
end
--Nou pa annan roun sibpaj
local sibPaj = page.subpageText
if sibPaj == 'Dokimantasyon'
or sibPaj == 'Batché sab'
or sibPaj == 'Tès' then
return page.subjectNsText .. ':' .. page.baseText .. '/' .. sibpaj
else
return page.subjectNsText .. ':' .. page.text .. '/' .. sibpaj
end
end
local function yannajUrl(nonPaj, titPaj, agsyon, pagePreload)
local argument = {['action'] = action or 'edit'}
if pagePreload then
argument['preload'] = 'Modèl:Dokimantasyon/Preload' .. pagePreload
end
return mw.ustring.format('[%s %s]', nonPaj:fullUrl(argument), titPaj)
end
local function lantet(arg, paj, dok, existeDoc)
local res = mw.html.create('div')
res
:css('margin-bottom', '1ex')
:css('border-bottom', '1px solid #aaa')
:css('padding-bottom', '3px')
:wikitext('[[Fiché:Test Template Info-Icon.svg|50px|alt=|link=]]')
:tag('span')
:css('font-weight', 'bold')
:css('font-size', '125%')
:css('vertical-align', 'middle')
:wikitext(' ')
:wikitext(args.titre or 'Dokimantasyon')
:done()
local ledisyonYannaj = res:tag('span')
:addClass('mw-editsection plainlinks')
:css('vertical-align', 'middle')
if not arg.kontni then
ledisyonYannaj:wikitext('[')
if existeDoc then
ledisyonYannaj:wikitext(yannajUrl(dok, 'modifyé'))
else
if page.namespace == 828 then
ledisyonYannaj:wikitext(yannajUrl(dok, 'kréyé', 'edit', 'Modjoul'))
else
ledisyonYannaj:wikitext(yannajUrl(dok, 'kréyé', 'edit', ''))
end
end
ledisyonYannaj:wikitext('] ')
end
ledisyonYannaj
:wikitext('[')
:wikitext(yannajUrl(paj, 'prijé', 'prij'))
:wikitext(']')
return res
end
local function protegsyon(paj, dok, existeDoc, mesaj)
-- Lensersyon otonmatik di modèl di protegsyon.
local nivelProtegsyon = page.protectionLevels.edit
if nivelProtegsyon and nivelProtegsyon[1] then
local tabProtegsyon = {
autoconfirmed = {'simiProtegsyon', '{{%s*[Ss]imi%-protegsyon%s*[|}]', '{{%s*[Ss]imi%-protegsyon +lonng%s*[|}]'},
editextendedsemiprotected = {'simiProtegsyonLarj', '{{%s*[Ss]imi%-protegsyon +larj%s*[|}]'},
sysop = {'protegsyon', '{{%s*[Pp]rotegsyon%s*[|}]'},
}
local protegsyon = tabProtegsyon[nivelProtegsyon[1]]
if not protegsyon then
return ''
end
local alreadyShown = false
if existeDoc then
-- Vérifikasyon ki pa gen kaba roun modèl di
-- protègsyon annan dokimantasyon-an di modèl.
local kontniDok = doc:getContent()
if kontniDok:match(protegsyon[2]) or (protegsyon[3] and kontniDok:match(protegsyon[3])) then
alreadyShown = true
end
end
if not alreadyShown then
if mesaj == '' then
mesaj = nil
end
return require('Modjoul:Protegsyon').main({mesaj}, protegsyon[1], paj)
end
end
end
-- pou batché sab-a, nou ka anlvé baliz-ya di katégori
-- ki abitchwèlman sitchwé an "includeonly" an finisman di dokimantasyon-an
local function anlveBalizKategori(kontniDok)
local count
repeat
kontniDok, count = mw.ustring.gsub(kontniDok, '%[%[Katégori:[^%]]+%]%][\t\r\n\f ]*$', '')
until count == 0
kontniDok, count = mw.ustring.gsub(kontniDok, '[\t\r\n\f ]*$', '')
return kontniDok
end
local function kontni(arg, dok, existeDoc)
local paj = mw.title.getCurrentTitle()
local res = mw.html.create():newline()
if arg['kontni oto rot'] then
res:wikitext(args['kontni oto rot'])
:newline()
end
if arg.kontni then
res:newline()
:wikitext(arg.kontni)
:newline()
elseif existeDoc then
local kontniDok = mw.getCurrentFrame():expandTemplate{title = doc.prefixedText}
if page.subpageText == 'Batché sab' or page.subpageText == 'Tes' then
kontniDok = kaanlveBalizKategori(kontniDok)
end
res:newline()
:wikitext(kontniDok)
:newline()
elseif page.subpageText ~= 'Batché sab' and page.subpageText ~= 'Tes' and args['kontni ki fakiltativ'] == nil then
local tesBando = '<b>Sa %s ka posédé pyès [[Led:Dokimantasyon di modèl|dokimantasyon]] '
..'èsplikativ an sibpaj</b>, pa menm roun senp dèskripsyon.<br> '
..'Ou pouvé %s pou dokimanté sa %s adékwatman.'
if page.namespace == 828 then -- Modjoul
tegsBando = tegsBando:forma(
'modjoul',
yannajUrl(dok, 'kréyé sa sibpaj', 'edit', 'Modjoul'),
'modjoul'
)
else -- Modèl
tegsBando = tegsBando:forma(
'modèl',
yannajUrl(dok, 'kréyé sa sibpaj', 'edit', ''),
'modèl'
)
end
if page.namespace == 10 then -- Modèl
tegsBando = tegsBando .. '[[Katégori:Modèl san dokimantasyon]]'
elseif page.namespace == 828 then -- Modjoul
if page.text:sub(1, 12) == 'Itilizatò:' then
-- Pa di katégorizasyon pou pseudo-namespace "Modjoul:Itilizatò:Toto/Non di modjoul"
elseif existeDoc == false then
tegsBando = tegsBando .. '[[Katégori:Modjoul san dokimantasyon]]'
end
end
local param = {
['likonn'] = 'OOjs_UI_icon_book-ltr.svg',
alt = 'MIT',
estil = 'width:80%;',
tegs = tegsBando,
}
res:wikitext(require('Modjoul:Bando')._bando(param))
end
if args['kontni oto ba'] then
res:newline()
:wikitext(arg['kontni oto ba'])
end
res
:tag('div')
:css('clear', 'both')
return res
end
local function notice(arg, paj, dok, existeDoc)
local res = mw.html.create('div')
:css('border-top', '1px solid #aaa')
:css('margin', '1.5em 0 0')
local kontniParagraf = res
:tag('p')
:addClass('plainlinks')
:css('margin-bottom', '0')
:css('padding-left', '1em')
:css('font-style', 'italic')
if arg['non modèl'] then
local yannajLed = '[[Lèd:Modèl|modèl]]'
if page.namespace == 828 then
yannajLed = '[[Lèd:Modjoul|modjoul]]'
end
kontniParagraf
:wikitext('[[Lèd:Dokimantasyon di modèl|dokimantasyon]] di sa ')
:wikitext(yannajLed)
:wikitext(' sa jénéré pa modèl ')
:wikitext(mw.getCurrentFrame():expandTemplate{title = 'm', arg = {arg['non modèl']} })
:wikitext('.<br>')
else
kontniParagraf
:tag('span')
:addClass('lérò')
:wikitext('Lérò : paranmèt <kod>non modèl</kod> pa sa ransennyen.<br>')
end
if arg.konntni then
kontniParagraf
:wikitext('Li sa dirèkman [[Lèd:Lenklizyon|enkli]] annan apèl-a di sa dannyé. ')
:wikitext('Si sa paj protéjé, souplé ')
:wikitext('transféré kontni di dokimantasyon bò so ')
:wikitext(yannajUrl(dok, 'sibpaj ki dédjé', 'edit', ''))
:wikitext('.<br>')
elseif existeDoc then
kontniParagraf
:wikitext('Li sa [[Lèd:Lenklizyon|enkli]] dipi ')
if arg['paj dok'] then
kontniParagraf
:wikitext('paj-a [[')
:wikitext(tostring(dok))
:wikitext(']]. ')
else
kontniParagraf
:wikitext('so [[')
:wikitext(tostring(dok))
:wikitext('|sibpaj di dokimantasyon]] ')
end
contenuParagraphe
:tag('span')
:css('font-size', '89%')
:css('font-style', 'normal')
:wikitext('(')
:wikitext(yannajUrl(dok, 'listorik', 'history'))
:wikitext(').')
:done()
contenuParagraphe
:wikitext('Veuillez placer les catégories sur cette page là.<br>')
end
contenuParagraphe
:wikitext('Les éditeurs peuvent travailler dans le ')
local titrePageBacasable = nomSouspage(page, 'Bac à sable')
local pageBacasable = mw.title.new(titrePageBacasable)
if existePage(pageBacasable) then
contenuParagraphe
:wikitext('[[' .. titrePageBacasable .. '|bac à sable]] ')
:tag('span')
:css('font-size', '89%')
:css('font-style', 'normal')
:wikitext('(')
:wikitext(lienUrl(pageBacasable, 'modifier'))
:wikitext(')')
else
local preLoad = '2'
if page.namespace == 828 then
preLoad = nil
end
contenuParagraphe
:wikitext('bac à sable ')
:tag('span')
:css('font-size', '89%')
:css('font-style', 'normal')
:wikitext('(')
:wikitext(lienUrl(pageBacasable, 'créer', 'edit', preLoad))
:wikitext(')')
end
if page.namespace ~= 828 then
contenuParagraphe:wikitext(' et la page de ')
local titrePageTest = nomSouspage(page, 'Test')
local pageTest = mw.title.new(titrePageTest)
if existePage(pageTest) then
contenuParagraphe
:wikitext('[[' .. titrePageTest .. '|test]] ')
:tag('span')
:css('font-size', '89%')
:css('font-style', 'normal')
:wikitext('(')
:wikitext(lienUrl(pageTest, 'modifier'))
:wikitext(')')
else
contenuParagraphe
:wikitext('test ')
:tag('span')
:css('font-size', '89%')
:css('font-style', 'normal')
:wikitext('(')
:wikitext(lienUrl(pageTest, 'créer', 'edit', '3'))
:wikitext(')')
end
end
contenuParagraphe:wikitext('.')
return res
end
function p._documentation(args)
local page = mw.title.getCurrentTitle()
local titrePageDoc = args['page doc'] or nomSouspage(page, 'Documentation')
local doc = mw.title.new(titrePageDoc)
local existeDoc = existePage(doc)
local res = mw.html.create()
--Bandeau pour les sous-pages /Bac à sable
if page.subpageText == 'Bac à sable' then
res
:tag('div')
:css('clear', 'both')
:done()
:wikitext(mw.getCurrentFrame():expandTemplate{title = 'Sous-page de bac à sable'})
end
--Génération de la documentation
local couleur = '#ecfcf4'
if page.namespace == 828 then
couleur = '#ecf0fc'
end
res
:tag('div')
:css('clear', 'both')
:css('margin', '1em 0 0 0')
:css('border', '1px solid #aaa')
:css('background', couleur)
:css('padding', '1em 1em 0.8em')
:node(entete(args, page, doc, existeDoc))
:wikitext(protection(page, doc, existeDoc, args['message protection']))
:node(contenu(args, doc, existeDoc))
:node(notice(args, page, doc, existeDoc))
-- Catégorisation par défaut pour les modules sans documentation
if page.namespace == 828 and page.subpageText ~= 'Bac à sable' and page.subpageText ~= 'Test' then
if existeDoc == false then
res:wikitext("[[Catégorie:Module en langage Lua]]")
end
end
return tostring(res)
end
function p.documentation(frame)
local args = {}
local argsParent = frame:getParent().args
--Paramètres vides interprétés par Lua
for cle, val in pairs(argsParent) do
val = mw.text.trim(val)
if val ~= '' then
args[cle] = val
end
end
return p._documentation(args)
end
return p