Module:Prototype page

From Official Factorio Wiki
Revision as of 13:29, 25 October 2024 by Bilka (talk | contribs) (Ported Template:Prototype page to use hardcoded list instead of SMW properties)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Lua method used by Template:Prototype page.

Edit this documentation on Module:Prototype page/doc.

Display a link to the prototype documentation page of a prototype based on the lua prototype name given as the first parameter. Uses the mapping of prototype name to prototype doc page from Module:Prototype page/data.


local data = mw.loadData("Module:Prototype page/data")

local p = {}

function p.main(frame)
  local args = frame:getParent().args
  local lua_type = args[1]
  return string.format("[[%s|%s]]", lua_type, data[lua_type])
end

return p