<?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%2Ftrappist_the_monk%2Ftemplate_params%2Fdata</id>
	<title>Module:Sandbox/trappist the monk/template params/data - 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%2Ftrappist_the_monk%2Ftemplate_params%2Fdata"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/trappist_the_monk/template_params/data&amp;action=history"/>
	<updated>2026-08-11T11:17:26Z</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/trappist_the_monk/template_params/data&amp;diff=146636&amp;oldid=prev</id>
		<title>imported&gt;Trappist the monk at 16:18, 6 September 2022</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/trappist_the_monk/template_params/data&amp;diff=146636&amp;oldid=prev"/>
		<updated>2022-09-06T16:18:40Z</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;--[[--------------------------&amp;lt; P A R A M _ N A M E S _ G E T &amp;gt;------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
this does not work.  title_object gets the object for the page that the template is used on, not for the template&lt;br /&gt;
calling Module:Check for unknown parameters.  Bother.&lt;br /&gt;
&lt;br /&gt;
read the unparsed content of a template and create a list of all parameters used in that template page.  may be&lt;br /&gt;
useful to replace the manually curated lists of parameters given to Module:Check for unknown parameters.&lt;br /&gt;
&lt;br /&gt;
to fetch the data, use:&lt;br /&gt;
	local data.known_params_t = mw.loadData (&amp;#039;Module:Sandbox/trappist the monk/template params/data&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
local known_params_t = {};														-- associative table to hold each &amp;lt;param name&amp;gt; from any {{{&amp;lt;param name&amp;gt; that we find&lt;br /&gt;
local title;&lt;br /&gt;
&lt;br /&gt;
local function param_names_get()&lt;br /&gt;
&lt;br /&gt;
	local template_content;														-- unparsed template content goes here&lt;br /&gt;
	local title_object = mw.title.getCurrentTitle();							-- create a title object for the current title&lt;br /&gt;
&lt;br /&gt;
	title = title_object.prefixedText;&lt;br /&gt;
	if 10 == title_object.namespace then										-- must be template namespace&lt;br /&gt;
		template_content = title_object:getContent();							-- get the template&amp;#039;s raw text&lt;br /&gt;
	else&lt;br /&gt;
		template_content = mw.title.new(&amp;#039;Template:EB1911&amp;#039;):getContent() or &amp;#039;&amp;#039;;	-- for development&lt;br /&gt;
--		return known_params_t;													-- not in template namespace, return an empty table;  TODO: error message instead?&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for param in template_content:gmatch (&amp;#039;{{{([^|}]+)&amp;#039;) do&lt;br /&gt;
		known_params_t[param] = 1;												-- save it&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return known_params_t;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T S &amp;gt;----------------------------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	known_params_t = param_names_get(),&lt;br /&gt;
	title = title&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>imported&gt;Trappist the monk</name></author>
	</entry>
</feed>