Jump to content

Module:Sandbox/RexxS

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by RexxS (talk | contribs) at 17:33, 7 January 2020 (testing categories). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- This is here as a placeholder.
-- It is to demonstrate to Google-Code-in students what the module sandbox is.

local p = {}

function p.cats(frame)
	local title = frame.args.title
	local ttlobj = mw.title.new( title, 0 )
	local cont = ttlobj:getContent()
	if cont then return cont:sub(1,10) end
end

function p.namespaces(frame)
	local ns = mw.site.namespaces()
	local msg = ""
	for k, v in pairs(ns) do
		msg = msg .. k .. " = " .. v .. "<br>"
	end
	return msg
end

return p