<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2F54nd60x%2Ftest</id>
	<title>Module:Sandbox/54nd60x/test - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2F54nd60x%2Ftest"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/54nd60x/test&amp;action=history"/>
	<updated>2026-04-15T00:35:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/54nd60x/test&amp;diff=144989&amp;oldid=prev</id>
		<title>imported&gt;54nd60x at 05:29, 2 February 2021</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/54nd60x/test&amp;diff=144989&amp;oldid=prev"/>
		<updated>2021-02-02T05:29:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {};     --All lua modules on Wikipedia must begin by defining a variable &lt;br /&gt;
                    --that will hold their externally accessible functions.&lt;br /&gt;
                    --Such variables can have whatever name you want and may &lt;br /&gt;
                    --also contain various data as well as functions.&lt;br /&gt;
p.hello = function( frame )     --Add a function to &amp;quot;p&amp;quot;.  &lt;br /&gt;
                                        --Such functions are callable in Wikipedia&lt;br /&gt;
                                        --via the #invoke command.&lt;br /&gt;
                                        --&amp;quot;frame&amp;quot; will contain the data that Wikipedia&lt;br /&gt;
                                        --sends this function when it runs. &lt;br /&gt;
                                 -- &amp;#039;Hello&amp;#039; is a name of your choice. The same name needs to be referred to when the module is used.&lt;br /&gt;
    &lt;br /&gt;
    local str = &amp;quot;Hello World!&amp;quot;  --Declare a local variable and set it equal to&lt;br /&gt;
                                --&amp;quot;Hello World!&amp;quot;.  &lt;br /&gt;
    &lt;br /&gt;
    return str    --This tells us to quit this function and send the information in&lt;br /&gt;
                  --&amp;quot;str&amp;quot; back to Wikipedia.&lt;br /&gt;
    &lt;br /&gt;
end  -- end of the function &amp;quot;hello&amp;quot;&lt;br /&gt;
function p.keyboard(frame)		-- Add another function&lt;br /&gt;
	local name = frame.args[1]  -- To access arguments passed to a module, use `frame.args`&lt;br /&gt;
							    -- `frame.args[1]` refers to the first unnamed parameter&lt;br /&gt;
							    -- given to the module&lt;br /&gt;
	return &amp;quot;https://en.wikipedia.org/w/index.php?title=&amp;quot; .. name .. &amp;quot;&amp;amp;action=edit&amp;amp;editintro=Module:Sandbox/54nd60x/test/doc&amp;quot;  -- `..` concatenates strings. This will return a customized&lt;br /&gt;
									 -- greeting depending on the name given, such as &amp;quot;Hello, Fred!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
function p.count_fruit(frame)&lt;br /&gt;
	local num_bananas = frame.args.bananas -- Named arguments ({{#invoke:Example|count_fruit|foo=bar}}) are likewise &lt;br /&gt;
	local num_apples = frame.args.apples   -- accessed by indexing `frame.args` by name (`frame.args[&amp;quot;bananas&amp;quot;]`, or)&lt;br /&gt;
										   -- equivalently `frame.args.bananas`.&lt;br /&gt;
	return &amp;#039;I have &amp;#039; .. num_bananas .. &amp;#039; bananas and &amp;#039; .. num_apples .. &amp;#039; apples&amp;#039;&lt;br /&gt;
										   -- Like above, concatenate a bunch of strings together to produce&lt;br /&gt;
										   -- a sentence based on the arguments given.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p    --All modules end by returning the variable containing their functions to Wikipedia.&lt;br /&gt;
-- Now we can use this module by calling {{#invoke: Example | hello }},&lt;br /&gt;
-- {{#invoke: Example | hello_to | foo }}, or {{#invoke:Example|count_fruit|bananas=5|apples=6}}&lt;br /&gt;
-- Note that the first part of the invoke is the name of the Module&amp;#039;s wikipage,&lt;br /&gt;
-- and the second part is the name of one of the functions attached to the &lt;br /&gt;
-- variable that you returned.&lt;br /&gt;
&lt;br /&gt;
-- The &amp;quot;print&amp;quot; function is not allowed in Wikipedia.  All output is accomplished&lt;br /&gt;
-- via strings &amp;quot;returned&amp;quot; to Wikipedia.&lt;/div&gt;</summary>
		<author><name>imported&gt;54nd60x</name></author>
	</entry>
</feed>