Module:AampIndexedParam: Difference between revisions
Jump to navigation
Jump to search
imported>Leoetlino (Created page with "-- Utils for Template:AampIndexedParam local pack = {} function pack.get_description(frame) local key = frame.args.key local start_idx = frame.args.start_idx or 0 r...") |
imported>Leoetlino No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
function pack.get_description(frame) | function pack.get_description(frame) | ||
local key = frame.args.key | local key = frame.args.key | ||
local start_idx = frame.args.start_idx or 0 | local start_idx = tonumber(frame.args.start_idx) or 0 | ||
return " | return string.format("<b>Note: Indexes start at <i>%u</i></b>", start_idx) .. "<br>Examples:<br>" | ||
.. string.format( | .."<code>" .. string.format(key, start_idx) .. "</code><br>" | ||
.."<code>" .. string.format(key, start_idx + 1) .. "</code>" | |||
end | end | ||
return pack | return pack |
Latest revision as of 11:32, 15 September 2018
Documentation for this module may be created at Module:AampIndexedParam/doc
-- Utils for Template:AampIndexedParam
local pack = {}
function pack.get_description(frame)
local key = frame.args.key
local start_idx = tonumber(frame.args.start_idx) or 0
return string.format("<b>Note: Indexes start at <i>%u</i></b>", start_idx) .. "<br>Examples:<br>"
.."<code>" .. string.format(key, start_idx) .. "</code><br>"
.."<code>" .. string.format(key, start_idx + 1) .. "</code>"
end
return pack