Modul:Benutzer:Recompile/MyScript.lua
Erscheinungsbild
Die Dokumentation für dieses Modul kann unter Modul:Benutzer:Recompile/MyScript.lua/Doku erstellt werden
local p = {}
function p.hello(frame)
local name = frame.args[1]
if not name then
name = 'Welt'
end
return 'Hallo, ' .. name .. '! Dies ist Lua!'
end
function p.apples(frame)
return 'Or pears?'
end
function p.chocolate(frame)
return 'And mayonese!'
end
function p.accessPage(frame)
id = mw.wikibase.getEntityIdForTitle( 'Berlin' )
url = mw.wikibase.getEntityUrl(id)
return url
end
function p.accessData(frame)
-- ret = ""
id = mw.wikibase.getEntityIdForTitle( 'Berlin' )
entity = mw.wikibase.getEntity( id )
-- props = entity:getProperties()
-- prop = props[1]
-- statement = entity:formatStatements( prop )
-- return statement[1]
local snaks = entity['claims']['P18'][1]['qualifiers']
mw.wikibase.formatValues( snaks )
end
return p