Modul:Wikibase
Erscheinungsbild
{{#invoke:Wikibase|EntityIdForTitle|Deutschland}}
ergibt Q183
local p = {}
function p.EntityIdForTitle(frame)
return mw.wikibase.getEntityIdForTitle( frame.args[1] )
end
function p.struc(frame)
local function try()
local i, e = 1, mw.wikibase.getEntity();
while frame.args[i] do
e = e[ frame.args[ i ] ] or e[ tonumber( frame.args[ i ] ) ];
i = i + 1
end
return tabletostr( e, frame.args[ 'f' ], frame.args[ 's' ] or '; ', '{', '}' )
end
local r, result = pcall( try );
if r then
return result;
else
return '<strong class="error">Error</strong>';
end
end
return p