ഘടകം:Maki icon overview
Usage
Grid layout
This mode shows all icons embedded in a Kartographer map. Hovering or clicking an icon shows the corresponding name to use in a map's marker-symbol.
{{#invoke:Maki icon overview | grid}}
- icons
- If you want to show the
numbersorlettersinstead of icons, provide one of these keywords to theiconsparameter.
{{#invoke:Maki icon overview | grid
| icons = letters
}}
Table layout
Renders the icons in a list, which is more suitable for searching.
{{#invoke:Maki icon overview | list}}
If you want to provide translations or descriptions of some icons, this can be accomplished by giving the icon name as a template parameter, and the text as a value:
{{#invoke:Maki icon overview | list
| animal-shelter = Domestic animal medical and adoption center.
| toll-booth = Roadside nuisance for collecting money.
}}
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