
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://zoophilia.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://zoophilia.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ACite"/>
	<link rel="alternate" type="text/html" href="https://zoophilia.wiki/index.php?title=Module:Cite&amp;action=history"/>
	<updated>2026-05-07T08:24:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://zoophilia.wiki/index.php?title=Module:Cite&amp;diff=133996&amp;oldid=prev</id>
		<title>SockyPaws: Import Module:Cite from English Wikipedia</title>
		<link rel="alternate" type="text/html" href="https://zoophilia.wiki/index.php?title=Module:Cite&amp;diff=133996&amp;oldid=prev"/>
		<updated>2025-12-22T14:41:40Z</updated>

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