<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://conductors.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ACite</id>
	<title>Module:Cite - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://conductors.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ACite"/>
	<link rel="alternate" type="text/html" href="https://conductors.wiki/index.php?title=Module:Cite&amp;action=history"/>
	<updated>2026-06-05T15:09:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://conductors.wiki/index.php?title=Module:Cite&amp;diff=275&amp;oldid=prev</id>
		<title>N.Sorokin: Created page with &quot;require (&#039;strict&#039;);  local cfg = mw.loadData (&#039;Module:Cite/config&#039;);   ----------------------------&lt; S U B S T I T U T E &gt;----------------------------------------------------------  Substitutes $1, $2, etc in &lt;message&gt; with data from &lt;data_t&gt;. Returns plain-text substituted string when &lt;data_t&gt; not nil; returns &lt;message&gt; else.    local function substitute (message, data_t) 	return data_t and mw.message.newRawMessage (message, data_t):plain() or message; end   --[[---...&quot;</title>
		<link rel="alternate" type="text/html" href="https://conductors.wiki/index.php?title=Module:Cite&amp;diff=275&amp;oldid=prev"/>
		<updated>2025-12-09T13:02:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;require (&amp;#039;strict&amp;#039;);  local cfg = mw.loadData (&amp;#039;Module:Cite/config&amp;#039;);   --[[--------------------------&amp;lt; S U B S T I T U T E &amp;gt;----------------------------------------------------------  Substitutes $1, $2, etc in &amp;lt;message&amp;gt; with data from &amp;lt;data_t&amp;gt;. Returns plain-text substituted string when &amp;lt;data_t&amp;gt; not nil; returns &amp;lt;message&amp;gt; else.  ]]  local function substitute (message, data_t) 	return data_t and mw.message.newRawMessage (message, data_t):plain() or message; end   --[[---...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require (&amp;#039;strict&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
local cfg = mw.loadData (&amp;#039;Module:Cite/config&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S U B S T I T U T E &amp;gt;----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Substitutes $1, $2, etc in &amp;lt;message&amp;gt; with data from &amp;lt;data_t&amp;gt;. Returns plain-text substituted string when&lt;br /&gt;
&amp;lt;data_t&amp;gt; not nil; returns &amp;lt;message&amp;gt; else.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function substitute (message, data_t)&lt;br /&gt;
	return data_t and mw.message.newRawMessage (message, data_t):plain() or message;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; M A K E _ E R R O R _ M S G &amp;gt;--------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Assembles an error message from module name, message text, help link, and error category.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function make_error_msg (frame, msg)&lt;br /&gt;
	local module_name = frame:getTitle();										-- get the module name for prefix and help-link label&lt;br /&gt;
	local namespace = mw.title.getCurrentTitle().namespace;						-- used for categorization&lt;br /&gt;
&lt;br /&gt;
	local category_link = (0 == namespace) and substitute (&amp;#039;[[Category:$1]]&amp;#039;, {cfg.settings_t.err_category}) or &amp;#039;&amp;#039;;&lt;br /&gt;
	return substitute (&amp;#039;&amp;lt;span style=&amp;quot;color:#d33&amp;quot;&amp;gt;Error: &amp;amp;#x7B;{[[$1|#invoke:$2]]}}: $3 ([[:$4|$5]])&amp;lt;/span&amp;gt;$6&amp;#039;,&lt;br /&gt;
		{&lt;br /&gt;
		module_name,															-- the module name with namespace&lt;br /&gt;
		module_name:gsub (&amp;#039;Module:&amp;#039;, &amp;#039;&amp;#039;),										-- the module name without namespace&lt;br /&gt;
		msg,																	-- the error message&lt;br /&gt;
		cfg.settings_t.help_text_link,											-- help wikilink to text at help page&lt;br /&gt;
		cfg.settings_t.help,													-- help wikilink display text&lt;br /&gt;
		category_link															-- link to error category (for main namespace errors only)&lt;br /&gt;
		})&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C I T E &amp;gt;---------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Function to call Module:Citation/CS1/sandbox with appropriate parameters.  For use when an article exceeds the&lt;br /&gt;
post-expand include size limit.&lt;br /&gt;
&lt;br /&gt;
	{{#invoke:cite|book|title=Title}}&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function cite (frame, template)&lt;br /&gt;
	local args_t = require (&amp;#039;Module:Arguments&amp;#039;).getArgs (frame, {frameOnly=true});&lt;br /&gt;
&lt;br /&gt;
	template = template:lower();												-- lowercase for table indexes&lt;br /&gt;
	&lt;br /&gt;
	if not cfg.known_templates_t[template] then									-- do we recognize this template name?&lt;br /&gt;
		return make_error_msg (frame, substitute (cfg.settings_t.unknown_name, {template}));	-- nope; abandon with error message&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local config_t = {[&amp;#039;CitationClass&amp;#039;] = cfg.citation_classes_t[template] or template};	-- set CitationClass value&lt;br /&gt;
	return require (&amp;#039;Module:Citation/CS1&amp;#039;)._citation (nil, args_t, config_t);	-- go render the citation&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 setmetatable({}, {__index =												-- returns an empty TABLE whose metatable has the __index set so that, for any given KEY, it returns&lt;br /&gt;
	function(_, template)														-- this anonymous function called as function(TABLE, KEY)&lt;br /&gt;
		return function (frame) return cite (frame, template) end;				-- which in turn returns a function that calls cite() with the KEY name&lt;br /&gt;
	end&lt;br /&gt;
})&lt;/div&gt;</summary>
		<author><name>N.Sorokin</name></author>
	</entry>
</feed>