Module:Math
Documentation for this module may be created at Module:Math/doc
-- vim: set noexpandtab ft=lua ts=4 sw=4:
require('Module:No globals')
local p = {}
local debug = false
------------------------------------------------------------------------------
-- module local variables and functions
local wiki =
{
langcode = mw.language.getContentLanguage().code
}
p.getMathValue = function(frame)
local propertyID = mw.text.trim(frame.args[1] or "")
local input_parm = mw.text.trim(frame.args[2] or "")
if input_parm == "FETCH_WIKIDATA" then
local entity = mw.wikibase.getEntityObject()
local claims
if entity and entity.claims then claims = entity.claims[propertyID] end
if claims then
return frame:preprocess( entity:formatStatements(propertyID).value )
else
return ""
end
else
return input_parm
end
end
return p