View source for Module:Data
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local p = {}
local getArgs = require('Module:Arguments').getArgs
-- subject: The subject entity to get data from.
--- E.g., "Kerbol", "LW-Sw "SWERV""
-- args: The parameter / parameter chain to access from the data page.
--- E.g., "mass", "max_temp", "modules|engine|isp_vac", "modules|generator|outputs|units"
function p.getData(frame)
-- Get arguments from the invoke
local args = getArgs(frame) -- E.g., args = {"Example", "modules", "engine", "isp", "vac"}
-- Pass arguments to the helper function
dataJson = p._getData(args)
return dataJson--[args[2]]["engine"]["isp"]["vac"]
end
function p._getData(args)
-- Load the data from the JSON page, parsed as a table of tables
local dataJson = mw.loadJsonData("Data:"..args[1])
-- Iterate through dataJson using the args values as keys to
000
1:0
Templates used on this page:
Return to Module:Data.