Ouvrir le menu principal

Modifications

Module:Documentation

110 octets ajoutés, 31 octobre 2018 à 12:34
Don't show jump link on widgets
local getType = function( namespace, page )
local pageType = 'modèletemplate'
if namespace == 'Module' then
pageType = 'module'
elseif namespace == 'Widget' then
pageType = 'widget'
elseif page.fullText:gsub( '/' .. defaultDocPage .. '$', '' ):find( '%.css$' ) then
pageType = 'stylesheet'
local out
if not args.content and tostring( page ) == docPage then
out = f:preprocess( '{{subst:ModèleTemplate:Documentation/preload}}' )
else
local templateArgs = {}
out = f:preprocess( out )
if not args.nocat then
out = out .. '[[CatégorieCategory:Pages with templates requiring substitution]]'
end
end
:tag( 'div' )
:css( 'float', 'right' )
:wikitext( '[[', page:fullUrl( 'action=purge' ), ' purgerpurge]]' )
:done()
:wikitext(
'Ceci est la This is the documentation page de documentation, elle it ', pageType == 'module' and 'vawill' or 'devraitshould', ' être incluse dans le page principale du be transcluded into the main ', pageType, 'page. ', 'Voir See [[ModèleTemplate:Documentation]] pour plus d\'informationsfor more information'
)
if badDoc then
body:wikitext( "<br>'''La documentation de ce This ", pageType, " a besoin d'être améliorées documentation needs improving or additional information.'''" )
end
if not ( args.nocat or namespace == 'UtilisateurUser' ) then body:wikitext( '[[CatégorieCategory:Pages de documentationDocumentation pages]]' )
end
end
local action = 'modifieredit'
local preload = ''
local colour = 'EAF4F9'
local category
if noDoc then
action = 'créercreate' preload = '&preload=ModèleTemplate:Documentation/preload'
colour = 'F9EAEA'
message = "'''Ce This " .. pageType .. " n'a pas de has no documentation. " .. "Si vous savez comment l'utiliserIf you know how to use this " .. pageType .. ", merci de la créerplease create it.'''" if not ( args.nocat or namespace == 'UtilisateurUser' ) then category = pageType .. ' sans s with no documentation' if not mw.title.new( 'CatégorieCategory:' .. category ).exists then category = 'Pages sans with no documentation'
end
end
elseif badDoc then
colour = 'F9F2EA'
message = "'''La documentation de ce This " .. pageType .. " a besoin d'être améliorées documentation needs improving or additional information.'''\n" if not ( args.nocat or namespace == 'UtilisateurUser' ) then category = pageType .. 's avec une mauvaise with bad documentation' if not mw.title.new( 'CatégorieCategory:' .. category ).exists then category = 'Pages avec une mauvaise with bad documentation'
end
end
local links = {
'[' .. docPage:fullUrl( 'action=edit' .. preload ) .. ' ' .. action .. ']',
'[' .. docPage:fullUrl( 'action=history' ) .. ' historiquehistory]', '[' .. page:fullUrl( 'action=purge' ) .. ' purgerpurge]'
}
if not noDoc and page ~= docPage then
table.insert( links, 1, '[[' .. docPage.fullText .. '|voirview]]' )
end
links = mw.html.create( 'span' )
:wikitext( 'Documentation' )
local codePages = { module = true, stylesheet = true, script = true, } if not noDoc and codePages[pageType ~= 'modèle' and pageType ~= 'message' ] then
header
:tag( 'span' )
:css( 'white-space', 'nowrap' )
:wikitext( '[[#the-code|Aller au Jump to code ↴]]' )
end
}
:node( links )
:wikitext( 'La The above documentation ci-dessus est insérée depuis is transcluded from [[', docPage.fullText, ']].' ) end if category then body:wikitext( f:expandTemplate{ title = 'Translation category', args = { category, project = '0' } } )
end
local anchor = ''
if not noDoc and pageType ~= 'modèletemplate' and pageType ~= 'message' then
anchor = mw.html.create( 'div' ):attr( 'id', 'the-code' )
end
local cat = "" if category then cat = '[[Catégorie:' .. category .. ']]' end return tostring( body ) .. tostring( anchor ) .. cat
end
return p
Utilisateur anonyme