Module:AutoHeader: Difference between revisions
Appearance
Intcreator (talk | contribs) Created page with "local p = {} p.getJson = function(frame) -- local ret = mw.visualdata.query( schema ("inventory_item"), query (string), printouts (list or table), params (table) ) local ret = mw.visualdata.query( 'Phone', 'manufacturer::+', {'manufacturer'}, {} ) return mw.text.jsonEncode(ret) end return p" |
Intcreator (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
end | end | ||
p.getIntroParagraph = function(frame) | |||
local data = p.getJson(frame) | |||
local title = data["title"] | |||
local title = data["data"]["manufacturer"] | |||
return string.format("The %q was manufactured by %q", title) | |||
end | |||
return p | return p |
Revision as of 16:18, 6 January 2025
Documentation for this module may be created at Module:AutoHeader/doc
local p = {}
p.getJson = function(frame)
-- local ret = mw.visualdata.query( schema ("inventory_item"), query (string), printouts (list or table), params (table) )
local ret = mw.visualdata.query( 'Phone', '[[manufacturer::+]]', {'manufacturer'}, {} )
return mw.text.jsonEncode(ret)
end
p.getIntroParagraph = function(frame)
local data = p.getJson(frame)
local title = data["title"]
local title = data["data"]["manufacturer"]
return string.format("The %q was manufactured by %q", title)
end
return p