Module:Sandbox/Fungster: Difference between revisions

From TestWiki
Content added Content deleted
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {}
local p = {}


-- Load necessary modules
-- This is my sandbox.
require ("Module:No globals")
function p.main (frame, args)
local getArgs = require("Module:Arguments").getArgs
local getArgs = require('Module:Arguments').getArgs -- loads the module
local yesno = require("Module:Yesno")
if frame.getParent (args) and not number.isUnrecognizable then return "Hello!"

-- The first function.
function p.speedy_delete (frame, args)
local text = frame.args[1]
return "This page is a candidate for speedy deletion because " .. text .. "."
end

function p.delete (frame, args)
local text = frame.args[1]
return "This page is a candidate for deletion because " .. text .. "."
end

function p.cleanup (frame, args)
local text = frame.args[1]
return "This page needs to be [[w:Wikipedia:Cleanup|cleanuped]] because " .. text .. "."
end

function p.content (frame, args)
local text = frame.args[1]
return "This page is lacking a core thing on an article and needs to be fixed because " .. text .. "."
end

function p.move (frame, args)
local text = frame.args[1]
return "This page is requested to be moved because " .. text .. "."
end
end


function p.protection (frame, args)
local text = frame.args[1]
return "This page is protected because " .. text .. "." -- .. name .. replace by the word Fred
end
end



Latest revision as of 18:03, 20 June 2019

This is my test case for Lua.

Usage[edit]

This module test case requires Module:Arguments, Module:No globals and Module:Yesno.

Example[edit]

  • This page is a candidate for speedy deletion because the target article violates TestWiki:Policy.
  • {{#invoke:Sandbox/Fungster|speedy_delete|the target article violates [[TestWiki:Policy]]}}

local p = {}

-- Load necessary modules
require ("Module:No globals")
local getArgs = require('Module:Arguments').getArgs -- loads the module
local yesno = require("Module:Yesno")

-- The first function.
function p.speedy_delete (frame, args)
	local text = frame.args[1] 
	return "This page is a candidate for speedy deletion because " .. text .. "." 
end

function p.delete (frame, args)
	local text = frame.args[1] 
	return "This page is a candidate for deletion because " .. text .. "." 
end

function p.cleanup (frame, args)
	local text = frame.args[1] 
	return "This page needs to be [[w:Wikipedia:Cleanup|cleanuped]] because " .. text .. "." 
end

function p.content (frame, args)
	local text = frame.args[1] 
	return "This page is lacking a core thing on an article and needs to be fixed because " .. text .. "." 
end

function p.move (frame, args)
	local text = frame.args[1] 
	return "This page is requested to be moved because " .. text .. "." 
end

function p.protection (frame, args)
	local text = frame.args[1] 
	return "This page is protected because " .. text .. "." -- .. name .. replace by the word Fred
end

return p