17 214
contributi
m (New Wikicode API support - Restoring) |
|||
This module creates link to games, displaying them in superscripts
with colored abbreviations.
Examples:
local txt = require('Modulo:Wikilib/strings')▼
local lib = require('Modulo:Wikilib/sigle')▼
local c = mw.loadData('Modulo:Colore/data')▼
{{#invoke: Sup | UL }}
▲--[=[
{{#invoke: Sup | RZS | RFVF}}
{{#invoke: Sup | HGSS | XY | ROZA }}
HINT: If you get an Errore Script, try to split an abbreviation into
smaller parts. For example:
{{#invoke: Sup | OACPtHGSS }} --> {{#invoke: Sup | OAC | Pt | HGSS }}
--]=]▼
local singleDisplay = function(pair)▼
end▼
-- Creates the links for a single abbreviation, as a single string
return table.concat(lib.coloredAbbrevLinks(data, lib.bolden))
end
-- Wraps a list of links content in sup tags
table.insert(links, 1, '<sup>')
table.insert(links, '</sup>')
return table.concat(links)
▲end
-- Dynamically generated Wikicode interface
return table.map(m, function(_, abbr)
--[[
Wikicode arguments are first processed one-by-one by makeLinks,
resulting in a table having a string for every argument, containing
all the links. These strings are then concatenated and wrapped in sup
tags by makeSup.
--]]
return lib.onMergedAbbrs(abbr, makeLinks, makeSup)
end)
|
contributi