<?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%3AEditing_advice</id>
	<title>Module:Editing advice - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AEditing_advice"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Editing_advice&amp;action=history"/>
	<updated>2026-05-24T11:49:22Z</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:Editing_advice&amp;diff=136039&amp;oldid=prev</id>
		<title>imported&gt;Fred Gandt: use mw.getCurrentFrame()</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Editing_advice&amp;diff=136039&amp;oldid=prev"/>
		<updated>2016-03-30T06:39:16Z</updated>

		<summary type="html">&lt;p&gt;use mw.getCurrentFrame()&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Fetch expansions of Editing advice meta templates&lt;br /&gt;
local function getRequestedAdvice(haystack, needle, pages)&lt;br /&gt;
	-- if a request is made for that advice&lt;br /&gt;
	if string.match(haystack, needle) then&lt;br /&gt;
		return mw.getCurrentFrame():expandTemplate{&lt;br /&gt;
					title = &amp;#039;Editing advice/meta/&amp;#039; .. needle,&lt;br /&gt;
					args = pages or {}&lt;br /&gt;
			   }&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Return concatenation of fetched template expansions&lt;br /&gt;
local function compileRequestedAdvice(about, pages)&lt;br /&gt;
	return getRequestedAdvice(about, &amp;#039;preview&amp;#039;, pages) ..&lt;br /&gt;
		   getRequestedAdvice(about, &amp;#039;summary&amp;#039;) ..&lt;br /&gt;
		   getRequestedAdvice(about, &amp;#039;sandbox&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ Main function: iterates through provided params and uses&lt;br /&gt;
		what is discovered to call for and organise the requested output ]]&lt;br /&gt;
function p._getAdvice(cleanargs)&lt;br /&gt;
	-- Create capturing vars for data&lt;br /&gt;
	local about = &amp;#039;&amp;#039;&lt;br /&gt;
	local pages = {}&lt;br /&gt;
	local section = {}&lt;br /&gt;
	local f = mw.getCurrentFrame()&lt;br /&gt;
	-- Iterate through provided params&lt;br /&gt;
	for key, value in pairs(cleanargs) do&lt;br /&gt;
		-- If the param specifies the advice requested&lt;br /&gt;
		if key == &amp;#039;about&amp;#039; then&lt;br /&gt;
			-- store the value&lt;br /&gt;
			about = value&lt;br /&gt;
		-- If the param specifies the section heading option&lt;br /&gt;
		elseif key == &amp;#039;section&amp;#039; then&lt;br /&gt;
			-- store the value&lt;br /&gt;
			section[1] = value&lt;br /&gt;
		else&lt;br /&gt;
		--[[ If neither of the above, these params must be pages&lt;br /&gt;
				 so store the values as they are processed ]]&lt;br /&gt;
			pages[#pages + 1] = value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Output concatenation of fetched strings&lt;br /&gt;
	return f:expandTemplate{&lt;br /&gt;
				title = &amp;#039;Editing advice/meta/start&amp;#039;,&lt;br /&gt;
				args = section&lt;br /&gt;
		   } ..&lt;br /&gt;
		   compileRequestedAdvice(about, pages) ..&lt;br /&gt;
		   f:expandTemplate{&lt;br /&gt;
				title = &amp;#039;Editing advice/meta/end&amp;#039;&lt;br /&gt;
		   }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Get and cleanup frame args and pass them to _getAdvice&lt;br /&gt;
function p.getAdvice(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._getAdvice(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Fred Gandt</name></author>
	</entry>
</feed>