Module:Wikidata-redirect
Uiterlijk
Documentatie voor deze module kan aangemaakt worden op de volgende pagina: Module:Wikidata-redirect/doc
local p = {}
local function tabletostr( t, s, o, c )
if type( t ) == "table" then
local f = {};
for k, v in pairs( t ) do
table.insert( f, string.format( '%s = %s', k, tabletostr( v, s, o, c ) ) )
end;
table.sort( f );
return ( o or '' ) .. table.concat( f, s or '' ) .. ( c or '' )
else
return tostring( t )
end
end
function p.interwikiNumber()
local entity = mw.wikibase.getEntity();
local sitelinks_table = entity[ 'sitelinks' ];
local sitelinks = tabletostr( sitelinks_table, '; ', '{', '}' );
local _, res = mw.ustring.gsub(sitelinks, 'wiki', '');
return res / 2;
end
return p