Module:Citation/CS1/Configuration: Difference between revisions
Continuation of Previous Edit |
m 1 revision imported: Content from Template:OSM Location map on Wikipedia |
||
| (8 intermediate revisions by 4 users not shown) | |||
| Line 19: | Line 19: | ||
local enable_sort_keys = true; -- when true module adds namespace sort keys to error and maintenance category links | local enable_sort_keys = true; -- when true module adds namespace sort keys to error and maintenance category links | ||
local suppress_archive_today_urls = true; -- when true module suppresses all parameters with an archive.today url and any deprendent parameters | |||
--[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------ | --[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------ | ||
| Line 31: | Line 32: | ||
]] | ]] | ||
uncategorized_namespaces_t = {[2]=true}; -- init with user namespace id | local uncategorized_namespaces_t = {[2]=true}; -- init with user namespace id | ||
for k, _ in pairs (mw.site.talkNamespaces) do -- add all talk namespace ids | for k, _ in pairs (mw.site.talkNamespaces) do -- add all talk namespace ids | ||
uncategorized_namespaces_t[k] = true; | uncategorized_namespaces_t[k] = true; | ||
| Line 69: | Line 70: | ||
['archived-dead'] = 'Archived from $1 on $2', | ['archived-dead'] = 'Archived from $1 on $2', | ||
['archived-live'] = '$1 from the original on $2', | ['archived-live'] = '$1 from the original on $2', | ||
['archived-unfit'] = 'Archived from the original on ', | ['archived-unfit'] = 'Archived from the original on $1', | ||
['archived'] = 'Archived', | ['archived'] = 'Archived', | ||
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword | ['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword | ||
| Line 79: | Line 80: | ||
['et al'] = 'et al.', | ['et al'] = 'et al.', | ||
['in'] = 'In', -- edited works | ['in'] = 'In', -- edited works | ||
['inactive'] = 'inactive', | ['inactive'] = ' (inactive $1)', -- $1 is date which the doi was found to be broken in | ||
['inset'] = '$1 inset', | ['inset'] = '$1 inset', | ||
['interview'] = 'Interviewed by $1', | ['interview'] = 'Interviewed by $1', | ||
invisible_1 = '$1 $2', -- $1 stripmarker name; $2 is text from <invisible_chars[1]> | |||
invisible_2 = '$1 character', -- $1 character name from <invisible_chars[1]> | |||
['mismatch'] = '<code class="cs1-code">|$1=</code> / <code class="cs1-code">|$2=</code> mismatch', -- $1 is year param name; $2 is date param name | ['mismatch'] = '<code class="cs1-code">|$1=</code> / <code class="cs1-code">|$2=</code> mismatch', -- $1 is year param name; $2 is date param name | ||
['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]: $1', | ['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]: $1', | ||
| Line 96: | Line 99: | ||
['translated'] = 'Translated by $1', | ['translated'] = 'Translated by $1', | ||
['type'] = ' ($1)', -- for titletype | ['type'] = ' ($1)', -- for titletype | ||
wikidata = 'Wikidata', -- these used for interwikilinked author/editor/... names | |||
wikipedia = 'Wikipedia', | |||
wikisource = 'Wikisource', | |||
['written'] = 'Written at $1', | ['written'] = 'Written at $1', | ||
| Line 123: | Line 131: | ||
['via'] = " – via $1", | ['via'] = " – via $1", | ||
['event'] = 'Event occurs at', | ['event'] = 'Event occurs at', | ||
['minutes'] = 'minutes in', | ['minutes'] = ' $1 minutes in', -- $1 is the number of minutes | ||
-- Determines the location of the help page | -- Determines the location of the help page | ||
| Line 141: | Line 149: | ||
['bare_url_no_origin'] = 'Bare URL found but origin indicator is nil or empty', | ['bare_url_no_origin'] = 'Bare URL found but origin indicator is nil or empty', | ||
['warning_msg_e'] = '<span style="color:#d33"> | ['warning_msg_e'] = '<span style="color:#d33"><code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code>: this [[#$2|reference]] has errors</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link; $2 is anchor ID | ||
['warning_msg_m'] = '<span style="color:# | ['warning_msg_m'] = '<span style="color:#085"><code style="color: inherit; background: inherit; border: none; padding: inherit;">{{$1}}</code>: this [[#$2|reference]] has maintenance messages</span>; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).'; -- $1 is template link; $2 is anchor ID | ||
} | } | ||
| Line 153: | Line 161: | ||
the canonical template name may. These names are used in warning_msg_e and warning_msg_m to create links to the | the canonical template name may. These names are used in warning_msg_e and warning_msg_m to create links to the | ||
template's documentation when an article is displayed in preview mode. | template's documentation when an article is displayed in preview mode. | ||
]] | ]] | ||
local citation_class_map_t = { -- TODO: | local citation_class_map_t = { -- TODO: in Module:Cite/config write a function to use this table | ||
arxiv = 'cite arXiv', -- as the source for known_templates_t and citation_classes_t | |||
['audio-visual'] = 'AV media', | ['audio-visual'] = 'cite AV media', | ||
['AV-media-notes'] = 'AV media notes', | ['AV-media-notes'] = 'cite AV media notes', | ||
biorxiv = 'cite bioRxiv', | |||
book = 'cite book', | |||
citation = 'citation', | |||
citeseerx = 'cite CiteSeerX', | |||
conference = 'cite conference', | |||
document = 'cite document', | |||
encyclopaedia = 'cite encyclopedia', | |||
episode = 'cite episode', | |||
interview = 'cite interview', | |||
journal = 'cite journal', | |||
magazine = 'cite magazine', | |||
mailinglist = 'cite mailing list', | |||
map = 'cite map', | |||
medrxiv = 'cite medRxiv', | |||
news = 'cite news', | |||
newsgroup = 'cite newsgroup', | |||
podcast = 'cite podcast', | |||
pressrelease = 'cite press release', | |||
report = 'cite report', | |||
serial = 'cite serial', | |||
sign = 'cite sign', | |||
speech = 'cite speech', | |||
ssrn = 'cite SSRN', | |||
techreport = 'cite tech report', | |||
thesis = 'cite thesis', | |||
web = 'cite web', | |||
} | } | ||
| Line 219: | Line 243: | ||
['ext-link-access-signal'] = '<span class="$1" title="$2">$3</span>', -- external link with appropriate lock icon | ['ext-link-access-signal'] = '<span class="$1" title="$2">$3</span>', -- external link with appropriate lock icon | ||
['free'] = {class=' | ['free'] = {class='id-lock-free', title='Freely accessible'}, -- classes defined in Module:Citation/CS1/styles.css | ||
['registration'] = {class=' | ['registration'] = {class='id-lock-registration', title='Free registration required'}, | ||
['limited'] = {class=' | ['limited'] = {class='id-lock-limited', title='Free access subject to limited trial, subscription normally required'}, | ||
['subscription'] = {class=' | ['subscription'] = {class='id-lock-subscription', title='Paid subscription required'}, | ||
['interwiki-icon'] = '<span class="$1" title="$2">$3</span>', | ['interwiki-icon'] = '<span class="$1" title="$2">$3</span>', | ||
| Line 422: | Line 446: | ||
['TranslatorList-Mask'] = {'translator-mask#', 'translator#-mask'}, | ['TranslatorList-Mask'] = {'translator-mask#', 'translator#-mask'}, | ||
} | } | ||
--[[--------------------------< D E P E N D E N C I E S _ T >-------------------------------------------------- | |||
a table of url-holding parameters upon which other parameters are dependent. | |||
this table is used by has_archive_today_url() to suppress parameters that are dependant upon a url-holding parameter | |||
that has as a value an archive.today (or alternate tld) url. | |||
archive.today is deprecated at en.wiki; see Wikipedia:Requests_for_comment/Archive.is_RFC_5 | |||
]] | |||
local url_dependency_map_t = { -- table of url-holding parameters and the meta-parameters that are dependent on them | |||
['url'] = {'AccessDate', 'ArchiveURL', 'Format', 'UrlAccess'}, | |||
['archive-url'] = {'ArchiveDate', 'ArchiveFormat', 'UrlStatus'}, | |||
['archiveurl'] = {'ArchiveDate', 'ArchiveFormat', 'UrlStatus'}, | |||
['article-url'] = {'ChapterFormat', 'ChapterUrlAccess'}, | |||
['chapter-url'] = {'ChapterFormat', 'ChapterUrlAccess'}, | |||
['conference-url'] = {'ConferenceFormat'}, | |||
['contribution-url'] = {'ChapterFormat', 'ChapterUrlAccess'}, | |||
['entry-url'] = {'ChapterFormat', 'ChapterUrlAccess'}, | |||
['map-url'] = {'MapFormat', 'MapUrlAccess'}, | |||
['section-url'] = {'ChapterFormat', 'ChapterUrlAccess'}, | |||
['transcript-url'] = {'TranscriptFormat'}, | |||
}; | |||
local dependencies_t = {}; -- the table of url-holding parameters and their dependent parameters | |||
for url_param, meta_parameters_t in pairs (url_dependency_map_t) do -- sequence of meta-parameters (indexes) into <aliases> table | |||
local dependant_params_t = {}; -- collection of parameters that are dependent on this <url_param> | |||
for _, meta_parameter in ipairs (meta_parameters_t) do -- for each <aliases> meta-parameter (index) | |||
if 'string' == type (aliases[meta_parameter]) then -- for single parameter names (no aliases), <aliases[meta_parameter]> will be a string | |||
table.insert (dependant_params_t, aliases[meta_parameter]); -- add to this <url_param>'s dependency sequence | |||
else | |||
for _, alias in ipairs (aliases[meta_parameter]) do -- for each alias in aliases[meta_parameter] (aliases['AccessDate'] for example) | |||
table.insert (dependant_params_t, alias); -- add to this <url_param>'s dependency sequence | |||
end | |||
end | |||
end | |||
dependencies_t[url_param] = dependant_params_t; -- add the <url_param> and its dependent parameters | |||
end | |||
| Line 433: | Line 499: | ||
'BookTitle', 'Chapter', 'ScriptChapter', 'ScriptTitle', 'Title', 'TransChapter', 'Transcript', 'TransMap', 'TransTitle', -- title-holding parameters | 'BookTitle', 'Chapter', 'ScriptChapter', 'ScriptTitle', 'Title', 'TransChapter', 'Transcript', 'TransMap', 'TransTitle', -- title-holding parameters | ||
'AuthorList-Mask', 'ContributorList-Mask', 'EditorList-Mask', 'InterviewerList-Mask', 'TranslatorList-Mask', -- name-list mask may have name separators | 'AuthorList-Mask', 'ContributorList-Mask', 'EditorList-Mask', 'InterviewerList-Mask', 'TranslatorList-Mask', -- name-list mask may have name separators | ||
'PostScript', 'Quote', 'ScriptQuote', 'TransQuote', 'Ref', | 'PostScript', 'Quote', 'ScriptQuote', 'TransQuote', 'Ref', -- miscellaneous | ||
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'MapURL', 'TranscriptURL', 'URL', | 'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'MapURL', 'TranscriptURL', 'URL', -- URL-holding parameters | ||
} | } | ||
| Line 463: | Line 529: | ||
local punct_skip = {}; | local punct_skip = {}; | ||
local url_skip = {}; | local url_skip = {}; | ||
--[[--------------------------< U R L _ A C C E S S _ M A P >-------------------------------------------------- | |||
this table used by the wikipedia library url test, has_twl_url(), which automatically sets a url-access parameter | |||
to 'subscription' when it discovers a wikipedia library url in any of the url-holding paramters used as keys in | |||
this table. | |||
translators: if your wiki uses parameter names for these url-holding parameters and their matching -access parameters, | |||
add your wiki's parameters to this list. Leave the English parameters in place. | |||
TODO: is there a better way to do this? | |||
]] | |||
local url_access_map_t = { | |||
['chapter-url'] = 'chapter-url-access', | |||
['contribution-url'] = 'contribution-url-access', | |||
['entry-url'] = 'entry-url-access', | |||
['article-url'] = 'article-url-access', | |||
['section-url'] = 'section-url-access', | |||
['map-url'] = 'map-url-access', | |||
['mapurl'] = 'map-url-access', | |||
['url'] = 'url-access', | |||
['URL'] = 'url-access' | |||
} | |||
| Line 485: | Line 577: | ||
local is_Latn = 'A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191'; | local is_Latn = 'A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191'; | ||
local special_case_translation = { | local special_case_translation = { | ||
author = 'author', | |||
editor = 'editor', | |||
name_list_params = '$1-name-list parameters', -- $1 is 'author' or 'editor'; used with err_redundant_parameters | |||
['AuthorList'] = 'authors list', -- used to assemble maintenance category names | ['AuthorList'] = 'authors list', -- used to assemble maintenance category names | ||
['ContributorList'] = 'contributors list', -- translation of these names plus translation of the base maintenance category names in maint_cats{} table below | ['ContributorList'] = 'contributors list', -- translation of these names plus translation of the base maintenance category names in maint_cats{} table below | ||
| Line 509: | Line 605: | ||
{['en'] = {'^wayback%s+machine$', false}, ['local'] = nil}, | {['en'] = {'^wayback%s+machine$', false}, ['local'] = nil}, | ||
{['en'] = {'are you a robot', true}, ['local'] = nil}, | {['en'] = {'are you a robot', true}, ['local'] = nil}, | ||
{['en'] = {'hugedomains | {['en'] = {'hugedomains', true}, ['local'] = nil}, | ||
{['en'] = {'^[%(%[{<]?no +title[>}%]%)]?$', false}, ['local'] = nil}, | {['en'] = {'^[%(%[{<]?no +title[>}%]%)]?$', false}, ['local'] = nil}, | ||
{['en'] = {'page not found', true}, ['local'] = nil}, | {['en'] = {'page not found', true}, ['local'] = nil}, | ||
| Line 516: | Line 612: | ||
{['en'] = {'website is for sale', true}, ['local'] = nil}, | {['en'] = {'website is for sale', true}, ['local'] = nil}, | ||
{['en'] = {'^404', false}, ['local'] = nil}, | {['en'] = {'^404', false}, ['local'] = nil}, | ||
{['en'] = {'error[ %-]404', false}, ['local'] = nil}, | |||
{['en'] = {'internet archive wayback machine', true}, ['local'] = nil}, | {['en'] = {'internet archive wayback machine', true}, ['local'] = nil}, | ||
{['en'] = {'log into facebook', true}, ['local'] = nil}, | {['en'] = {'log into facebook', true}, ['local'] = nil}, | ||
| Line 521: | Line 618: | ||
{['en'] = {'redirecting...', true}, ['local'] = nil}, | {['en'] = {'redirecting...', true}, ['local'] = nil}, | ||
{['en'] = {'usurped title', true}, ['local'] = nil}, -- added by a GreenC bot | {['en'] = {'usurped title', true}, ['local'] = nil}, -- added by a GreenC bot | ||
{['en'] = {'wayback machine', true}, ['local'] = nil}, | |||
{['en'] = {'webcite query result', true}, ['local'] = nil}, | {['en'] = {'webcite query result', true}, ['local'] = nil}, | ||
{['en'] = {'wikiwix\'s cache', true}, ['local'] = nil}, | {['en'] = {'wikiwix\'s cache', true}, ['local'] = nil}, | ||
{['en'] = {'bot verification', true}, ['local'] = nil}, | |||
} | } | ||
}, | }, | ||
| Line 539: | Line 638: | ||
{['en'] = {'allmusic', true}, ['local'] = nil}, | {['en'] = {'allmusic', true}, ['local'] = nil}, | ||
{['en'] = {'%f[%a][Aa]uthor%f[%A]', false}, ['local'] = nil}, | {['en'] = {'%f[%a][Aa]uthor%f[%A]', false}, ['local'] = nil}, | ||
{['en'] = {'^[Bb]ureau$', false}, ['local'] = nil}, | |||
{['en'] = {'business', true}, ['local'] = nil}, | {['en'] = {'business', true}, ['local'] = nil}, | ||
{['en'] = {'cnn', true}, ['local'] = nil}, | {['en'] = {'cnn', true}, ['local'] = nil}, | ||
{['en'] = {'collaborator', true}, ['local'] = nil}, | {['en'] = {'collaborator', true}, ['local'] = nil}, | ||
{['en'] = {'^[Cc]ompany$', false}, ['local'] = nil}, | |||
{['en'] = {'contributor', true}, ['local'] = nil}, | {['en'] = {'contributor', true}, ['local'] = nil}, | ||
{['en'] = {'contact us', true}, ['local'] = nil}, | {['en'] = {'contact us', true}, ['local'] = nil}, | ||
{['en'] = {'correspondent', true}, ['local'] = nil}, | |||
{['en'] = {'^[Dd]esk$', false}, ['local'] = nil}, | |||
{['en'] = {'directory', true}, ['local'] = nil}, | {['en'] = {'directory', true}, ['local'] = nil}, | ||
{['en'] = {'%f[%(%[][%(%[]%s*eds?%.?%s*[%)%]]?$', false}, ['local'] = nil}, | {['en'] = {'%f[%(%[][%(%[]%s*eds?%.?%s*[%)%]]?$', false}, ['local'] = nil}, | ||
| Line 551: | Line 654: | ||
{['en'] = {'%f[%a][Ee]dited%f[%A]', false}, ['local'] = nil}, | {['en'] = {'%f[%a][Ee]dited%f[%A]', false}, ['local'] = nil}, | ||
{['en'] = {'%f[%a][Ee]ditors?%f[%A]', false}, ['local'] = nil}, | {['en'] = {'%f[%a][Ee]ditors?%f[%A]', false}, ['local'] = nil}, | ||
{['en'] = {'%f[%a] | {['en'] = {'%f[%a][Ee]mail%f[%A]', false}, ['local'] = nil}, | ||
{['en'] = {'facebook', true}, ['local'] = nil}, | {['en'] = {'facebook', true}, ['local'] = nil}, | ||
{['en'] = {'google', true}, ['local'] = nil}, | {['en'] = {'google', true}, ['local'] = nil}, | ||
{['en'] = {'^[Gg]roup$', false}, ['local'] = nil}, | |||
{['en'] = {'home page', true}, ['local'] = nil}, | {['en'] = {'home page', true}, ['local'] = nil}, | ||
{['en'] = {'^[Ii]nc%.?$', false}, ['local'] = nil}, | {['en'] = {'^[Ii]nc%.?$', false}, ['local'] = nil}, | ||
{['en'] = {'instagram', true}, ['local'] = nil}, | {['en'] = {'instagram', true}, ['local'] = nil}, | ||
{['en'] = {'interviewer', true}, ['local'] = nil}, | {['en'] = {'interviewer', true}, ['local'] = nil}, | ||
{['en'] = {'^[Ll]imited$', false}, ['local'] = nil}, | |||
{['en'] = {'linkedIn', true}, ['local'] = nil}, | {['en'] = {'linkedIn', true}, ['local'] = nil}, | ||
{['en'] = {'^[Nn]ews$', false}, ['local'] = nil}, | {['en'] = {'^[Nn]ews$', false}, ['local'] = nil}, | ||
{['en'] = {'[Nn]ews[ %-]?[Rr]oom', false}, ['local'] = nil}, | |||
{['en'] = {'pinterest', true}, ['local'] = nil}, | {['en'] = {'pinterest', true}, ['local'] = nil}, | ||
{['en'] = {'policy', true}, ['local'] = nil}, | {['en'] = {'policy', true}, ['local'] = nil}, | ||
| Line 572: | Line 678: | ||
{['en'] = {'super.?user', false}, ['local'] = nil}, | {['en'] = {'super.?user', false}, ['local'] = nil}, | ||
{['en'] = {'%f['..is_Latn..'][Uu]ser%f[^'..is_Latn..']', false}, ['local'] = nil}, | {['en'] = {'%f['..is_Latn..'][Uu]ser%f[^'..is_Latn..']', false}, ['local'] = nil}, | ||
{['en'] = {'updated', true}, ['local'] = nil}, | |||
{['en'] = {'verfasser', true}, ['local'] = nil}, | {['en'] = {'verfasser', true}, ['local'] = nil}, | ||
} | } | ||
} | |||
} | } | ||
| Line 1,054: | Line 1,161: | ||
-- list of emoji that use a zwj character (U+200D) to combine with another emoji | -- list of emoji that use a zwj character (U+200D) to combine with another emoji | ||
-- from: https://unicode.org/Public/emoji/ | -- from: https://unicode.org/Public/emoji/17.0/emoji-zwj-sequences.txt; version: 17.0; 2025-01-08 | ||
-- table created by: [[:en:Module:Make emoji zwj table]] | -- table created by: [[:en:Module:Make emoji zwj table]] | ||
local emoji_t = { -- indexes are decimal forms of the hex values in U+xxxx | local emoji_t = { -- indexes are decimal forms of the hex values in U+xxxx | ||
| Line 1,081: | Line 1,188: | ||
[127979] = true, -- U+1F3EB 🏫 school | [127979] = true, -- U+1F3EB 🏫 school | ||
[127981] = true, -- U+1F3ED 🏭 factory | [127981] = true, -- U+1F3ED 🏭 factory | ||
[128048] = true, -- U+1F430 🐰 rabbit face | |||
[128102] = true, -- U+1F466 👦 boy | [128102] = true, -- U+1F466 👦 boy | ||
[128103] = true, -- U+1F467 👧 girl | [128103] = true, -- U+1F467 👧 girl | ||
| Line 1,110: | Line 1,218: | ||
[129489] = true, -- U+1F9D1 🧑 adult | [129489] = true, -- U+1F9D1 🧑 adult | ||
[129490] = true, -- U+1F9D2 🧒 child | [129490] = true, -- U+1F9D2 🧒 child | ||
[129648] = true, -- U+1FA70 🩰 ballet shoes | |||
[129657] = true, -- U+1FA79 🩹 adhesive bandage | [129657] = true, -- U+1FA79 🩹 adhesive bandage | ||
[129775] = true, -- U+1FAEF fight cloud | |||
[129778] = true, -- U+1FAF2 🫲 leftwards hand | [129778] = true, -- U+1FAF2 🫲 leftwards hand | ||
} | } | ||
| Line 1,156: | Line 1,266: | ||
local script_lang_codes = { | local script_lang_codes = { | ||
'ab', 'am', 'ar', 'be', 'bg', 'bn', 'bo', 'bs', 'dv', 'dz', 'el', 'fa', 'gu', 'he', | 'ab', 'am', 'ar', 'as', 'az', 'be', 'bg', 'bn', 'bo', 'bs', 'ce', 'chr', | ||
'cu', 'dv', 'dz', 'el', 'fa', 'grc', 'gu', 'he', 'hi', 'hy', 'ja', 'ka', | |||
'kaa', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'lo', 'mk', 'ml', 'mn', 'mni', | |||
'mr', 'my', 'ne', 'or', 'ota', 'pa', 'ps', 'ru', 'sd', 'si', 'sr', 'syc', | |||
'ta', 'te', 'tg', 'th', 'ti', 'tkr', 'tt', 'ug', 'uk', 'ur', 'uz', 'yi', | |||
'yue', 'zh', 'zgh' | |||
}; | }; | ||
| Line 1,233: | Line 1,345: | ||
['foreign-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is foreign-language name, $2 is ISO639-1 code | ['foreign-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is foreign-language name, $2 is ISO639-1 code | ||
['foreign-lang-source-2'] = 'CS1 foreign language sources (ISO 639-2)|$1', -- |language= category; a cat for ISO639-2 languages; $1 is the ISO 639-2 code used as a sort key | ['foreign-lang-source-2'] = 'CS1 foreign language sources (ISO 639-2)|$1', -- |language= category; a cat for ISO639-2 languages; $1 is the ISO 639-2 code used as a sort key | ||
['interproj-linked-name'] = 'CS1 interproject-linked names|$1', -- any author, editor, etc that has an interproject link; $1 is interproject tag used as a sort key | |||
['interwiki-linked-name'] = 'CS1 interwiki-linked names|$1', -- any author, editor, etc that has an interwiki link; $1 is interwiki tag used as a sort key; yeilds to interproject | |||
['local-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is local-language name, $2 is ISO639-1 code; not emitted when local_lang_cat_enable is false | ['local-lang-source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is local-language name, $2 is ISO639-1 code; not emitted when local_lang_cat_enable is false | ||
['location-test'] = 'CS1 location test', | ['location-test'] = 'CS1 location test', | ||
['long-vol'] = 'CS1: long volume value', -- probably temporary cat to identify scope of |volume= values longer than 4 characters | ['long-vol'] = 'CS1: long volume value', -- probably temporary cat to identify scope of |volume= values longer than 4 characters | ||
['script'] = 'CS1 uses $1-language script ($2)', -- |script-title=xx: has matching category; $1 is language name, $2 is | ['script'] = 'CS1 uses $1-language script ($2)', -- |script-title=xx: has matching category; $1 is language name, $2 is language tag | ||
['tracked-param'] = 'CS1 tracked parameter: $1', -- $1 is base (enumerators removed) parameter name | ['tracked-param'] = 'CS1 tracked parameter: $1', -- $1 is base (enumerators removed) parameter name | ||
['unfit'] = 'CS1: unfit URL', -- |url-status=unfit or |url-status=usurped; used to be a maint cat | |||
['vanc-accept'] = 'CS1:Vancouver names with accept markup', -- for |vauthors=/|veditors= with accept-as-written markup | |||
['year-range-abbreviated'] = 'CS1: abbreviated year range', -- probably temporary cat to identify scope of |date=, |year= values using YYYY–YY form | ['year-range-abbreviated'] = 'CS1: abbreviated year range', -- probably temporary cat to identify scope of |date=, |year= values using YYYY–YY form | ||
} | } | ||
| Line 1,276: | Line 1,392: | ||
local registrants_t = {}; | local registrants_t = {}; | ||
for _, v in ipairs ({ | for _, v in ipairs ({ | ||
'1045', '1074', '1096', '1100', '1155', '1186', '1194', '1371', '1629', '1989', '1999', '2147', '2196', '3285', '3389', '3390', | '1045', '1074', '1096', '1100', '1155', '1186', '1194', '1371', '1613', '1629', '1989', '1999', '2147', '2196', '3285', '3389', '3390', '3906', | ||
'3748', '3814', '3847', '3897', '4061', '4089', '4103', '4172', '4175', ' | '3748', '3814', '3847', '3897', '4061', '4089', '4103', '4172', '4175', '4230', '4236', '4239', '4240', '4249', '4251', | ||
'4252', '4253', '4254', '4291', '4292', '4329', '4330', '4331', '5194', '5210', '5306', '5312', '5313', '5314', | '4252', '4253', '4254', '4291', '4292', '4329', '4330', '4331', '5086', '5194', '5210', '5306', '5312', '5313', '5314', | ||
'5315', '5316', '5317', '5318', '5319', '5320', '5321', '5334', '5402', '5409', '5410', '5411', '5412', | '5315', '5316', '5317', '5318', '5319', '5320', '5321', '5334', '5402', '5409', '5410', '5411', '5412', | ||
'5492', '5493', '5494', '5495', '5496', '5497', '5498', '5499', '5500', '5501', '5527', '5528', '5662', | '5492', '5493', '5494', '5495', '5496', '5497', '5498', '5499', '5500', '5501', '5527', '5528', '5662', | ||
'6064', '6219', '7167', '7217', '7287', '7482', '7490', '7554', '7717', '7759', '7766', '11131', '11569', '11647', | '6064', '6219', '7167', '7217', '7287', '7482', '7490', '7554', '7717', '7759', '7766', '9778', '11131', '11569', '11647', | ||
'11648', '12688', '12703', '12715', '12998', '13105', '14256', '14293', '14303', '15215', '15347', '15412', '15560', '16995', | '11648', '12688', '12703', '12715', '12942', '12998', '13105', '14256', '14293', '14303', '15215', '15347', '15412', '15560', '16995', | ||
'17645', '19080', '19173', '20944', '21037', '21468', '21767', '22261', '22323', '22459', '24105', '24196', '24966', | '17645', '18637', '19080', '19173', '20944', '21037', '21105', '21468', '21767', '21425', '22261', '22323', '22459', '24105', '24196', '24966', | ||
'26775', '30845', '32545', '35711', '35712', '35713', '35995', '36648', '37126', '37532', '37871', '47128', | '26775', '30845', '32545', '35711', '35712', '35713', '35995', '36648', '37126', '37532', '37871', '47128', | ||
'47622', '47959', '52437', '52975', '53288', '54081', '54947', '55667', '55914', '57009', '58647', '59081', | '47622', '47959', '52437', '52975', '53288', '53347', '54081', '54947', '55667', '55914', '57009', '58647', '59081', | ||
}) do | }) do | ||
registrants_t[v] = true; -- build a k/v table of known free-to-read doi registrants | registrants_t[v] = true; -- build a k/v table of known free-to-read doi registrants | ||
| Line 1,292: | Line 1,408: | ||
return registrants_t; | return registrants_t; | ||
end | end | ||
-- known free registrants identifiable by the doi suffix incipit | |||
local extended_registrants_t = { -- doi suffix incipits are evaluated as lua patterns | |||
['1002'] = {'aelm', 'leap', 'loe2%.', 'lol2%.'}, -- Advanced Electronic Materials, Learned Publishing, L&O e-Lectures, L&O Letters | |||
['1016'] = {'j%.aace', 'j%.aed', 'j%.aiopen', 'j%.animal', 'j%.apsb', 'j%.addicn', -- AACE Endocrinology and Diabetes, AACE Endocrinology and Diabetes, AI Open, Animal, Acta Pharmaceutica Sinica B, Addiction Neuroscience | |||
'j%.abrep', 'j%.gpb', 'j%.heliyon', 'j%.nlp', 'j%.patter', 'j%.proche', -- Addictive Behaviors Reports, Genomics, Proteomics & Bioinformatics after 2015, Heliyon, Natural Language Processing, Patterns, Procedia Chemistry | |||
'j%.vgie', 'S1672-0229'}, -- VideoGIE, Genomics, Proteomics & Bioinformatics before 2015 | |||
['1017'] = {'apj%.', 'nlp', 'mdh', 'S15574660'}, -- Natural Language Processing Journal, Medical History, Asia Pacific Journal | |||
['1046'] = {'j%.1365-8711', 'j%.1365-246x'}, -- MNRAS, GJI | |||
['1021'] = {'acscentsci', 'acsomega'}, -- ACS Central Science, ACS Omega | |||
['1093'] = {'mnras', 'mnrasl', 'gji', 'pnasnexus', 'rasti'}, -- MNRAS, MNRAS Letters, GJI, PNAS Nexus, RASTI | |||
['1098'] = {'rsbm', 'rsob', 'rsos'}, -- Biographical Memoirs of Fellows of the Royal Society, Open Biology, Royal Society Open Science | |||
['1099'] = {'acmi', 'mic', '00221287', 'mgen'}, -- Access Microbiology, Microbiology, Journal of General Microbiology, Microbial Genomics | |||
['1107'] = {'S20569890', 'S20522525', 'S16005775', 'S24143146'}, -- Acta Crystallographica E, IUCrJ, Journal of Synchrotron Radiation, IUCrData | |||
['1109'] = {'oa', 'oj'}, -- IEEE Open Access..., IEEE Open Journal... | |||
['1111'] = {'aogs', 'j%.1365-2966', 'j%.1745-3933', 'j%.1365-246X'}, -- Acta Obstetricia et Gynecologica Scandinavica, MNRAS, MNRAS Letters, GJI | |||
['1128'] = {'asmcr', 'jmbe', 'mbio', 'mra', 'spectrum', 'msphere', 'msystems'}, --ASM Case Reports, Journal of Microbiology & Biology Education, mBio, Microbiology Resource Announcements, Microbiology Spectrum, mSphere, mSystems | |||
['1136'] = {'bmjopen'}, -- BMJ Open | |||
['1140'] = {'epjc'}, -- European Physical Journal C | |||
['1192'] = {'bjo'}, -- BJPsych Open | |||
['1210'] = {'jendso','jcemcr'}, -- Journal of the Endocrine Society, JCEM Case Reports | |||
['1215'] = {'21573689', '21573698'}, -- L&O Fluids | |||
['1590'] = {'0102-3306'}, -- Acta Botanica Brasilica | |||
['4171'] = {'dm','mag'}, -- Documenta Mathematica, EMS Magazine | |||
['4319'] = {'lo%.', 'lol%.', 'lom%.'}, -- L&O, L&O e-Lectures, L&O Methods | |||
['5852'] = {'ejt'}, -- European Journal of Taxonomy | |||
['7155'] = {'jgaa'}, -- Journal of Graph Algorithms and Applications | |||
['11158'] = {'saasp'}, -- Systematic and Applied Acarology Special Publications | |||
['11646'] = {'megataxa', 'mesozoic'}, -- Megataxa, Mesozoic | |||
['14231'] = {'ag'}, -- Algebraic Geometry | |||
['15446'] = {'abc'}, -- Acta Biológica Colombiana | |||
['17239'] = {'jowr'}, -- Journal of Writing Research | |||
['22073'] = {'pja'}, -- Persian Journal of Acarology | |||
['24310'] = {'abm'}, -- Acta Botanica Malacitana | |||
['24425'] = {'agp'}, -- Acta Geologica Polonica | |||
['35249'] = {'rche'}, -- Revista Chilena de Entomología | |||
['37520'] = {'fi'}, -- Fossil Imprint | |||
['53562'] = {'ajcb'} -- Asian Journal of Conservation Biology | |||
} | |||
| Line 1,297: | Line 1,451: | ||
]] | ]] | ||
--[[----------< E R R O R M E S S A G E S U P P L | --[[----------< E R R O R M E S S A G E S U P P L E M E N T S >------------- | ||
I18N for those messages that are supplemented with additional specific text that | I18N for those messages that are supplemented with additional specific text that | ||
| Line 1,308: | Line 1,462: | ||
['char'] = 'invalid character', -- |isbn=, |sbn= | ['char'] = 'invalid character', -- |isbn=, |sbn= | ||
['check'] = 'checksum', -- |isbn=, |sbn= | ['check'] = 'checksum', -- |isbn=, |sbn= | ||
empty_str = '(empty string)', -- empty unknown parameter check when cite has |= | |||
['flag'] = 'flag', -- |archive-url= | ['flag'] = 'flag', -- |archive-url= | ||
['form'] = 'invalid form', -- |isbn=, |sbn= | ['form'] = 'invalid form', -- |isbn=, |sbn= | ||
| Line 1,721: | Line 1,876: | ||
category = 'CS1 errors: generic title', | category = 'CS1 errors: generic title', | ||
hidden = false, | hidden = false, | ||
}, | |||
err_invalid_isbn_date = { | |||
message = 'ISBN / Date incompatibility', | |||
anchor = 'invalid_isbn_date', | |||
category = 'CS1 errors: ISBN date', | |||
hidden = true | |||
}, | }, | ||
err_invalid_param_val = { | err_invalid_param_val = { | ||
| Line 1,780: | Line 1,941: | ||
anchor = 'param_has_ext_link', | anchor = 'param_has_ext_link', | ||
category = 'CS1 errors: external links', | category = 'CS1 errors: external links', | ||
hidden = false | |||
}, | |||
err_param_has_twl_url = { | |||
message = 'Wikipedia Library link in <code class="cs1-code">$1</code>', -- $1 is parameter name | |||
anchor = 'param_has_twl_url', | |||
category = 'CS1 errors: URL', | |||
hidden = false | hidden = false | ||
}, | }, | ||
| Line 1,857: | Line 2,024: | ||
]] | ]] | ||
maint_archive_origin = { | |||
message = nil, | |||
anchor = 'archive_origin', | |||
category = 'CS1 maint: archive origin', | |||
hidden = true, | |||
}, | |||
maint_archived_copy = { | maint_archived_copy = { | ||
message = nil, | message = nil, | ||
| Line 1,897: | Line 2,070: | ||
anchor = 'date_year', | anchor = 'date_year', | ||
category = 'CS1 maint: date and year', | category = 'CS1 maint: date and year', | ||
hidden = true, | |||
}, | |||
maint_deprecated_archive = { | |||
message = nil, | |||
anchor = 'deprecated_archive', | |||
category = 'CS1 maint: deprecated archival service', | |||
hidden = true, | hidden = true, | ||
}, | }, | ||
| Line 1,927: | Line 2,106: | ||
anchor = 'extra_punct', | anchor = 'extra_punct', | ||
category = 'CS1 maint: extra punctuation', | category = 'CS1 maint: extra punctuation', | ||
hidden = true, | |||
}, | |||
maint_id_limit_load_fail = { -- applies to all cs1|2 templates on a page; | |||
message = nil, -- maint message (category link) never emitted | |||
anchor = 'id_limit_load_fail', | |||
category = 'CS1 maint: ID limit load fail', | |||
hidden = true, | hidden = true, | ||
}, | }, | ||
| Line 1,951: | Line 2,136: | ||
anchor = 'location', | anchor = 'location', | ||
category = 'CS1 maint: location', | category = 'CS1 maint: location', | ||
hidden = true, | |||
}, | |||
maint_missing_class = { | |||
message = nil, | |||
anchor = 'missing_class', | |||
category = 'CS1 maint: missing class', | |||
hidden = true, | hidden = true, | ||
}, | }, | ||
| Line 1,987: | Line 2,178: | ||
anchor = 'overridden', | anchor = 'overridden', | ||
category = 'CS1 maint: overridden setting', | category = 'CS1 maint: overridden setting', | ||
hidden = true, | |||
}, | |||
maint_page_art_num = { | |||
message = nil, | |||
anchor = 'page_art_num', | |||
category = 'CS1 maint: article number as page number', | |||
hidden = true, | hidden = true, | ||
}, | }, | ||
| Line 2,005: | Line 2,202: | ||
anchor = 'postscript', | anchor = 'postscript', | ||
category = 'CS1 maint: postscript', | category = 'CS1 maint: postscript', | ||
hidden = true, | |||
}, | |||
maint_publisher_location = { | |||
message = nil, | |||
anchor = 'publisher_location', | |||
category = 'CS1 maint: publisher location', | |||
hidden = true, | hidden = true, | ||
}, | }, | ||
| Line 2,013: | Line 2,216: | ||
hidden = true, | hidden = true, | ||
}, | }, | ||
maint_shortened_archive_url = { | |||
message = nil, | message = nil, | ||
anchor = ' | anchor = 'shortened_archive_url', | ||
category = 'CS1 maint: | category = 'CS1 maint: shortened archive url', | ||
hidden = true, | hidden = true, | ||
}, | |||
maint_unknown_lang = { | maint_unknown_lang = { | ||
message = nil, | message = nil, | ||
| Line 2,035: | Line 2,238: | ||
anchor = 'url_status', | anchor = 'url_status', | ||
category = 'CS1 maint: url-status', | category = 'CS1 maint: url-status', | ||
hidden = true, | |||
}, | |||
maint_work_isbn = { | |||
message = nil, | |||
anchor = 'work_isbn', | |||
category = 'CS1 maint: work parameter with ISBN', | |||
hidden = true, | |||
}, | |||
maint_year= { | |||
message = nil, | |||
anchor = 'year', | |||
category = 'CS1 maint: year', | |||
hidden = true, | hidden = true, | ||
}, | }, | ||
| Line 2,045: | Line 2,260: | ||
} | } | ||
--[[--------------------------< I D _ L I M I T S _ D A T A _ T >---------------------------------------------- | |||
fetch id limits for certain identifiers from c:Data:CS1/Identifier limits.tab. This source is a json tabular | |||
data file maintained at wikipedia commons. Convert the json format to a table of k/v pairs. | |||
The values from <id_limits_data_t> are used to set handle.id_limit. | |||
From 2025-02-21, MediaWiki is broken. Use this link to edit the tablular data file: | |||
https://commons.wikimedia.org/w/index.php?title=Data:CS1/Identifier_limits.tab&action=edit | |||
See Phab:T389105 | |||
]] | |||
local id_limits_data_t = {}; | |||
local use_commons_data = true; -- set to false if your wiki does not have access to mediawiki commons; then, | |||
if false == use_commons_data then -- update this table from https://commons.wikimedia.org/wiki/Data:CS1/Identifier_limits.tab; last update: 2025-02-21 | |||
id_limits_data_t = {['OCLC'] = 10450000000, ['OSTI'] = 23010000, ['PMC'] = 11900000, ['PMID'] = 40400000, ['RFC'] = 9300, ['SSRN'] = 5200000, ['S2CID'] = 276000000}; -- this table must be maintained locally | |||
else -- here for wikis that do have access to mediawiki commons | |||
local load_fail_limit = 99999999999; -- very high number to avoid error messages on load failure | |||
id_limits_data_t = {['OCLC'] = load_fail_limit, ['OSTI'] = load_fail_limit, ['PMC'] = load_fail_limit, ['PMID'] = load_fail_limit, ['RFC'] = load_fail_limit, ['SSRN'] = load_fail_limit, ['S2CID'] = load_fail_limit}; | |||
local id_limits_data_load_fail = false; -- flag; assume that we will be successful when loading json id limit tabular data | |||
if mw.ext.data == nil then | |||
id_limits_data_load_fail = true; -- safeguard against Lua errors if mw.ext.data is not available for some reason | |||
else | |||
local tab_data_t = mw.ext.data.get ('CS1/Identifier limits.tab'); -- attempt to load the tabular data from commons into <tab_data_t> | |||
if false == tab_data_t then -- undocumented 'feature': mw.ext.data.get() sometimes returns false | |||
id_limits_data_load_fail = true; -- set the flag so that Module:Citation/CS1 can create an unannotated maint category | |||
else | |||
for _, limit_t in ipairs (tab_data_t.data) do -- overwrite default <load_fail_limit> values from the data table in the tabular data | |||
id_limits_data_t[limit_t[1]] = limit_t[2]; -- <limit[1]> is identifier; <limit[2]> is upper limit for that identifier | |||
end | |||
end | |||
end | |||
end | |||
| Line 2,157: | Line 2,411: | ||
q = 'Q46339674', | q = 'Q46339674', | ||
label = 'eISSN', | label = 'eISSN', | ||
prefix = 'https:// | prefix = 'https://search.worldcat.org/issn/', | ||
COinS = 'rft.eissn', | COinS = 'rft.eissn', | ||
encode = false, | encode = false, | ||
| Line 2,200: | Line 2,454: | ||
q = 'Q131276', | q = 'Q131276', | ||
label = 'ISSN', | label = 'ISSN', | ||
prefix = 'https:// | prefix = 'https://search.worldcat.org/issn/', | ||
COinS = 'rft.issn', | COinS = 'rft.issn', | ||
encode = false, | encode = false, | ||
| Line 2,268: | Line 2,522: | ||
q = 'Q190593', | q = 'Q190593', | ||
label = 'OCLC', | label = 'OCLC', | ||
prefix = 'https:// | prefix = 'https://search.worldcat.org/oclc/', | ||
COinS = 'info:oclcnum', | COinS = 'info:oclcnum', | ||
encode = true, | encode = true, | ||
separator = ' ', | separator = ' ', | ||
id_limit = | id_limit = id_limits_data_t.OCLC or 0, | ||
}, | }, | ||
['OL'] = { | ['OL'] = { | ||
| Line 2,296: | Line 2,550: | ||
encode = true, | encode = true, | ||
separator = ' ', | separator = ' ', | ||
id_limit = | id_limit = id_limits_data_t.OSTI or 0, | ||
custom_access = 'osti-access', | custom_access = 'osti-access', | ||
}, | }, | ||
| Line 2,310: | Line 2,564: | ||
encode = true, | encode = true, | ||
separator = ' ', | separator = ' ', | ||
id_limit = | id_limit = id_limits_data_t.PMC or 0, | ||
access = 'free', -- free to read | access = 'free', -- free to read | ||
}, | }, | ||
| Line 2,323: | Line 2,577: | ||
encode = false, | encode = false, | ||
separator = ' ', | separator = ' ', | ||
id_limit = | id_limit = id_limits_data_t.PMID or 0, | ||
}, | }, | ||
['RFC'] = { | ['RFC'] = { | ||
| Line 2,335: | Line 2,589: | ||
encode = false, | encode = false, | ||
separator = ' ', | separator = ' ', | ||
id_limit = | id_limit = id_limits_data_t.RFC or 0, | ||
access = 'free', -- free to read | access = 'free', -- free to read | ||
}, | }, | ||
| Line 2,357: | Line 2,611: | ||
encode = true, | encode = true, | ||
separator = ' ', | separator = ' ', | ||
id_limit = | id_limit = id_limits_data_t.SSRN or 0, | ||
custom_access = 'ssrn-access', | custom_access = 'ssrn-access', | ||
}, | }, | ||
| Line 2,370: | Line 2,624: | ||
encode = false, | encode = false, | ||
separator = ' ', | separator = ' ', | ||
id_limit = | id_limit = id_limits_data_t.S2CID or 0, | ||
custom_access = 's2cid-access', | custom_access = 's2cid-access', | ||
}, | }, | ||
| Line 2,407: | Line 2,661: | ||
date_digit_auto_xlate_enable = date_digit_auto_xlate_enable, | date_digit_auto_xlate_enable = date_digit_auto_xlate_enable, | ||
enable_sort_keys = enable_sort_keys, | enable_sort_keys = enable_sort_keys, | ||
suppress_archive_today_urls = suppress_archive_today_urls, | |||
-- tables and variables created when this module is loaded | -- tables and variables created when this module is loaded | ||
dependencies_t = dependencies_t, -- used to suppress parameters dependent on url-holding parameters holding archive.today urls | |||
enum_needs_xlation = '1' ~= date_names.xlate_digits['1'], -- to avoid unnecessary enumerator translation | |||
global_df = get_date_format (), -- this line can be replaced with "global_df = 'dmy-all'," to have all dates auto translated to dmy format. | global_df = get_date_format (), -- this line can be replaced with "global_df = 'dmy-all'," to have all dates auto translated to dmy format. | ||
global_cs1_config_t = global_cs1_config_t, -- global settings from {{cs1 config}} | global_cs1_config_t = global_cs1_config_t, -- global settings from {{cs1 config}} | ||
id_limits_data_load_fail = id_limits_data_load_fail, -- true when commons tabular identifier-limit data fails to load | |||
known_free_doi_registrants_t = build_free_doi_registrants_table(), | |||
punct_skip = build_skip_table (punct_skip, punct_meta_params), | punct_skip = build_skip_table (punct_skip, punct_meta_params), | ||
url_skip = build_skip_table (url_skip, url_meta_params), | url_skip = build_skip_table (url_skip, url_meta_params), | ||
archive_today_tlds_t = {['today'] = true, ['ph'] = true, ['is'] = true, ['md'] = true, ['li'] = true, ['fo'] = true, ['vn'] = true}; -- used by is_archive_today_url() | |||
name_space_sort_keys = name_space_sort_keys, | name_space_sort_keys = name_space_sort_keys, | ||
aliases = aliases, | aliases = aliases, | ||
| Line 2,423: | Line 2,682: | ||
editor_markup_patterns = editor_markup_patterns, | editor_markup_patterns = editor_markup_patterns, | ||
et_al_patterns = et_al_patterns, | et_al_patterns = et_al_patterns, | ||
extended_registrants_t = extended_registrants_t, | |||
id_handlers = id_handlers, | id_handlers = id_handlers, | ||
keywords_lists = keywords_lists, | keywords_lists = keywords_lists, | ||
| Line 2,447: | Line 2,707: | ||
vol_iss_pg_patterns = vol_iss_pg_patterns, | vol_iss_pg_patterns = vol_iss_pg_patterns, | ||
single_letter_2nd_lvl_domains_t = single_letter_2nd_lvl_domains_t, | single_letter_2nd_lvl_domains_t = single_letter_2nd_lvl_domains_t, | ||
url_access_map_t = url_access_map_t, | |||
inter_wiki_map = inter_wiki_map, | inter_wiki_map = inter_wiki_map, | ||