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
-- args:
-- subject: The subject entity to get data from.
--- E.g., "Kerbol", "LW-Sw "SWERV""
-- param: 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"}
-- Load the JSON from the Data: page
local dataJson = mw.loadJsonData("Data:"..args[1])
--local dataJson = mw.title.new("Data:"..args[1]):getContent()
--dataJson = mw.text.jsonDecode(dataJson)
-- This approach doesn't return anything useable, apparently
--local dataTab = require("Module:Example")
--local jsonData = dataTab.data
000
1:0
Templates used on this page:
Return to Module:Data.