Jump to content

Module:Cite taxon

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jts1882 (talk | contribs) at 15:40, 11 June 2018 (create module and check interaction with template). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

--require('Module:No globals')
-- All Lua modules on Wikipedia must begin by defining a variable that will hold their
-- externally accessible functions. They can have any name and may also hold data.
local p = {}

-- Add a function to the variable. These are callable in Wikipedia via the #invoke command.
-- "frame" will contain the data that Wikipedia sends this function when it is called. 
p.hello = function(frame) 

    -- Declare a local variable and assign data to it.
    local str = "Hello World!"  

    -- Quit this function and send the information in "str" back to Wikipedia.
    -- The "print" function is not allowed, so all output is accomplished via 
    -- returning strings in this fashion.
    return str    
end  -- End the function.

-- main function
p.main = function(frame) 
	local str = p.getSpeciesReference()
	
	return str
	--return frame:preprocess(str)   -- if the string needs to be preprocessed!!!!!
end  -- End the function.

p.getSpeciesReference = function(frame)

	return "testing"	
end -- End the function.



-- All modules end by returning the variable containing its functions to Wikipedia.
return p

-- We can now use this module by calling {{#invoke: HelloWorld | hello }}.
-- The #invoke command begins with the module's name, in this case "HelloWorld",
-- then takes the name of one of its functions as an argument, in this case "hello".