Module:Math: Difference between revisions

From DRMF
Jump to navigation Jump to search
imported>Admin
No edit summary
imported>Admin
Undo revision 2443 by Admin (talk)
Line 2: Line 2:
require('Module:No globals')
require('Module:No globals')


return  function(frame)
local p = {}
 
p.r= function(frame)
local propertyID = mw.text.trim(frame.args[1] or "")
local propertyID = mw.text.trim(frame.args[1] or "")
local entity = mw.wikibase.getEntityObject()
local entity = mw.wikibase.getEntityObject()
Line 13: Line 15:
end
end
end
end
return p

Revision as of 19:36, 13 March 2017

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 = {}

p.r= function(frame)
	local propertyID = mw.text.trim(frame.args[1] or "")
		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
end

return p