<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.tcsdcc.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACitation</id>
	<title>Module:Citation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://docs.tcsdcc.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACitation"/>
	<link rel="alternate" type="text/html" href="https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;action=history"/>
	<updated>2026-04-04T02:41:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.4</generator>
	<entry>
		<id>https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;diff=3968&amp;oldid=prev</id>
		<title>Tcsdcc: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;diff=3968&amp;oldid=prev"/>
		<updated>2019-12-16T16:09:44Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&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 16:09, 16 December 2019&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>Tcsdcc</name></author>
	</entry>
	<entry>
		<id>https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;diff=3967&amp;oldid=prev</id>
		<title>mwmain&gt;Pppery: Rm unreachable code</title>
		<link rel="alternate" type="text/html" href="https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;diff=3967&amp;oldid=prev"/>
		<updated>2018-05-21T11:38:53Z</updated>

		<summary type="html">&lt;p&gt;Rm unreachable code&lt;/p&gt;
&lt;a href=&quot;https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;amp;diff=3967&amp;amp;oldid=5&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>mwmain&gt;Pppery</name></author>
	</entry>
	<entry>
		<id>https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;diff=5&amp;oldid=prev</id>
		<title>Tcsdcc: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;diff=5&amp;oldid=prev"/>
		<updated>2018-04-24T16:47:01Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&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 16:47, 24 April 2018&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>Tcsdcc</name></author>
	</entry>
	<entry>
		<id>https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;diff=4&amp;oldid=prev</id>
		<title>2600:1700:EDB0:A060:14D0:1D18:969:4211: always use https; follow Template:Doi</title>
		<link rel="alternate" type="text/html" href="https://docs.tcsdcc.com/index.php?title=Module:Citation&amp;diff=4&amp;oldid=prev"/>
		<updated>2018-03-24T09:20:35Z</updated>

		<summary type="html">&lt;p&gt;always use https; follow &lt;a href=&quot;/index.php?title=Template:Doi&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Template:Doi (page does not exist)&quot;&gt;Template:Doi&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;---------------------------------------------------------------------&lt;br /&gt;
