Module:AampIndexedParam: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
imported>Leoetlino
No edit summary
imported>Leoetlino
No edit summary
Line 7: Line 7:
   local start_idx = tonumber(frame.args.start_idx) or 0
   local start_idx = tonumber(frame.args.start_idx) or 0
    
    
   return "The first element is called <code>" .. string.format(key, start_idx) .. "</code>,<br>then <code>" .. string.format(key, start_idx + 1) .. "</code>, etc.<br>"
   return "e.g.:<br>"
     .. string.format("Note: Indexes start from %u", start_idx)
    .."<code>" .. string.format(key, start_idx) .. "</code><br>"
    .."<code>" .. string.format(key, start_idx + 1) .. "</code><br><br>"
     .. string.format("Note: Indexes start at %u", start_idx)
end
end


return pack
return pack

Revision as of 11:31, 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 "e.g.:<br>"
    .."<code>" .. string.format(key, start_idx) .. "</code><br>"
    .."<code>" .. string.format(key, start_idx + 1) .. "</code><br><br>"
    .. string.format("Note: Indexes start at %u", start_idx)
end

return pack