Module:Citation/CS1/Whitelist: Difference between revisions
sync from sandbox;
(sync from sandbox;) |
(sync from sandbox;) |
||
Line 15: | Line 15: | ||
['access-date'] = true, | ['access-date'] = true, | ||
['agency'] = true, | ['agency'] = true, | ||
-- ['airdate'] = true, -- cite episode and cite serial only | |||
-- ['air-date'] = true, -- cite episode and cite serial only | |||
['archivedate'] = true, | ['archivedate'] = true, | ||
['archive-date'] = true, | ['archive-date'] = true, | ||
Line 68: | Line 68: | ||
['contributor-link'] = true, | ['contributor-link'] = true, | ||
['contributor-mask'] = true, | ['contributor-mask'] = true, | ||
-- ['credits'] = true, -- cite episode, cite serial | |||
['date'] = true, | ['date'] = true, | ||
['degree'] = true, | ['degree'] = true, | ||
Line 108: | Line 108: | ||
['entry-url'] = true, | ['entry-url'] = true, | ||
['entry-url-access'] = true, | ['entry-url-access'] = true, | ||
-- ['episode'] = true, -- cite serial only TODO: make available to cite episode? | |||
-- ['episodelink'] = true, -- cite episode and cite serial | |||
-- ['episode-link'] = true, -- cite episode and cite serial | |||
['eprint'] = true, -- cite arxiv | ['eprint'] = true, -- cite arxiv; here because allowed in cite ... as identifier | ||
['event'] = true, | ['event'] = true, | ||
['event-format'] = true, | ['event-format'] = true, | ||
Line 175: | Line 175: | ||
['map-url-access'] = true, -- cite map only | ['map-url-access'] = true, -- cite map only | ||
['medium'] = true, | ['medium'] = true, | ||
-- ['message-id'] = true, -- cite newsgroup | |||
['minutes'] = true, | ['minutes'] = true, | ||
['mode'] = true, | ['mode'] = true, | ||
Line 181: | Line 181: | ||
['MR'] = true, | ['MR'] = true, | ||
['name-list-format'] = true, | ['name-list-format'] = true, | ||
-- ['network'] = true, -- cite episode and cite serial only | |||
-- ['newsgroup'] = true, -- cite newsgroup | |||
['newspaper'] = true, | ['newspaper'] = true, | ||
['nocat'] = true, | ['nocat'] = true, | ||
Line 224: | Line 224: | ||
['rfc'] = true, | ['rfc'] = true, | ||
['RFC'] = true, | ['RFC'] = true, | ||
['sbn'] = true, | |||
['SBN'] = true, | |||
['scale'] = true, | ['scale'] = true, | ||
['script-article'] = true, | ['script-article'] = true, | ||
Line 257: | Line 259: | ||
['ssrn'] = true, | ['ssrn'] = true, | ||
['SSRN'] = true, | ['SSRN'] = true, | ||
-- ['station'] = true, -- cite episode and cite serial only | |||
['subject'] = true, | ['subject'] = true, | ||
['subjectlink'] = true, | ['subjectlink'] = true, | ||
['subject-link'] = true, | ['subject-link'] = true, | ||
['surname'] = true, | ['surname'] = true, | ||
['s2cid'] = true, | |||
['S2CID'] = true, | |||
['s2cid-access'] = true, | |||
['template-doc-demo'] = true, | ['template-doc-demo'] = true, | ||
['time'] = true, | ['time'] = true, | ||
Line 394: | Line 399: | ||
defined in the limited_basic_arguments and limited_numbered_arguments tables. Those lists are supplemented with a | defined in the limited_basic_arguments and limited_numbered_arguments tables. Those lists are supplemented with a | ||
template-specific list of parameters that are required by the particular template and may be exclusive to one of the | template-specific list of parameters that are required by the particular template and may be exclusive to one of the | ||
preprint templates. Some of these parameters may also be available to the general cs1|2 templates. | |||
Same conventions for true/false/nil as above. | Same conventions for true/false/nil as above. | ||
Line 400: | Line 405: | ||
]] | ]] | ||
local preprint_arguments = { | |||
arxiv = { | |||
['arxiv'] = true, -- cite arxiv and arxiv identifiers | |||
['class'] = true, -- cite arxiv only | |||
local | ['eprint'] = true, -- cite arxiv and arxiv identifiers | ||
['arxiv'] = true, | }, | ||
biorxiv = { | |||
['biorxiv'] = true, | |||
} | }, | ||
citeseerx = { | |||
['citeseerx'] = true, | |||
}, | |||
ssrn = { | |||
['ssrn'] = true, | |||
['SSRN'] = true, | |||
}, | |||
} | |||
} | |||
} | |||
} | |||
Line 511: | Line 496: | ||
['last#'] = true, | ['last#'] = true, | ||
['surname#'] = true, | ['surname#'] = true, | ||
} | } | ||
--[[--------------------------< U N I Q U E _ A R G U M E N T S >---------------------------------------------- | |||
some templates have unique parameters. Those templates and their unique parameters are listed here. Keys in this | |||
table are the template's CitationClass parameter value | |||
Same conventions for true/false/nil as above. | |||
]] | |||
local unique_arguments = { | |||
episode = { | |||
['airdate'] = true, | |||
['air-date'] = true, | |||
['credits'] = true, | |||
['episodelink'] = true, -- aliases of |title-link= | |||
['episode-link'] = true, | |||
['network'] = true, | |||
['station'] = true, | |||
}, | |||
newsgroup = { | |||
['message-id'] = true, | |||
['newsgroup'] = true, | |||
}, | |||
serial = { | |||
['airdate'] = true, | |||
['air-date'] = true, | |||
['credits'] = true, | |||
['episode'] = true, -- cite serial only TODO: make available to cite episode? | |||
['episodelink'] = true, -- aliases of |title-link= | |||
['episode-link'] = true, | |||
['network'] = true, | |||
['station'] = true, | |||
}, | |||
} | |||
--[[--------------------------< T E M P L A T E _ L I S T _ G E T >-------------------------------------------- | |||
gets a list of the templates from table t | |||
]] | |||
local function template_list_get (t) | |||
local out = {}; -- a table for output | |||
for k, _ in pairs (t) do -- spin through the table and collect the keys | |||
table.insert (out, k) -- add each key to the output table | |||
end | |||
return out; -- and done | |||
end | |||
Line 522: | Line 558: | ||
limited_basic_arguments = limited_basic_arguments, | limited_basic_arguments = limited_basic_arguments, | ||
limited_numbered_arguments = limited_numbered_arguments, | limited_numbered_arguments = limited_numbered_arguments, | ||
preprint_arguments = preprint_arguments, | |||
preprint_template_list = template_list_get (preprint_arguments), -- make a template list from preprint_arguments{} table | |||
unique_arguments = unique_arguments, | |||
unique_param_template_list = template_list_get (unique_arguments), -- make a template list from unique_arguments{} table | |||
}; | }; |