-- Module:Citation - Lua module for Citation auxiliary templates&lt;br /&gt;
---------------------------------------------------------------------&lt;br /&gt;
-- For the {{citation}} formatting functions, see: Module:Citation/CS1&lt;br /&gt;
--                               (see NOTES at bottom)&lt;br /&gt;
--require &amp;quot;mw.text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local z = {&lt;br /&gt;
    wikitext = require(&amp;quot;Module:Wikitext&amp;quot;),&lt;br /&gt;
    extensiontags = {&lt;br /&gt;
        nowiki = true,&lt;br /&gt;
        ref = true,&lt;br /&gt;
        gallery = true,&lt;br /&gt;
        pre = true,&lt;br /&gt;
        source = true,&lt;br /&gt;
        categorytree = true,&lt;br /&gt;
        charinsert = true,&lt;br /&gt;
        hiero = true,&lt;br /&gt;
        imagemap = true,&lt;br /&gt;
        inputbox = true,&lt;br /&gt;
        math = true,&lt;br /&gt;
        poem = true,&lt;br /&gt;
        ref = true,&lt;br /&gt;
        references = true,&lt;br /&gt;
        syntaxhighlight = true,&lt;br /&gt;
        timeline = true,&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function trim( str )&lt;br /&gt;
    if str == nil then&lt;br /&gt;
        return nil;&lt;br /&gt;
    end&lt;br /&gt;
    return str:match( &amp;quot;^%s*(.-)%s*$&amp;quot; );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function hideinprint(content)&lt;br /&gt;
    return content&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function onlyinprint(content)&lt;br /&gt;
    return &amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This returns a string with HTML character entities for wikitext markup characters.&lt;br /&gt;
function wikiescape(text)&lt;br /&gt;
    text = text:gsub( '[&amp;amp;\'%[%]{|}]', {    &lt;br /&gt;
            ['&amp;amp;'] = '&amp;amp;#38;',    &lt;br /&gt;
            [&amp;quot;'&amp;quot;] = '&amp;amp;#39;',    &lt;br /&gt;
            ['['] = '&amp;amp;#91;',    &lt;br /&gt;
            [']'] = '&amp;amp;#93;',	&lt;br /&gt;
            ['{'] = '&amp;amp;#123;',	&lt;br /&gt;
            ['|'] = '&amp;amp;#124;',	&lt;br /&gt;
            ['}'] = '&amp;amp;#125;' } );&lt;br /&gt;
    return text;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function createTag(t, frame)&lt;br /&gt;
    local name = t.name or &amp;quot;!-- --&amp;quot;&lt;br /&gt;
    local content = t.contents or &amp;quot;&amp;quot;&lt;br /&gt;
    local attrs = {}&lt;br /&gt;
    if ( z.extensiontags[name] ) then&lt;br /&gt;
        -- We have to preprocess these, so that they are properly turned into so-called &amp;quot;strip markers&amp;quot; in the generated wikitext.&lt;br /&gt;
        if ( not frame ) then error (&amp;quot;Please supply an extra frame argument to the createTag() function.&amp;quot;) end&lt;br /&gt;
        local params = {}&lt;br /&gt;
        for n,v in pairs(t.params) do&lt;br /&gt;
            table.insert(params, &amp;quot;|&amp;quot; .. n .. &amp;quot;=&amp;quot; .. v)&lt;br /&gt;
        end&lt;br /&gt;
        return frame:preprocess(&amp;quot;{{#tag:&amp;quot; .. name .. &amp;quot;|&amp;quot; .. content .. table.concat(params) .. &amp;quot;}}&amp;quot;)&lt;br /&gt;
    else   &lt;br /&gt;
        for n,v in pairs(t.params) do&lt;br /&gt;
            if (v) then&lt;br /&gt;
                table.insert(attrs, n .. &amp;quot;=\&amp;quot;&amp;quot; .. wikiescape(v) .. &amp;quot;\&amp;quot;&amp;quot;)&lt;br /&gt;
            else&lt;br /&gt;
                table.insert(attrs, n)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if (&amp;quot;&amp;quot; == content) then&lt;br /&gt;
            return &amp;quot;&amp;lt;&amp;quot; .. name .. &amp;quot; &amp;quot; .. table.concat(attrs, &amp;quot; &amp;quot;) .. &amp;quot;/&amp;gt;&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
            return &amp;quot;&amp;lt;&amp;quot; .. name .. &amp;quot; &amp;quot; .. table.concat(attrs, &amp;quot; &amp;quot;) .. &amp;quot;&amp;gt;&amp;quot; .. content .. &amp;quot;&amp;lt;/&amp;quot; .. name .. &amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
This is a clone of mw.text.nowiki.  When the mw.text library is installed,&lt;br /&gt;
this can be replaced by a call to that library. ]]&lt;br /&gt;
function nowiki( s )&lt;br /&gt;
    -- string.gsub is safe here, because we're only caring about ASCII chars&lt;br /&gt;
    s = string.gsub( s, '[&amp;quot;&amp;amp;\'&amp;lt;=&amp;gt;%[%]{|}]', {&lt;br /&gt;
        ['&amp;quot;'] = '&amp;amp;#34;',&lt;br /&gt;
        ['&amp;amp;'] = '&amp;amp;#38;',&lt;br /&gt;
        [&amp;quot;'&amp;quot;] = '&amp;amp;#39;',&lt;br /&gt;
        ['&amp;lt;'] = '&amp;amp;#60;',&lt;br /&gt;
        ['='] = '&amp;amp;#61;',&lt;br /&gt;
        ['&amp;gt;'] = '&amp;amp;#62;',&lt;br /&gt;
        ['['] = '&amp;amp;#91;',&lt;br /&gt;
        [']'] = '&amp;amp;#93;',&lt;br /&gt;
        ['{'] = '&amp;amp;#123;',&lt;br /&gt;
        ['|'] = '&amp;amp;#124;',&lt;br /&gt;
        ['}'] = '&amp;amp;#125;',&lt;br /&gt;
    } )&lt;br /&gt;
    s = string.sub( string.gsub( '\n' .. s, '\n[#*:;]', {&lt;br /&gt;
        [&amp;quot;\n#&amp;quot;] = &amp;quot;\n&amp;amp;#35;&amp;quot;,&lt;br /&gt;
        [&amp;quot;\n*&amp;quot;] = &amp;quot;\n&amp;amp;#42;&amp;quot;,&lt;br /&gt;
        [&amp;quot;\n:&amp;quot;] = &amp;quot;\n&amp;amp;#58;&amp;quot;,&lt;br /&gt;
        [&amp;quot;\n;&amp;quot;] = &amp;quot;\n&amp;amp;#59;&amp;quot;,&lt;br /&gt;
    } ), 2 )&lt;br /&gt;
    s = string.gsub( s, '://', '&amp;amp;#58;//' )&lt;br /&gt;
    s = string.gsub( s, 'ISBN ', 'ISBN&amp;amp;#32;' )&lt;br /&gt;
    s = string.gsub( s, 'RFC ', 'RFC&amp;amp;#32;' )&lt;br /&gt;
&lt;br /&gt;
    return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function externallinkid(args)&lt;br /&gt;
    local sep = args.separator or &amp;quot;&amp;amp;nbsp;&amp;quot;&lt;br /&gt;
    args.suffix = args.suffix or &amp;quot;&amp;quot;&lt;br /&gt;
    local url_string = args.id&lt;br /&gt;
    if args.encode == true or args.encode == nil then&lt;br /&gt;
        url_string = mw.uri.encode( url_string );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local t0 = onlyinprint(args.label .. sep .. args.id)&lt;br /&gt;
    local t1 = hideinprint(&amp;quot;[[&amp;quot; .. args.link .. &amp;quot;|&amp;quot; .. args.label .. &amp;quot;]]&amp;quot; .. sep .. &amp;quot;[&amp;quot; .. args.prefix .. url_string .. args.suffix .. &amp;quot; &amp;quot; .. nowiki(args.id) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
    return t0 .. t1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function doi(id, inactive, nocat)&lt;br /&gt;
    local cat = &amp;quot;&amp;quot;&lt;br /&gt;
    local text;&lt;br /&gt;
    if ( inactive ~= nil ) then &lt;br /&gt;
        text = &amp;quot;[[Digital object identifier|doi]]:&amp;quot; .. id;&lt;br /&gt;
        cat = cat .. &amp;quot;[[Category:Pages with DOIs inactive since &amp;quot; .. selectyear(inactive) .. &amp;quot;]]&amp;quot;&lt;br /&gt;
        inactive = &amp;quot; (inactive &amp;quot; .. inactive .. &amp;quot;)&amp;quot; &lt;br /&gt;
    else &lt;br /&gt;
        text = externallinkid({link=&amp;quot;Digital object identifier&amp;quot;,label=&amp;quot;doi&amp;quot;,prefix=&amp;quot;https://doi.org/&amp;quot;,id=id,separator=&amp;quot;:&amp;quot;})&lt;br /&gt;
        inactive = &amp;quot;&amp;quot; &lt;br /&gt;
    end&lt;br /&gt;
    if ( string.sub(id,1,3) ~= &amp;quot;10.&amp;quot; ) then&lt;br /&gt;
        cat = cat .. &amp;quot;[[Category:Pages with DOI errors]]&amp;quot; .. '&amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt; Bad DOI (expected &amp;quot;10.&amp;quot; prefix) in code number&amp;lt;/span&amp;gt;'&lt;br /&gt;
    end&lt;br /&gt;
    if ( nocat and nocat ~= &amp;quot;&amp;quot; ) then cat = &amp;quot;&amp;quot; end&lt;br /&gt;
    return text .. inactive .. cat    &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function selectyear( str )&lt;br /&gt;
    local lang = mw.getContentLanguage();&lt;br /&gt;
    local good, result;&lt;br /&gt;
    good, result = pcall( lang.formatDate, lang, 'Y', str )&lt;br /&gt;
    if good then &lt;br /&gt;
        return result;&lt;br /&gt;
    else&lt;br /&gt;
        return '';&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function anchorid(label, args)&lt;br /&gt;
    local P1 = trim(args[1]) or &amp;quot;&amp;quot;&lt;br /&gt;
    local P2 = trim(args[2]) or &amp;quot;&amp;quot;&lt;br /&gt;
    local P3 = trim(args[3]) or &amp;quot;&amp;quot;&lt;br /&gt;
    local P4 = trim(args[4]) or &amp;quot;&amp;quot;&lt;br /&gt;
    local P5 = trim(args[5]) or &amp;quot;&amp;quot;&lt;br /&gt;
    local anchor = P1 .. P2 .. P3 .. P4 .. P5;&lt;br /&gt;
    if anchor ~= '' then  -- See bug description in Citation/CS1&lt;br /&gt;
        anchor = mw.uri.anchorEncode( anchor );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return label .. anchor&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function refid(label, args)&lt;br /&gt;
    local p = args.p or &amp;quot;&amp;quot;&lt;br /&gt;
    local pp = args.pp or &amp;quot;&amp;quot;&lt;br /&gt;
    local loc = args.loc or &amp;quot;&amp;quot;&lt;br /&gt;
    return anchorid(label, args) .. p .. pp .. loc    &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function name(args)&lt;br /&gt;
    local P1 = trim(args[1]) or &amp;quot;&amp;quot;&lt;br /&gt;
    if ( args[5] ~= nil) then&lt;br /&gt;
        return P1 .. &amp;quot; et al.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        local P2 = trim(args[2]) or &amp;quot;&amp;quot;&lt;br /&gt;
        local P3 = trim(args[3]) or &amp;quot;&amp;quot; &lt;br /&gt;
        local P4 = trim(args[4]) or &amp;quot;&amp;quot;&lt;br /&gt;
        if ( args[4] ~= nil ) then&lt;br /&gt;
            P4 = &amp;quot; &amp;quot; .. P4&lt;br /&gt;
            P3 = &amp;quot; &amp;amp;amp; &amp;quot; .. P3&lt;br /&gt;
            P2 = &amp;quot;, &amp;quot; .. P2&lt;br /&gt;
        elseif ( args[3] ~= nil ) then&lt;br /&gt;
            P3 = &amp;quot; &amp;quot; .. P3&lt;br /&gt;
            P2 = &amp;quot; &amp;amp;amp; &amp;quot; .. P2&lt;br /&gt;
        elseif ( args[2] ~= nil ) then&lt;br /&gt;
            P2 = &amp;quot; &amp;quot; .. P2            &lt;br /&gt;
        end&lt;br /&gt;
        return P1 .. P2 .. P3 .. P4&lt;br /&gt;
    end &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function crossref(frame, label, args)&lt;br /&gt;
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
    local LB = config.BracketLeft or &amp;quot;&amp;quot;&lt;br /&gt;
    local RB = config.BracketRight or &amp;quot;&amp;quot;&lt;br /&gt;
    local anchor = args.ref or args.Ref or anchorid( label, args)&lt;br /&gt;
    local text = name(args)&lt;br /&gt;
    local loc = args.loc&lt;br /&gt;
    local page&lt;br /&gt;
    local pages = args.pp or args.pages&lt;br /&gt;
    if pages == nil or pages == '' then&lt;br /&gt;
        page = args.p or args.page;&lt;br /&gt;
    end &lt;br /&gt;
    if nil == loc then loc = &amp;quot;&amp;quot; else loc = &amp;quot; &amp;quot; .. loc end&lt;br /&gt;
    if ( page ~= nil ) then&lt;br /&gt;
        local pagesep = config.PageSep or &amp;quot;, p.&amp;amp;nbsp;&amp;quot;&lt;br /&gt;
        loc = loc .. pagesep .. page&lt;br /&gt;
    end&lt;br /&gt;
    if ( pages ~= nil ) then&lt;br /&gt;
        local pagessep = config.PagesSep or &amp;quot;, pp.&amp;amp;nbsp;&amp;quot;&lt;br /&gt;
        loc = loc .. pagessep .. pages&lt;br /&gt;
    end        &lt;br /&gt;
    local pagename = args.pagename or &amp;quot;&amp;quot;&lt;br /&gt;
    local ps = args.Postscript or &amp;quot;&amp;quot;&lt;br /&gt;
    return LB .. &amp;quot;[[&amp;quot; .. pagename .. &amp;quot;#&amp;quot; .. anchor .. &amp;quot;|&amp;quot; .. text .. &amp;quot;]]&amp;quot; .. loc .. RB .. ps&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function r0(frame, name, group, page)&lt;br /&gt;
    if ( name == nil ) then return &amp;quot;&amp;quot; end&lt;br /&gt;
    if ( group == nil ) then group = &amp;quot;&amp;quot; end&lt;br /&gt;
    local p = &amp;quot;&amp;quot;&lt;br /&gt;
    if ( page ~= nil ) then &lt;br /&gt;
        local contents = &amp;quot;:&amp;quot; .. page&lt;br /&gt;
        p = createTag({name=&amp;quot;sup&amp;quot;,contents=contents,params={class=&amp;quot;reference&amp;quot;,style=&amp;quot;white-space:nowrap;&amp;quot;}}) &lt;br /&gt;
    end&lt;br /&gt;
    return createTag({name=&amp;quot;ref&amp;quot;,contents=&amp;quot;&amp;quot;,params={name=name,group=group}}, frame) .. p&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function reflist0(frame, config, args)&lt;br /&gt;
    local contents = args.refs or &amp;quot;&amp;quot;&lt;br /&gt;
    local liststyle = args.liststyle&lt;br /&gt;
    local count = args[1]&lt;br /&gt;
    local width = args.colwidth&lt;br /&gt;
    local group = args.group or config.default_group&lt;br /&gt;
    if ( nil == tonumber(count) and nil == width ) then &lt;br /&gt;
        width = count&lt;br /&gt;
        count = nil&lt;br /&gt;
    end&lt;br /&gt;
    if ( nil == liststyle ) then&lt;br /&gt;
        if ( &amp;quot;upper-alpha&amp;quot; == group or &amp;quot;lower-alpha&amp;quot; == group or &amp;quot;upper-roman&amp;quot; == group or &amp;quot;lower-roman&amp;quot; == group or &amp;quot;upper-greek&amp;quot; == group or &amp;quot;lower-greek&amp;quot; == group ) then&lt;br /&gt;
            liststyle = group&lt;br /&gt;
        else&lt;br /&gt;
            liststyle = config.default_liststyle&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    local params = {}&lt;br /&gt;
    params.class = &amp;quot;reflist&amp;quot;    &lt;br /&gt;
    params.style = z.wikitext.liststyle(liststyle)&lt;br /&gt;
    if ( nil ~= count ) then        &lt;br /&gt;
        params.class = params.class .. &amp;quot; references-column-count references-column-count-&amp;quot; .. count&lt;br /&gt;
        params.style = params.style .. &amp;quot; &amp;quot; .. z.wikitext.columncountstyle(count)&lt;br /&gt;
    end    &lt;br /&gt;
    if ( nil ~= width ) then&lt;br /&gt;
        params.class = params.class .. &amp;quot; references-column-width&amp;quot;&lt;br /&gt;
        params.style = params.style .. &amp;quot; &amp;quot; .. z.wikitext.columnwidthstyle(width)&lt;br /&gt;
    end&lt;br /&gt;
    local references = createTag({name=&amp;quot;references&amp;quot;,contents=contents,params={group=group}}, frame)&lt;br /&gt;
    return createTag({name=&amp;quot;div&amp;quot;,contents=references,params=params})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function refbegin0(frame, config, args)&lt;br /&gt;
    local liststyle = args.liststyle&lt;br /&gt;
    local indent = args.indent&lt;br /&gt;
    local indentsize = args.indentsize&lt;br /&gt;
    local count = args[1]&lt;br /&gt;
    local width = args.colwidth&lt;br /&gt;
    if ( nil == tonumber(count) and nil == width ) then &lt;br /&gt;
        width = count&lt;br /&gt;
        count = nil&lt;br /&gt;
    end&lt;br /&gt;
    if ( nil == liststyle ) then&lt;br /&gt;
        if ( &amp;quot;upper-alpha&amp;quot; == group or &amp;quot;lower-alpha&amp;quot; == group or &amp;quot;upper-roman&amp;quot; == group or &amp;quot;lower-roman&amp;quot; == group or &amp;quot;upper-greek&amp;quot; == group or &amp;quot;lower-greek&amp;quot; == group ) then&lt;br /&gt;
            liststyle = group&lt;br /&gt;
        else&lt;br /&gt;
            liststyle = config.default_liststyle&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    local params = {}&lt;br /&gt;
    params.class = &amp;quot;refbegin&amp;quot;&lt;br /&gt;
    params.style = z.wikitext.liststyle(liststyle)&lt;br /&gt;
    if ( nil ~= count ) then        &lt;br /&gt;
        params.class = params.class .. &amp;quot; references-column-count references-column-count-&amp;quot; .. count&lt;br /&gt;
        params.style = params.style .. &amp;quot; &amp;quot; .. z.wikitext.columncountstyle(count)&lt;br /&gt;
    end    &lt;br /&gt;
    if ( nil ~= width ) then&lt;br /&gt;
        params.class = params.class .. &amp;quot; references-column-width&amp;quot;&lt;br /&gt;
        params.style = params.style .. &amp;quot; &amp;quot; .. z.wikitext.columnwidthstyle(width)&lt;br /&gt;
    end&lt;br /&gt;
    local dlopen&lt;br /&gt;
    if ( nil ~= indent ) then&lt;br /&gt;
        dlopen = z.wikitext.OpenHTMLTag({name=&amp;quot;dl&amp;quot;,params={style=&amp;quot;text-indent: -&amp;quot; .. (indentsize or &amp;quot;3.2&amp;quot;) .. &amp;quot;em;&amp;quot;}})&lt;br /&gt;
    else&lt;br /&gt;
        dlopen = &amp;quot;&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return z.wikitext.OpenHTMLTag({name=&amp;quot;div&amp;quot;,params=params}) .. dlopen&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function refend0(frame, config, args)&lt;br /&gt;
    local indent = args.indent&lt;br /&gt;
    local dlclose&lt;br /&gt;
    if ( nil ~= indent ) then&lt;br /&gt;
        dlclose = &amp;quot;&amp;lt;/dl&amp;gt;&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        dlclose = &amp;quot;&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return dlclose .. &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by {{doi}} to create DOI links in the style used in citations.&lt;br /&gt;
function z.doi(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local id = pframe.args.id or pframe.args[1] or &amp;quot;&amp;quot;&lt;br /&gt;
    return doi(id)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by {{ISSN}} to create ISSN links in the style used in citations.&lt;br /&gt;
function z.ISSN(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local Name = pframe.args[1] or &amp;quot;&amp;quot;&lt;br /&gt;
    return hideinprint(&amp;quot;[[International Standard Serial Number|ISSN]]&amp;amp;nbsp;[https://www.worldcat.org/search?fq=x0:jrnl&amp;amp;q=n2:&amp;quot; .. Name .. &amp;quot; &amp;quot; .. Name .. &amp;quot;]&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by templates such as {{SfnRef}} to create the (encoded) anchor name for a Harvard cross-reference hyperlink.&lt;br /&gt;
function z.SFNID(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    return anchorid('FOOTNOTE', pframe.args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by templates such as {{Harvard citation}} to create the Harvard cross-reference text.&lt;br /&gt;
function z.Harvard(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    return crossref(frame, pframe.args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by templates such as {{sfn}} to create the entire cross-reference.&lt;br /&gt;
function z.sfn(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    pframe.args.Postscript = pframe.args.postscript or pframe.args.ps or &amp;quot;.&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    local content = crossref(frame, 'CITEREF', pframe.args)&lt;br /&gt;
    local args = { name = refid( 'FOOTNOTE', pframe.args) }&lt;br /&gt;
    return createTag({name = &amp;quot;ref&amp;quot;, contents = content, params = args}, frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by template {{r}}.&lt;br /&gt;
function z.r(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
    local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template&lt;br /&gt;
    args.page1 = args.page1 or args.page&lt;br /&gt;
    local text = &amp;quot;&amp;quot;&lt;br /&gt;
    -- This would be shorter using ipairs(), but that doesn't work on an arguments table supplied to a template.&lt;br /&gt;
    local index = 1&lt;br /&gt;
    while args[index] ~= nil do&lt;br /&gt;
        local arg = args[index]&lt;br /&gt;
        local t = r0(frame, arg, args.group, args[&amp;quot;page&amp;quot; .. index])&lt;br /&gt;
        text = text .. t&lt;br /&gt;
        index = index + 1&lt;br /&gt;
    end&lt;br /&gt;
    return text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by template {{ref label}}.&lt;br /&gt;
function z.reflabel(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
    local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template&lt;br /&gt;
    local P1 = args[1] or &amp;quot;&amp;quot;&lt;br /&gt;
    local P2 = args[2] or &amp;quot;&amp;quot;&lt;br /&gt;
    local P3 = args[3] or &amp;quot;&amp;quot;&lt;br /&gt;
    local id = nil&lt;br /&gt;
    local contents = &amp;quot;[[#endnote_&amp;quot; .. P1 .. P3 .. &amp;quot;|&amp;amp;#91;&amp;quot; .. P2 .. &amp;quot;&amp;amp;#93;]]&amp;quot;&lt;br /&gt;
    local params = {}&lt;br /&gt;
    params.class=&amp;quot;reference&amp;quot;&lt;br /&gt;
    if ( args.noid == nil or args.noid == &amp;quot;&amp;quot; ) then params.id = &amp;quot;ref_&amp;quot; .. P1 .. P3 end&lt;br /&gt;
    return createTag({name=&amp;quot;sup&amp;quot;,contents=contents,params=params})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by template {{note label}}.&lt;br /&gt;
function z.notelabel(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
    local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template&lt;br /&gt;
    local id = args[1] or &amp;quot;&amp;quot;&lt;br /&gt;
    local arrow = args[3] or &amp;quot;&amp;quot;&lt;br /&gt;
    local postscript = args[4] or &amp;quot;&amp;quot;&lt;br /&gt;
    local contents &lt;br /&gt;
    if arrow ~= &amp;quot;&amp;quot; then&lt;br /&gt;
        local sup_arrow = createTag({name=&amp;quot;sup&amp;quot;,contents=arrow,params={}})&lt;br /&gt;
        contents = &amp;quot;[[#ref_&amp;quot; .. id .. arrow .. &amp;quot;|&amp;lt;b&amp;gt;&amp;quot; .. sup_arrow .. &amp;quot;&amp;lt;/b&amp;gt;]]&amp;quot; .. postscript&lt;br /&gt;
        if &amp;quot;none&amp;quot; == arrow then arrow = &amp;quot;^&amp;quot; end -- Change this AFTER using it in the ID parameter and the contents.&lt;br /&gt;
    else&lt;br /&gt;
        contents = (args[2] or &amp;quot;&amp;quot;) .. postscript&lt;br /&gt;
    end&lt;br /&gt;
    local params = { class=&amp;quot;citation wikicite&amp;quot; }&lt;br /&gt;
    if id ~= &amp;quot;&amp;quot; and ( args.noid == nil or args.noid == &amp;quot;&amp;quot; ) then &lt;br /&gt;
        params.id = mw.uri.anchorEncode(&amp;quot;endnote_&amp;quot; .. id .. arrow)&lt;br /&gt;
    end&lt;br /&gt;
    return createTag({name=&amp;quot;span&amp;quot;,contents=contents,params=params})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by templates {{reflist}} and {{notelist}}.&lt;br /&gt;
function z.reflist(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
    local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template&lt;br /&gt;
    return reflist0(frame, config, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by template {{refbegin}}.&lt;br /&gt;
function z.refbegin(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
    local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template&lt;br /&gt;
    return refbegin0(frame, config, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by template {{refend}}.&lt;br /&gt;
function z.refend(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
    local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template&lt;br /&gt;
    return refend0(frame, config, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by template {{efn}}.&lt;br /&gt;
function z.efn(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself&lt;br /&gt;
    local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template&lt;br /&gt;
    return createTag({name=&amp;quot;ref&amp;quot;,contents=(args[1] or &amp;quot;&amp;quot;),params={name=args.name,group=config.default_group}}, frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return z&lt;br /&gt;
---------------------------------------------------------------------&lt;br /&gt;
--NOTES&lt;br /&gt;
--&lt;br /&gt;
-- NOTE A1: This Lua module was originally designed to handle a mix&lt;br /&gt;
--      of citation styles, crossing Vancouver style with Wikipedia's&lt;br /&gt;
--      local Citation Style 1 (CS1) from {Template:Citation/core}.&lt;br /&gt;
--      However, the conflicting positions of parameters, scattered&lt;br /&gt;
--      in twisted locations across this module, led to a separate&lt;br /&gt;
--      variation just to untangle the CS1 format of citations.&lt;br /&gt;
--&lt;br /&gt;
-- NOTE D2: The placement of dots and other separators between the&lt;br /&gt;
--      displayed parameters has been a continual headache, to keep&lt;br /&gt;
--      coordinated with the data in parentheses &amp;quot;(data)&amp;quot;. There&lt;br /&gt;
--      has been a need to pre-check for the existence of related&lt;br /&gt;
--      options, to keep from putting double-dots &amp;quot;..&amp;quot; in some cases.&lt;br /&gt;
--      In particular, the omission of the &amp;quot;title=&amp;quot; parameter has led&lt;br /&gt;
--      to several cases of a spurious dot &amp;quot;. .&amp;quot; because the original&lt;br /&gt;
--      design had treated the title as a mandatory parameter.&lt;br /&gt;
--&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
--HISTORY:&lt;br /&gt;
--18Oct2012 Fixed lead-space in Chapter by omitting &amp;quot; &amp;quot;.&lt;br /&gt;
--18Oct2012 Fixed lead-space in Chapter/Title as end &amp;quot; &amp;quot; of Authors/Date/...&lt;br /&gt;
--19Oct2012 Put HISTORY comments to log major changes (not typos).&lt;br /&gt;
--19Oct2012 Fixed extra dot &amp;quot;..&amp;quot; in Title by omitting at end of &amp;quot;tcommon=...&amp;quot;.&lt;br /&gt;
--19Oct2012 For pages, put &amp;amp;nbsp in &amp;quot;p.&amp;amp;nbsp;&amp;quot; etc.&lt;br /&gt;
--19Oct2012 Enhanced &amp;quot;pages=&amp;quot; to detect lone page as &amp;quot;p.&amp;quot; else &amp;quot;pp.&amp;quot; prefix.&lt;br /&gt;
--19Oct2012 Fixed to show &amp;quot;.&amp;quot; after Periodical name (work, newspaper...).&lt;br /&gt;
--19Oct2012 Fixed web-link to have spaces &amp;quot;[...  Archived] from the original&amp;quot;.&lt;br /&gt;
--19Oct2012 Fixed to show &amp;quot;;&amp;quot; between authors &amp;amp; coauthors.&lt;br /&gt;
--19Oct2012 Fixed to omit extra &amp;quot;.&amp;quot; after coauthors.&lt;br /&gt;
--20Oct2012 Fixed COinS data to not urlencode all, as &amp;quot;ctx_ver=Z39.88-2004&amp;quot;&lt;br /&gt;
--20Oct2012 Fixed COinS to not end as &amp;quot;&amp;amp;&amp;quot; but use lead &amp;quot;&amp;amp;rft...=&amp;quot; form.&lt;br /&gt;
--20Oct2012 Fixed COinS to not url.encode page's &amp;quot;rfr_id=...&amp;quot; pagename.&lt;br /&gt;
--20Oct2012 Fixed COinS data when &amp;quot;web&amp;quot; to default to rft.genre &amp;quot;book&amp;quot;.&lt;br /&gt;
--05Nov2012 Add a span wrapper even when there is no Ref parameter&lt;br /&gt;
--15Feb2013 Added Agency for &amp;quot;agency=xx&amp;quot;.&lt;br /&gt;
--19Feb2013 Put NOTES comments to explain module operation.&lt;br /&gt;
--19Feb2013 Copied as Module:Citation/CS1 to alter to match wp:CS1 form.&lt;br /&gt;
--19Feb2013 Changed OrigYear to use [__] for CS1 style.&lt;br /&gt;
--19Feb2013 Fixed to not show duplicate Publisher/Agency.&lt;br /&gt;
--19Feb2013 Moved page-number parameters to after final date.&lt;br /&gt;
--19Feb2013 Fixed to not put double-dots after title again.&lt;br /&gt;
--20Feb2013 Changed to omit dot &amp;quot;.&amp;quot; if already ends with dot.&lt;br /&gt;
--20Feb2013 If class &amp;quot;journal&amp;quot; shows Publisher after Periodical/Series.&lt;br /&gt;
--20Feb2013 Shifted Format to after Language, and Others after Volume.&lt;br /&gt;
--20Feb2013 Set AccessDate + &amp;lt;span class=&amp;quot;reference-accessdate&amp;quot;&amp;gt;&lt;br /&gt;
--20Feb2013 Fixed url when deadurl=no.&lt;br /&gt;
--20Feb2013 Added sepc for separator character between parameters.&lt;br /&gt;
--20Feb2013 Put &amp;quot;OCLC&amp;quot; for &amp;quot;Online Computer Library Center&amp;quot;.&lt;br /&gt;
--20Feb2013 Fix empty &amp;quot;authorlink=&amp;quot; as person.link ~= &amp;quot;&amp;quot;.&lt;br /&gt;
--20Feb2013 Added space after AuthorSep &amp;amp; AuthorNameSep.&lt;br /&gt;
--21Feb2013 Added args.contributor (was missing parameter).&lt;br /&gt;
--21Feb2013 Fixed EditorSep (was misspelled &amp;quot;EdithorSep&amp;quot;).&lt;br /&gt;
--21Feb2013 Set OCinSdata.rft_val_fmt = &amp;quot;info:ofi/fmt:kev:mtx:book&amp;quot;&lt;br /&gt;
--21Feb2013 Checked to omit blank codes (asin= | doi= etc.).&lt;br /&gt;
--21Feb2013 Set enddot to end line if not config.CitationClass &amp;quot;citation&amp;quot;.&lt;br /&gt;
--21Feb2013 Fixed to show &amp;quot;issn=x&amp;quot; as the ISSN code.&lt;br /&gt;
--21Feb2013 Fixed to show &amp;quot;id=x&amp;quot; after Zbl code.&lt;br /&gt;
--21Feb2013 Changed to omit double-dot before date when already dot.&lt;br /&gt;
--21Feb2013 Order config.CitationClass &amp;quot;citation&amp;quot;: Volume, Issue, Publisher.&lt;br /&gt;
--21Feb2013 Put warning &amp;quot;Bad DOI (expected &amp;quot;10.&amp;quot;..)&amp;quot; in DOI result.&lt;br /&gt;
--21Feb2013 Automatically unbolded volume+comma when &amp;gt; 4 long.&lt;br /&gt;
--21Feb2013 Changed to allow lowercase &amp;quot;asin-tld&amp;quot;.&lt;br /&gt;
--22Feb2013 Fixed ref=harv to extract Year from Date.&lt;br /&gt;
--22Feb2013 Set Harvard refer. span id if config.CitationClass &amp;quot;citation&amp;quot;.&lt;br /&gt;
--22Feb2013 Fixed config.CitationClass &amp;quot;citation&amp;quot; as span class=&amp;quot;citation&amp;quot;.&lt;br /&gt;
--22Feb2013 Capitalized &amp;quot;Archived/Retrieved&amp;quot; only when sepc is dot &amp;quot;.&amp;quot;.&lt;br /&gt;
--23Feb2013 Fixed author editor for &amp;quot;in&amp;quot; or &amp;quot;In&amp;quot; and put space after sepc.&lt;br /&gt;
--23Feb2013 Changed to omit dot in &amp;quot;et al.&amp;quot; when sepc is &amp;quot;.&amp;quot; separator.&lt;br /&gt;
--23Feb2013 Fixed &amp;quot;author1-first&amp;quot; to also get args.given or args.given1.&lt;br /&gt;
--23Feb2013 Fixed args.article to set Title, after Periodical is Title.&lt;br /&gt;
--23Feb2013 Fixed to allow blank Title (such as &amp;quot;contribution=mytitle&amp;quot;).&lt;br /&gt;
--23Feb2013 Fixed double-dot &amp;quot;..&amp;quot; at end of Editors list&lt;br /&gt;
--26Feb2013 Moved &amp;quot;issue=&amp;quot; data to show before &amp;quot;page=&amp;quot;.&lt;br /&gt;
--26Feb2013 Moved &amp;quot;type=&amp;quot; data to show after &amp;quot;format=&amp;quot;.&lt;br /&gt;
--26Feb2013 For &amp;quot;pmc=&amp;quot; link, omitted suffix &amp;quot;/?tool=pmcentrez&amp;quot;.&lt;br /&gt;
--27Feb2013 For coauthors, omitted extra separator after authors.&lt;br /&gt;
--27Feb2013 For date, allowed empty date to use month/day/year.&lt;br /&gt;
--27Feb2013 Fixed double-dot &amp;quot;..&amp;quot; at end of authors/coauthors list.&lt;br /&gt;
--27Feb2013 Reset editor suffix as &amp;quot;, ed.&amp;quot; when date exists.&lt;br /&gt;
--27Feb2013 Removed duplicate display of &amp;quot;others=&amp;quot; data.&lt;br /&gt;
--27Feb2013 Removed parentheses &amp;quot;( )&amp;quot; around &amp;quot;department&amp;quot; TitleNote.&lt;br /&gt;
--05Mar2013 Moved Language to follow Periodical or Series.&lt;br /&gt;
--05Mar2013 Fixed Edition to follow Series or Volume.&lt;br /&gt;
--05Mar2013 Fixed class encyclopaedia to show article as quoted Chapter.&lt;br /&gt;
--05Mar2013 Fixed class encyclopaedia to show page as &amp;quot;pp.&amp;quot; or &amp;quot;p.&amp;quot;.&lt;br /&gt;
--07Mar2013 Changed class encyclopaedia to omit &amp;quot;( )&amp;quot; around publisher.&lt;br /&gt;
--07Mar2013 Fixed end double-dot by string.sub(idcommon,-1,-1) was &amp;quot;-1,1&amp;quot;.&lt;br /&gt;
--13Mar2013 Removed enddot &amp;quot;.&amp;quot; after &amp;quot;quote=&amp;quot; parameter.&lt;br /&gt;
--13Mar2013 Changed config.CitationClass &amp;quot;news&amp;quot; to use &amp;quot;p.&amp;quot; page format.&lt;br /&gt;
--13Mar2013 Fixed missing &amp;quot;location=&amp;quot; when &amp;quot;web&amp;quot; or &amp;quot;encyclopaedia&amp;quot;.&lt;br /&gt;
--14Mar2013 Fixed end double-dot after book/work title.&lt;br /&gt;
--14Mar2013 Fixed double-dot before &amp;quot;p.&amp;quot; or &amp;quot;pp.&amp;quot; page number.&lt;br /&gt;
--14Mar2013 Fixed config.CitationClass &amp;quot;book&amp;quot; to use p./pp. page.&lt;br /&gt;
--&lt;br /&gt;
--End&lt;/div&gt;</summary>
		<author><name>2600:1700:EDB0:A060:14D0:1D18:969:4211</name></author>
	</entry>
</feed>