Module:Credits: Difference between revisions
From Videogame Morgue File
MorgueFile (talk | contribs) mNo edit summary |
MorgueFile (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
local p = {}; | local p = {}; | ||
function p.credits( frame ) | function p.credits( frame ) | ||
Line 16: | Line 11: | ||
for iKey,sValue in pairs(tArgs.args) do | for iKey,sValue in pairs(tArgs.args) do | ||
sOutputText = sOutputText .. '<dt class="col-sm-3">' .. iKey .. '</dt><dd class="col-sm-7">' | sOutputText = sOutputText .. '<dt class="col-sm-3">' .. iKey .. '</dt><dd class="col-sm-7">' | ||
local credits_table = mw.text.split( sValue, "#") | local credits_table = mw.text.split( sValue, "#") | ||
credits_string = table.concat( credits_table, '<br />' ) | credits_string = table.concat( credits_table, '<br />' ) | ||
Revision as of 12:54, 14 Mayıs 2021
Documentation for this module may be created at Module:Credits/doc
local p = {}; function p.credits( frame ) local tArgs = frame:getParent() if not( tArgs.args[1] ) then tArgs = frame end local sOutputText = '<div class="container-fluid"><dl class="row">' for iKey,sValue in pairs(tArgs.args) do sOutputText = sOutputText .. '<dt class="col-sm-3">' .. iKey .. '</dt><dd class="col-sm-7">' local credits_table = mw.text.split( sValue, "#") credits_string = table.concat( credits_table, '<br />' ) sOutputText = sOutputText .. credits_string .. '</dd>' end sOutputText = sOutputText .. "</dl></div>" return sOutputText end return p