Differenze tra le versioni di "Modulo:UselessForms/data"

Adding plain links *** sovrascritto il testo esistente ***
(Bot: adding Zarude "Papà" *** sovrascritto il testo esistente ***)
(Adding plain links *** sovrascritto il testo esistente ***)
local tab = require('Modulo:Wikilib/tables') -- luacheck: no unused
 
-- TODO: refactor link creations, shamelessly copied from AltForms-data
 
--[[
 
 
Arguments:
- context: a string containing a ${link} replacement. The string is a
- black: a boolean value. If true returns black links, otherwise normal
context in which ${link} is replaced with the actual link
- formName: name of the specific form
- poke: base name of the Pokémon
 
--]]
local function makeSingleLink(blackcontext, formName, poke, general)
if formName == "" then
return ""
target = table.concat{string.fu(poke), "/Forme"}
end
return string.interp('<div class="small-text${black}">[[${target}|${formName}]]</div>'context, {
link = table.concat{"[[", target, "|", formName, "]]"}
black = black and " black-text" or "",
formName = formName,
target = target
})
end
 
-- CreatesCreate all links tofor alternative forms (black, blue and plain)
local function makeLinks(black)
local contexts = {
local index = black and 'blacklinks' or 'links'
links = '<div class="small-text">${link}</div>',
 
blacklinks = '<div class="small-text black-text">${link}</div>',
-- Adds standard links
plainlinks = '${link}',
for name, poke in pairs(t) do
}
poke[index] = table.map(poke.names, function(formName)
for index, context in pairs(contexts) do
return makeSingleLink(black, formName, name)
for name, poke in pairs(t) do
end)
poke[index] = table.map(poke.names, function(formName)
return makeSingleLink(blackcontext, formName, name)
end)
end
end
end
-- Link creation should be done AFTER copying Pokémon with same forms, in order
-- to use the right name for the link
makeLinks() -- normal links
makeLinks(true) -- black links
 
t[25] = t.pikachu
79 546

contributi