Module:Anchored list: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
p.generate = function (frame) |
p.generate = function (frame) |
||
local i = 0 |
local i = 0 |
||
local output = "<ol style=\"" .. frame.style .. "\" name=\"" .. name .. "\">" |
local output = "<ol style=\"" .. (frame.style or "") .. "\" name=\"" .. (frame.name or "") .. "\">" |
||
for item in frame.args do |
for item in frame.args do |
||
i = i + 1 |
i = i + 1 |
||
output = output .. "<li style=\"" .. frame.style .. "\" id=\"alist" .. frame.name .. "-" .. i .. "\">" .. item .. "</li>" |
output = output .. "<li style=\"" .. (frame.style or "") .. "\" id=\"alist" .. (frame.name or "") .. "-" .. i .. "\">" .. item .. "</li>" |
||
end |
end |
||
return output .. "</ol>" |
return output .. "</ol>" |
||
end |
end |
||
return p |
Revision as of 18:08, 28 January 2023
![]() | Module rating is invalid or not specified. |
Usage
{{#invoke:Anchored list|generate|style=|name=|....}}
Used for template:Anchored list.
local p = {}
p.generate = function (frame)
local i = 0
local output = "<ol style=\"" .. (frame.style or "") .. "\" name=\"" .. (frame.name or "") .. "\">"
for item in frame.args do
i = i + 1
output = output .. "<li style=\"" .. (frame.style or "") .. "\" id=\"alist" .. (frame.name or "") .. "-" .. i .. "\">" .. item .. "</li>"
end
return output .. "</ol>"
end
return p