<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Ascripts%2Ftemplates</id>
	<title>Module:scripts/templates - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Ascripts%2Ftemplates"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:scripts/templates&amp;action=history"/>
	<updated>2026-04-06T02:15:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:scripts/templates&amp;diff=214908&amp;oldid=prev</id>
		<title>Chrysophylax: Chrysophylax moved page Module:Scripts/templates to Module:scripts/templates without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:scripts/templates&amp;diff=214908&amp;oldid=prev"/>
		<updated>2021-01-02T05:01:02Z</updated>

		<summary type="html">&lt;p&gt;Chrysophylax moved page &lt;a href=&quot;/w/index.php?title=Module:Scripts/templates&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Module:Scripts/templates (page does not exist)&quot;&gt;Module:Scripts/templates&lt;/a&gt; to &lt;a href=&quot;/wiki/Module:scripts/templates&quot; title=&quot;Module:scripts/templates&quot;&gt;Module:scripts/templates&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:01, 2 January 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Chrysophylax</name></author>
	</entry>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:scripts/templates&amp;diff=214904&amp;oldid=prev</id>
		<title>Chrysophylax: Created page with &quot;local export = {}  function export.exists(frame) 	local args = frame.args 	local sc = args[1] or error(&quot;Script code has not been specified. Please pass parameter 1 to the modu...&quot;</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:scripts/templates&amp;diff=214904&amp;oldid=prev"/>
		<updated>2021-01-02T04:58:01Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local export = {}  function export.exists(frame) 	local args = frame.args 	local sc = args[1] or error(&amp;quot;Script code has not been specified. Please pass parameter 1 to the modu...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local export = {}&lt;br /&gt;
&lt;br /&gt;
function export.exists(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local sc = args[1] or error(&amp;quot;Script code has not been specified. Please pass parameter 1 to the module invocation.&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	sc = require(&amp;quot;Module:scripts&amp;quot;).getByCode(sc)&lt;br /&gt;
	&lt;br /&gt;
	if sc then&lt;br /&gt;
		return &amp;quot;1&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function export.getByCode(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local sc = args[1] or error(&amp;quot;Script code (parameter 1) has not been specified.&amp;quot;)&lt;br /&gt;
	local itemname = args[2] or error(&amp;quot;Function to call (parameter 2) has not been specified.&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	sc = require(&amp;quot;Module:scripts&amp;quot;).getByCode(sc) or error(&amp;quot;The script code &amp;#039;&amp;quot; .. sc .. &amp;quot;&amp;#039; is not valid.&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	-- The item that the caller wanted to look up&lt;br /&gt;
	if itemname == &amp;quot;getCanonicalName&amp;quot; then&lt;br /&gt;
		return sc:getCanonicalName()&lt;br /&gt;
	elseif itemname == &amp;quot;getOtherNames&amp;quot; then&lt;br /&gt;
		local index = args[3]; if index == &amp;quot;&amp;quot; then index = nil end&lt;br /&gt;
		index = tonumber(index or error(&amp;quot;Numeric index of the desired item in the list (parameter 3) has not been specified.&amp;quot;))&lt;br /&gt;
		return sc:getOtherNames()[index] or &amp;quot;&amp;quot;&lt;br /&gt;
	elseif itemname == &amp;quot;getCategoryName&amp;quot; then&lt;br /&gt;
		return sc:getCategoryName()&lt;br /&gt;
	elseif itemname == &amp;quot;countCharacters&amp;quot; then&lt;br /&gt;
		local text = args[3] or &amp;quot;&amp;quot;&lt;br /&gt;
		return sc:countCharacters(text)&lt;br /&gt;
	elseif sc[itemname] then&lt;br /&gt;
		local ret = sc[itemname](sc)&lt;br /&gt;
		&lt;br /&gt;
		if type(ret) == &amp;quot;string&amp;quot; then&lt;br /&gt;
			return ret&lt;br /&gt;
		else&lt;br /&gt;
			error(&amp;quot;The function \&amp;quot;&amp;quot; .. itemname .. &amp;quot;\&amp;quot; did not return a string value.&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		error(&amp;quot;Requested invalid item name \&amp;quot;&amp;quot; .. itemname .. &amp;quot;\&amp;quot;.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function export.getByCanonicalName(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local sc = args[1] or error(&amp;quot;Script name (parameter 1) has not been specified.&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	sc = require(&amp;quot;Module:scripts&amp;quot;).getByCanonicalName(sc)&lt;br /&gt;
	&lt;br /&gt;
	if sc then&lt;br /&gt;
		return sc:getCode()&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;quot;None&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function export.findBestScript(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local text = args[1] or error(&amp;quot;Text to analyse (parameter 1) has not been specified.&amp;quot;)&lt;br /&gt;
	local lang = args[2] or error(&amp;quot;Language code (parameter 2) has not been specified.&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	lang = require(&amp;quot;Module:languages&amp;quot;).getByCode(lang) or error(&amp;quot;The language code \&amp;quot;&amp;quot; .. lang .. &amp;quot;\&amp;quot; is not valid.&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	return require(&amp;quot;Module:scripts&amp;quot;).findBestScript(text, lang):getCode()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return export&lt;/div&gt;</summary>
		<author><name>Chrysophylax</name></author>
	</entry>
</feed>