Difference between revisions of "Module:Sandbox"

From Asmbly Wiki
(+)
 
m (1 revision imported)
 
(No difference)

Latest revision as of 02:23, 24 December 2022

Documentation for this module may be created at Module:Sandbox/doc

local p = {} --p stands for package

function p.hello( frame )
	-- Get wiki from input
	-- {{#invoke:cil|Q42|wiki}}? {{cil|Q42|wiki}}? "cross-wiki inter-language link"
	-- Get user language ({{userlang}} does this, but how to do it in Lua?)
	-- Combine user language code with project (e.g. en + wiki)
	-- Check if it exists:
    return mw.wikibase.getSitelink( 'Q42', 'orcawiki' )
    -- Will return the page name if exists, else returns nil
    -- If page name, link: [[en:w:page]], etc
    -- If not exist, link to Wikidata
end

return p