"ഘടകം:Maki icon overview" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം
en>Adamw Mostly style updates |
No edit summary |
||
| (2 ഉപയോക്താക്കൾ ചെയ്ത ഇടയ്ക്കുള്ള 5 നാൾപ്പതിപ്പുകൾ പ്രദർശിപ്പിക്കുന്നില്ല) | |||
| വരി 277: | വരി 277: | ||
end | end | ||
function p.list ( frame ) | function p.list(frame) | ||
local outputTable = {} | |||
local hasDescriptions = false | |||
for key, icon in pairs(p.icons) do | |||
-- Use the icon variable for the correct file reference | |||
table.insert(outputTable, '|-\n| [[File:Maki7-' .. icon .. '.svg|18px]] || ' .. icon) | |||
-- Check for and include descriptions if available | |||
local helpText = frame.args[icon] or frame:getParent().args[icon] | |||
if helpText then | |||
table.insert(outputTable, ' || ' .. helpText) | |||
hasDescriptions = true | |||
end | |||
table.insert(outputTable, '\n') | |||
end | |||
-- Table header | |||
local tableHeader = [[ | |||
{|class="wikitable" | |||
|+ {{int:kartographer-icon-docs-table}} | |||
! {{int:kartographer-icon-docs-icon}} !! {{int:kartographer-icon-docs-key}} | |||
]] | |||
if hasDescriptions then | |||
tableHeader = tableHeader .. '!! {{int:kartographer-icon-docs-help}}' | |||
end | |||
table.insert(outputTable, 1, tableHeader .. '\n') | |||
-- Table footer | |||
table.insert(outputTable, '|}') | |||
return frame:preprocess(table.concat(outputTable)) | |||
end | end | ||
return p | return p | ||