<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.inqubos.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=172.71.127.42</id>
	<title>Inqubos Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.inqubos.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=172.71.127.42"/>
	<link rel="alternate" type="text/html" href="https://wiki.inqubos.com/index.php?title=Special:Contributions/172.71.127.42"/>
	<updated>2026-10-24T14:23:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.inqubos.com/index.php?title=Module:Cite&amp;diff=1089</id>
		<title>Module:Cite</title>
		<link rel="alternate" type="text/html" href="https://wiki.inqubos.com/index.php?title=Module:Cite&amp;diff=1089"/>
		<updated>2025-10-08T10:36:13Z</updated>

		<summary type="html">&lt;p&gt;172.71.127.42: 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;hr /&gt;
&lt;div&gt;require (&#039;strict&#039;);&lt;br /&gt;
&lt;br /&gt;
local cfg = mw.loadData (&#039;Module:Cite/config&#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 (&#039;[[Category:$1]]&#039;, {cfg.settings_t.err_category}) or &#039;&#039;;&lt;br /&gt;
	return substitute (&#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&#039;,&lt;br /&gt;
		{&lt;br /&gt;
		module_name,															-- the module name with namespace&lt;br /&gt;
		module_name:gsub (&#039;Module:&#039;, &#039;&#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 (&#039;Module:Arguments&#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 = {[&#039;CitationClass&#039;] = cfg.citation_classes_t[template] or template};	-- set CitationClass value&lt;br /&gt;
	return require (&#039;Module:Citation/CS1&#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>172.71.127.42</name></author>
	</entry>
</feed>