Module:Citation/CS1/Configuration

The educational technology and digital learning wiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:Citation/CS1/Configuration/doc

  1 local citation_config = {};
  2 
  3 -- override <code>...</code> styling to remove color, border, and padding.  <code> css is specified here:
  4 -- https://git.wikimedia.org/blob/mediawiki%2Fcore.git/69cd73811f7aadd093050dbf20ed70ef0b42a713/skins%2Fcommon%2FcommonElements.css#L199
  5 local code_style="color:inherit; border:inherit; padding:inherit;";
  6 
  7 --[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------
  8 
  9 List of namespaces that should not be included in citation error categories.  Same as setting notracking = true by default
 10 
 11 Note: Namespace names should use underscores instead of spaces.
 12 
 13 ]]
 14 local uncategorized_namespaces = { 'User', 'Talk', 'User_talk', 'Wikipedia_talk', 'File_talk', 'Template_talk',
 15 	'Help_talk', 'Category_talk', 'Portal_talk', 'Book_talk', 'Draft', 'Draft_talk', 'Education_Program_talk', 
 16 	'Module_talk', 'MediaWiki_talk' };
 17 
 18 local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases'};		-- list of Lua patterns found in page names of pages we should not categorize
 19 
 20 --[[--------------------------< M E S S A G E S >--------------------------------------------------------------
 21 
 22 Translation table
 23 
 24 The following contains fixed text that may be output as part of a citation.
 25 This is separated from the main body to aid in future translations of this
 26 module.
 27 
 28 ]]
 29 
 30 local messages = {
 31 	['archived-dead'] = 'Archived from $1 on $2',
 32 	['archived-not-dead'] = '$1 from the original on $2',
 33 	['archived-missing'] = 'Archived from the original$1 on $2',
 34 	['archived'] = 'Archived',
 35 	['by'] = 'By',																-- contributions to authored works: introduction, foreword, afterword
 36 	['cartography'] = 'Cartography by $1',
 37 	['editor'] = 'ed.',
 38 	['editors'] = 'eds.', 
 39 	['edition'] = '($1 ed.)', 
 40 	['episode'] = 'Episode $1',
 41 	['et al'] = 'et al.', 
 42 	['in'] = 'In',																-- edited works
 43 	['inactive'] = 'inactive',
 44 	['inset'] = '$1 inset',
 45 	['lay summary'] = 'Lay summary',
 46 	['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]:&nbsp;$1',
 47 	['original'] = 'the original',
 48 	['published'] = 'published $1',
 49 	['retrieved'] = 'Retrieved $1',
 50 	['season'] = 'Season $1', 
 51 	['section'] = '§ $1',
 52 	['sections'] = '§§ $1',
 53 	['series'] = 'Series $1',
 54 	['type'] = ' ($1)',															-- for titletype
 55 	['written'] = 'Written at $1',
 56 
 57 	['vol'] = '$1 Vol.&nbsp;$2',												-- $1 is sepc; bold journal style volume is in presentation{}
 58 	['vol-no'] = '$1 Vol.&nbsp;$2 no.&nbsp;$3',									-- sepc, volume, issue
 59 	['issue'] = '$1 No.&nbsp;$2',												-- $1 is sepc
 60 
 61 	['j-vol'] = '$1 $2',														-- sepc, volume; bold journal volume is in presentation{}
 62 	['j-issue'] = ' ($1)',
 63 
 64 	['nopp'] = '$1 $2';															-- page(s) without prefix; $1 is sepc
 65 
 66 	['p-prefix'] = "$1 p.&nbsp;$2",												-- $1 is sepc
 67 	['pp-prefix'] = "$1 pp.&nbsp;$2",											-- $1 is sepc
 68 	['j-page(s)'] = ': $1',														-- same for page and pages
 69 
 70 	['sheet'] = '$1 Sheet&nbsp;$2',												-- $1 is sepc
 71 	['sheets'] = '$1 Sheets&nbsp;$2',											-- $1 is sepc
 72 	['j-sheet'] = ': Sheet&nbsp;$1',
 73 	['j-sheets'] = ': Sheets&nbsp;$1',
 74 	
 75 	['subscription'] = '<span style="font-size:90%; color:#555">(subscription required (<span title="Sources are not required to be available online. Online sources do not have to be freely available. The site may require a paid subscription." style="border-bottom:1px dotted;cursor:help">help</span>))</span>' ..
 76 		'[[Category:Pages containing links to subscription-only content]]', 
 77 	
 78 	['registration']='<span style="font-size:90%; color:#555">(registration required (<span title="Sources are not required to be available online. Online sources do not have to be freely available. The site may require registration." style="border-bottom:1px dotted;cursor:help">help</span>))</span>' ..
 79 		'[[Category:Pages with login required references or sources]]',
 80 	
 81 	['language'] = '(in $1)', 
 82 	['via'] = " &ndash; via $1",
 83 	['event'] = 'Event occurs at',
 84 	['minutes'] = 'minutes in', 
 85 	
 86 	['parameter-separator'] = ', ',
 87 	['parameter-final-separator'] = ', and ',
 88 	['parameter-pair-separator'] = ' and ',
 89 	
 90 	-- Determines the location of the help page
 91 	['help page link'] = 'Help:CS1 errors',
 92 	['help page label'] = 'help',
 93 	
 94 	-- Internal errors (should only occur if configuration is bad)
 95 	['undefined_error'] = 'Called with an undefined error condition',
 96 	['unknown_manual_ID'] = 'Unrecognized manual ID mode',
 97 	['unknown_ID_mode'] = 'Unrecognized ID mode',
 98 	['unknown_argument_map'] = 'Argument map not defined for this variable',
 99 	['bare_url_no_origin'] = 'Bare url found but origin indicator is nil or empty',
100 }
101 
102 --[[--------------------------< P R E S E N T A T I O N >------------------------------------------------------
103 
104 Fixed presentation markup.  Originally part of citation_config.messages it has been moved into its own, more semantically
105 correct place.
106 
107 ]]
108 local presentation = 
109 	{
110 	-- Error output
111 	-- .error class is specified at https://git.wikimedia.org/blob/mediawiki%2Fcore.git/9553bd02a5595da05c184f7521721fb1b79b3935/skins%2Fcommon%2Fshared.css#L538
112 	-- .citation-comment class is specified at Help:CS1_errors#Controlling_error_message_display
113 	['hidden-error'] = '<span style="display:none;font-size:100%" class="error citation-comment">$1</span>',
114 	['visible-error'] = '<span style="font-size:100%" class="error citation-comment">$1</span>',
115 
116 	['accessdate'] = '<span class="reference-accessdate">$1$2</span>',			-- to allow editors to hide accessdate using personal css
117 
118 	['bdi'] = '<bdi$1>$2</bdi>',												-- bidirectional isolation used with |script-title= and the like
119 
120 	['cite'] = '<cite class="$1">$2</cite>';									-- |ref= not set so no id="..." attribute
121 	['cite-id'] = '<cite id="$1" class="$2">$3</cite>';							-- for use when |ref= is set
122 
123 	['format'] = ' <span style="font-size:85%;">($1)</span>',					-- for |format=, |chapter-format=, etc
124 
125 	['italic-title'] = "''$1''",
126 
127 	['kern-left'] = '<span style="padding-left:0.2em;">$1</span>$2',			-- spacing to use when title contains leading single or double quote mark
128 	['kern-right'] = '$1<span style="padding-right:0.2em;">$2</span>',			-- spacing to use when title contains trailing single or double quote mark
129 
130 	['nowrap1'] = '<span class="nowrap">$1</span>',								-- for nowrapping an item: <span ...>yyyy-mm-dd</span>
131 	['nowrap2'] = '<span class="nowrap">$1</span> $2',							-- for nowrapping portions of an item: <span ...>dd mmmm</span> yyyy (note white space)
132 
133 	['ocins'] = '<span title="$1" class="Z3988"><span style="display:none;">&nbsp;</span></span>',		-- Note: Using display: none on the COinS span breaks some clients
134 
135 	['parameter'] = '<code style="'..code_style..'">&#124;$1=</code>',
136 
137 	['quoted-text'] = '<q>$1</q>',												-- for wrapping |quote= content
138 	['quoted-title'] = '"$1"',
139 
140 	['trans-italic-title'] = "&#91;''$1''&#93;",
141 	['trans-quoted-title'] = "&#91;$1&#93;",
142 	['vol-bold'] = ' <b>$1</b>',													-- for journal cites; for other cites ['vol'] in messages{}
143 	}
144 
145 	
146 --[[--------------------------< A L I A S E S >----------------------------------------------------------------
147 
148 Aliases table for commonly passed parameters
149 
150 ]]
151 
152 local aliases = {
153 	['AccessDate'] = {'access-date', 'accessdate'},
154 	['Agency'] = 'agency',
155 	['AirDate'] = {'air-date', 'airdate'},
156 	['ArchiveDate'] = {'archive-date', 'archivedate'},
157 	['ArchiveFormat'] = 'archive-format',
158 	['ArchiveURL'] = {'archive-url', 'archiveurl'},
159 	['ASINTLD'] = {'ASIN-TLD', 'asin-tld'},
160 	['At'] = 'at',
161 	['Authors'] = {'authors', 'people', 'host', 'credits'},
162 	['BookTitle'] = {'book-title', 'booktitle'},
163 	['Callsign'] = {'call-sign', 'callsign'},									-- cite interview
164 	['Cartography'] = 'cartography',
165 	['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
166 	['ChapterFormat'] = {'chapter-format', 'contribution-format', 'section-format'};
167 	['ChapterURL'] = {'chapter-url', 'chapterurl', 'contribution-url', 'contributionurl', 'section-url', 'sectionurl'},
168 	['City'] = 'city',															-- cite interview
169 	['Class'] = 'class',														-- cite arxiv and arxiv identifiers
170 	['Coauthors'] = {'coauthors', 'coauthor'},									-- coauthor and coauthors are deprecated; remove after 1 January 2015?
171 	['Collaboration'] = 'collaboration',
172 	['Conference'] = {'conference', 'event'},
173 	['ConferenceFormat'] = {'conference-format', 'event-format'},
174 	['ConferenceURL'] = {'conference-url', 'conferenceurl', 'event-url', 'eventurl'},
175 	['Contribution'] = 'contribution',											-- introduction, foreword, afterword, etc; required when |contributor= set
176 	['Date'] = {'date', 'air-date', 'airdate'},
177 	['DeadURL'] = {'dead-url', 'deadurl'},
178 	['Degree'] = 'degree',
179 	['DF'] = 'df',
180 	['DisplayAuthors'] = {'display-authors', 'displayauthors'},
181 	['DisplayEditors'] = {'display-editors', 'displayeditors'},
182 	['Docket'] = 'docket',
183 	['DoiBroken'] = {'doi-broken', 'doi-broken-date', 'doi-inactive-date', 'doi_brokendate', 'doi_inactivedate'},
184 	['Edition'] = 'edition',
185 	['Editors'] = 'editors',
186 	['Embargo'] = 'embargo',
187 	['Encyclopedia'] = {'encyclopedia', 'encyclopaedia'},						-- this one only used by citation
188 	['Episode'] = 'episode',													-- cite serial only TODO: make available to cite episode?
189 	['Format'] = 'format',
190 	['ID'] = {'id', 'ID'},
191 	['IgnoreISBN'] = {'ignore-isbn-error', 'ignoreisbnerror'},
192 	['Inset'] = 'inset',
193 	['Issue'] = {'issue', 'number'},
194 	['Language'] = {'language', 'in'},
195 	['LastAuthorAmp'] = {'last-author-amp', 'lastauthoramp'},
196 	['LayDate'] = {'lay-date', 'laydate'},
197 	['LayFormat'] = 'lay-format',
198 	['LaySource'] = {'lay-source', 'laysource'},
199 	['LayURL'] = {'lay-url', 'lay-summary', 'layurl', 'laysummary'},
200 	['MailingList'] = {'mailinglist', 'mailing-list'},							-- cite mailing list only
201 	['Map'] = 'map',															-- cite map only
202 	['MapFormat'] = 'map-format',												-- cite map only
203 	['MapURL'] = {'mapurl', 'map-url'},											-- cite map only
204 	['MessageID'] = 'message-id',
205 	['Minutes'] = 'minutes',
206 	['Mode'] = 'mode',
207 	['NameListFormat'] = 'name-list-format',
208 	['Network'] = 'network',
209 	['NoPP'] = {'no-pp', 'nopp'},
210 	['NoTracking'] = {'template-doc-demo', 'template doc demo', 'no-cat', 'nocat', 
211 		'no-tracking', 'notracking'},
212 	['Number'] = 'number',														-- this case only for cite techreport
213 	['OrigYear'] = {'orig-year', 'origyear'},
214 	['Others'] = {'others', 'interviewer', 'interviewers'},
215 	['Page'] = {'p', 'page'},
216 	['Pages'] = {'pp', 'pages'},
217 	['Periodical'] = {'journal', 'newspaper', 'magazine', 'work',
218 		'website',  'periodical', 'encyclopedia', 'encyclopaedia', 'dictionary', 'mailinglist'},
219 	['Place'] = {'place', 'location'},
220 	['Program'] = 'program',													-- cite interview
221 	['PostScript'] = 'postscript',
222 	['PublicationDate'] = {'publicationdate', 'publication-date'},
223 	['PublicationPlace'] = {'publication-place', 'publicationplace'},
224 	['PublisherName'] = {'publisher', 'distributor', 'institution', 'newsgroup'},
225 	['Quote'] = {'quote', 'quotation'},
226 	['Ref'] = 'ref',
227 	['RegistrationRequired'] = 'registration',
228 	['Scale'] = 'scale',
229 	['ScriptChapter'] = 'script-chapter',
230 	['ScriptTitle'] = 'script-title',
231 	['Section'] = 'section',
232 	['Season'] = 'season',
233 	['Sections'] = 'sections',													-- cite map only
234 	['Series'] = {'series', 'version'},
235 	['SeriesSeparator'] = 'series-separator',
236 	['SeriesLink'] = {'series-link', 'serieslink'},
237 	['SeriesNumber'] = {'series-number', 'series-no', 'seriesnumber', 'seriesno'},
238 	['Sheet'] = 'sheet',														-- cite map only
239 	['Sheets'] = 'sheets',														-- cite map only
240 	['Station'] = 'station',
241 	['SubscriptionRequired'] = 'subscription',
242 	['Time'] = 'time',
243 	['TimeCaption'] = {'time-caption', 'timecaption'},
244 	['Title'] = 'title',
245 	['TitleLink'] = {'title-link', 'episode-link', 'titlelink', 'episodelink'},
246 	['TitleNote'] = 'department',
247 	['TitleType'] = {'type', 'medium'},
248 	['TransChapter'] = {'trans-chapter', 'trans_chapter'},
249 	['TransMap'] = 'trans-map',													-- cite map only
250 	['Transcript'] = 'transcript',
251 	['TranscriptFormat'] = 'transcript-format',
252 	['TranscriptURL'] = {'transcript-url', 'transcripturl'},
253 	['TransTitle'] = {'trans-title', 'trans_title'},
254 	['URL'] = {'url', 'URL'},
255 	['Vauthors'] = 'vauthors',
256 	['Veditors'] = 'veditors',
257 	['Via'] = 'via',
258 	['Volume'] = 'volume',
259 	['Year'] = 'year',
260 
261 	['AuthorList-First'] = {"first#", "given#", "author-first#", "author#-first"},
262 	['AuthorList-Last'] = {"last#", "author#", "surname#", "author-last#", "author#-last", "subject#"},
263 	['AuthorList-Link'] = {"authorlink#", "author-link#", "author#-link", "subjectlink#", "author#link", "subject-link#", "subject#-link", "subject#link"},
264 	['AuthorList-Mask'] = {"author-mask#", "authormask#", "author#mask", "author#-mask"},
265 	
266 	['ContributorList-First'] = {'contributor-first#','contributor#-first'},
267 	['ContributorList-Last'] = {'contributor#', 'contributor-last#', 'contributor#-last'},
268 	['ContributorList-Link'] = {'contributor-link#', 'contributor#-link'},
269 	['ContributorList-Mask'] = {'contributor-mask#', 'contributor#-mask'},
270 
271 	['EditorList-First'] = {"editor-first#", "editor#-first", "editor-given#", "editor#-given"},
272 	['EditorList-Last'] = {"editor#", "editor-last#", "editor#-last", "editor-surname#", "editor#-surname"},
273 	['EditorList-Link'] = {"editor-link#", "editor#-link", "editorlink#", "editor#link"},
274 	['EditorList-Mask'] = {"editor-mask#", "editor#-mask", "editormask#", "editor#mask"},
275 	
276 	['TranslatorList-First'] = {'translator-first#','translator#-first'},
277 	['TranslatorList-Last'] = {'translator#', 'translator-last#', 'translator#-last'},
278 	['TranslatorList-Link'] = {'translator-link#', 'translator#-link'},
279 	['TranslatorList-Mask'] = {'translator-mask#', 'translator#-mask'},
280 }
281 
282 --[[--------------------------< D E F A U L T S >--------------------------------------------------------------
283 
284 Default parameter values
285 
286 TODO: keep this?  Only one default?
287 ]]
288 
289 local defaults = {
290 	['DeadURL'] = 'yes',
291 }
292 
293 
294 --[[--------------------------< V O L U M E ,  I S S U E ,  P A G E S >----------------------------------------
295 
296 These tables hold cite class values (from the template invocation) and identify those templates that support
297 |volume=, |issue=, and |page(s)= parameters.  Cite conference and cite map require further qualification which
298 is handled in the main module.
299 
300 ]]
301 
302 local templates_using_volume = {'citation', 'audio-visual', 'book', 'conference', 'encyclopaedia', 'interview', 'journal', 'magazine', 'map', 'news', 'report', 'techreport'}
303 local templates_using_issue = {'citation', 'conference', 'episode', 'interview', 'journal', 'magazine', 'map', 'news'}
304 local templates_not_using_page = {'audio-visual', 'episode', 'mailinglist', 'newsgroup', 'podcast', 'serial', 'sign', 'speech'}
305 
306 
307 
308 --[[--------------------------< K E Y W O R D S >--------------------------------------------------------------
309 
310 This table holds keywords for those parameters that have defined sets of acceptible keywords.
311 
312 ]]
313 
314 local keywords = {
315 	['yes_true_y'] = {'yes', 'true', 'y'},										-- ignore-isbn-error, last-author-amp, no-tracking, nopp, registration, subscription
316 	['deadurl'] = {'yes', 'true', 'y', 'no', 'unfit', 'usurped'},
317 	['mode'] = {'cs1', 'cs2'},
318 	['name-list-format'] = {'vanc'},
319 	['contribution'] = {'afterword', 'foreword', 'introduction', 'preface'},	-- generic contribution titles that are rendered unquoted in the 'chapter' position
320 	['date-format'] = {'dmy', 'dmy-all', 'mdy', 'mdy-all', 'ymd', 'ymd-all'}
321 }
322 
323 
324 --[[--------------------------< I N V I S I B L E _ C H A R A C T E R S >--------------------------------------
325 
326 This table holds non-printing or invisible characters indexed either by name or by Unicode group. Values are decimal
327 representations of UTF-8 codes.  The table is organized as a table of tables because the lua pairs keyword returns
328 table data in an arbitrary order.  Here, we want to process the table from top to bottom because the entries at
329 the top of the table are also found in the ranges specified by the entries at the bottom of the table.
330 
331 This list contains patterns for templates like {{'}} which isn't an error but transcludes characters that are
332 invisible.  These kinds of patterns must be recognized by the functions that use this list.
333 
334 Also here is a pattern that recognizes stripmarkers that begin and end with the delete characters.  The nowiki
335 stripmarker is not an error but some others are because the parameter values that include them become part of the
336 template's metadata before stripmarker replacement.
337 
338 ]]
339 
340 local invisible_chars = {
341 	{'replacement', '\239\191\189'},											-- U+FFFD, EF BF BD
342 --	{'apostrophe', '&zwj;\226\128\138\039\226\128\139'},						-- apostrophe template: &zwj; hair space ' zero-width space; not an error
343 	{'apostrophe', '\226\128\138\039\226\128\139'},								-- apostrophe template: hair space ' zero-width space; (as of 2015-12-11) not an error
344 	{'zero width joiner', '\226\128\141'},										-- U+200D, E2 80 8D
345 	{'zero width space', '\226\128\139'},										-- U+200B, E2 80 8B
346 	{'hair space', '\226\128\138'},												-- U+200A, E2 80 8A
347 	{'soft hyphen', '\194\173'},												-- U+00AD, C2 AD
348 	{'horizontal tab', '\009'},													-- U+0009 (HT), 09
349 	{'line feed', '\010'},														-- U+000A (LF), 0A
350 	{'carriage return', '\013'},												-- U+000D (CR), 0D
351 --	{'nowiki stripmarker', '\127UNIQ%-%-nowiki%-[%a%d]+%-QINU\127'},			-- nowiki stripmarker; not an error
352 	{'stripmarker', '\127UNIQ%-%-(%a+)%-[%a%d]+%-QINU\127'},					-- stripmarker; may or may not be an error; capture returns the stripmaker type
353 	{'delete', '\127'},															-- U+007F (DEL), 7F; must be done after stripmarker test
354 	{'C0 control', '[\000-\008\011\012\014-\031]'},								-- U+0000–U+001F (NULL–US), 00–1F (except HT, LF, CR (09, 0A, 0D))
355 	{'C1 control', '[\194\128-\194\159]'},										-- U+0080–U+009F (XXX–APC), C2 80 – C2 9F
356 --	{'Specials', '[\239\191\185-\239\191\191]'},								-- U+FFF9-U+FFFF, EF BF B9 – EF BF BF
357 --	{'Private use area', '[\238\128\128-\239\163\191]'},						-- U+E000–U+F8FF, EE 80 80 – EF A3 BF
358 --	{'Supplementary Private Use Area-A', '[\243\176\128\128-\243\191\191\189]'},	-- U+F0000–U+FFFFD, F3 B0 80 80 – F3 BF BF BD
359 --	{'Supplementary Private Use Area-B', '[\244\128\128\128-\244\143\191\189]'},	-- U+100000–U+10FFFD, F4 80 80 80 – F4 8F BF BD
360 }
361 
362 
363 --[[--------------------------< M A I N T E N A N C E _ C A T E G O R I E S >----------------------------------
364 
365 Here we name maintenance categories to be used in maintenance messages.
366 
367 ]]
368 
369 local maint_cats = {
370 	['ASIN'] = 'CS1 maint: ASIN uses ISBN',
371 	['date_year'] = 'CS1 maint: Date and year',
372 	['disp_auth_ed'] = 'CS1 maint: display-$1',									-- $1 is authors or editors
373 	['embargo'] = 'CS1 maint: PMC embargo expired',
374 	['english'] = 'CS1 maint: English language specified',
375 	['etal'] = 'CS1 maint: Explicit use of et al.',
376 	['extra_text'] = 'CS1 maint: Extra text',
377 	['unknown_lang'] = 'CS1 maint: Unrecognized language',
378 	['untitled'] = 'CS1 maint: Untitled periodical',
379 	}
380 
381 --[[--------------------------< P R O P E R T I E S _ C A T E G O R I E S >------------------------------------
382 
383 Here we name properties categories
384 
385 ]]
386 
387 local prop_cats = {
388 	['foreign_lang_source'] = 'CS1 $1-language sources ($2)',					-- |language= categories; $1 is language name, $2 is ISO639-1 code
389 	['script'] = 'CS1 uses foreign language script',							-- when language specified by |script-title=xx: doesn't have its own category
390 	['script_with_name'] = 'CS1 uses $1-language script ($2)',					-- |script-title=xx: has matching category; $1 is language name, $2 is ISO639-1 code
391 	}
392 
393 
394 
395 --[[--------------------------< T I T L E _ T Y P E S >--------------------------------------------------------
396 
397 Here we map a template's CitationClass to TitleType (default values for |type= parameter)
398 
399 ]]
400 
401 local title_types = {
402 	['AV-media-notes'] = 'Media notes',
403 	['DVD-notes'] = 'Media notes',
404 	['mailinglist'] = 'Mailing list',
405 	['map'] = 'Map',
406 	['podcast'] = 'Podcast',
407 	['pressrelease'] = 'Press release',
408 	['report'] = 'Report',
409 	['techreport'] = 'Technical report',
410 	['thesis'] = 'Thesis',
411 	}
412 
413 --[[--------------------------< E R R O R _ C O N D I T I O N S >----------------------------------------------
414 
415 Error condition table
416 
417 The following contains a list of IDs for various error conditions defined in the code.  For each ID, we specify a
418 text message to display, an error category to include, and whether the error message should be wrapped as a hidden comment.
419 
420 Anchor changes require identical changes to matching anchor in Help:CS1 errors
421 
422 ]]
423 
424 local error_conditions = {
425 	accessdate_missing_url = {
426 		message = '<code style="'..code_style..'">&#124;access-date=</code> requires <code style="'..code_style..'">&#124;url=</code>',
427 		anchor = 'accessdate_missing_url',
428 		category = 'Pages using citations with accessdate and no URL',
429 		hidden = true },
430 	archive_missing_date = {
431 		message = '<code style="'..code_style..'">&#124;archive-url=</code> requires <code style="'..code_style..'">&#124;archive-date=</code>',
432 		anchor = 'archive_missing_date',
433 		category = 'Pages with archiveurl citation errors',
434 		hidden = false },
435 	archive_missing_url = {
436 		message = '<code style="'..code_style..'">&#124;archive-url=</code> requires <code style="'..code_style..'">&#124;url=</code>',
437 		anchor = 'archive_missing_url',
438 		category = 'Pages with archiveurl citation errors',
439 		hidden = false },
440 	arxiv_missing = {
441 		message = '<code style="'..code_style..'">&#124;arxiv=</code> required',
442 		anchor = 'arxiv_missing',
443 		category = 'CS1 errors: arXiv',											-- same as bad arxiv
444 		hidden = false },
445 	arxiv_params_not_supported = {
446 		message = 'Unsupported parameter(s) in cite arXiv',
447 		anchor = 'arxiv_params_not_supported',
448 		category = 'CS1 errors: arXiv',											-- same as bad arxiv
449 		hidden = false },
450 	bad_arxiv = {
451 		message = 'Check <code style="'..code_style..'">&#124;arxiv=</code> value',
452 		anchor = 'bad_arxiv',
453 		category = 'CS1 errors: arXiv',
454 		hidden = false },
455 	bad_asin = {
456 		message = 'Check <code style="'..code_style..'">&#124;asin=</code> value',
457 		anchor = 'bad_asin',
458 		category ='CS1 errors: ASIN',
459 		hidden = false },
460 	bad_date = {
461 		message = 'Check date values in: <code style="'..code_style..'">$1</code>',
462 		anchor = 'bad_date',
463 		category = 'CS1 errors: dates',
464 		hidden = false },
465 	bad_doi = {
466 		message = 'Check <code style="'..code_style..'">&#124;doi=</code> value',
467 		anchor = 'bad_doi',
468 		category = 'CS1 errors: DOI',
469 		hidden = false },
470 	bad_hdl = {
471 		message = 'Check <code style="'..code_style..'">&#124;hdl=</code> value',
472 		anchor = 'bad_hdl',
473 		category = 'CS1 errors: HDL',
474 		hidden = false },
475 	bad_isbn = {
476 		message = 'Check <code style="'..code_style..'">&#124;isbn=</code> value',
477 		anchor = 'bad_isbn',
478 		category = 'CS1 errors: ISBN',
479 		hidden = false },
480 	bad_ismn = {
481 		message = 'Check <code style="'..code_style..'">&#124;ismn=</code> value',
482 		anchor = 'bad_ismn',
483 		category = 'CS1 errors: ISMN',
484 		hidden = false },
485 	bad_issn = {
486 		message = 'Check <code style="'..code_style..'">&#124;$1issn=</code> value',
487 		anchor = 'bad_issn',
488 		category = 'CS1 errors: ISSN',
489 		hidden = false },
490 	bad_lccn = {
491 		message = 'Check <code style="'..code_style..'">&#124;lccn=</code> value',
492 		anchor = 'bad_lccn',
493 		category = 'CS1 errors: LCCN',
494 		hidden = false },
495 	bad_message_id = {
496 		message = 'Check <code style="'..code_style..'">&#124;message-id=</code> value',
497 		anchor = 'bad_message_id',
498 		category = 'CS1 errors: message-id',
499 		hidden = false },
500 	bad_ol = {
501 		message = 'Check <code style="'..code_style..'">&#124;ol=</code> value',
502 		anchor = 'bad_ol',
503 		category = 'CS1 errors: OL',
504 		hidden = false },
505 	bad_paramlink = {															-- for |title-link=, |author/editor/translator-link=, |series-link=, |episode-link=
506 		message = 'Check <code style="'..code_style..'">&#124;$1=</code> value',
507 		anchor = 'bad_paramlink',
508 		category = 'CS1 errors: parameter link',
509 		hidden = false },
510 	bad_pmc = {
511 		message = 'Check <code style="'..code_style..'">&#124;pmc=</code> value',
512 		anchor = 'bad_pmc',
513 		category = 'CS1 errors: PMC',
514 		hidden = false },
515 	bad_pmid = {
516 		message = 'Check <code style="'..code_style..'">&#124;pmid=</code> value',
517 		anchor = 'bad_pmid',
518 		category = 'CS1 errors: PMID',
519 		hidden = false },
520 	bad_oclc = {
521 		message = 'Check <code style="'..code_style..'">&#124;oclc=</code> value',
522 		anchor = 'bad_oclc',
523 		category = 'CS1 errors: OCLC',
524 		hidden = false },
525 	bad_url = {
526 		message = 'Check <code style="'..code_style..'">$1</code> value',
527 		anchor = 'bad_url',
528 		category = 'Pages with URL errors',
529 		hidden = false },
530 	bare_url_missing_title = {
531 		message = '$1 missing title',
532 		anchor = 'bare_url_missing_title',
533 		category = 'Pages with citations having bare URLs',
534 		hidden = false },
535 	chapter_ignored = {
536 		message = '<code style="'..code_style..'">&#124;$1=</code> ignored',
537 		anchor = 'chapter_ignored',
538 		category = 'CS1 errors: chapter ignored',
539 		hidden = false },
540 	citation_missing_title = {
541 		message = 'Missing or empty <code style="'..code_style..'">&#124;$1=</code>',
542 		anchor = 'citation_missing_title',
543 		category = 'Pages with citations lacking titles',
544 		hidden = false },
545 	cite_web_url = {															-- this error applies to cite web and to cite podcast
546 		message = 'Missing or empty <code style="'..code_style..'">&#124;url=</code>',
547 		anchor = 'cite_web_url',
548 		category = 'Pages using web citations with no URL',
549 		hidden = true },
550 	coauthors_missing_author = {
551 		message = '<code style="'..code_style..'">&#124;coauthors=</code> requires <code style="'..code_style..'">&#124;author=</code>',
552 		anchor = 'coauthors_missing_author',
553 		category = 'CS1 errors: coauthors without author',
554 		hidden = false },
555 	contributor_ignored = {
556 		message = '<code style="'..code_style..'">&#124;contributor=</code> ignored</code>',
557 		anchor = 'contributor_ignored',
558 		category = 'CS1 errors: contributor',
559 		hidden = false },
560 	contributor_missing_required_param = {
561 		message = '<code style="'..code_style..'">&#124;contributor=</code> requires <code style="'..code_style..'">&#124;$1=</code>',
562 		anchor = 'contributor_missing_required_param',
563 		category = 'CS1 errors: contributor',
564 		hidden = false },
565 	deprecated_params = {
566 		message = 'Cite uses deprecated parameter <code style="'..code_style..'">&#124;$1=</code>',
567 		anchor = 'deprecated_params',
568 		category = 'Pages containing cite templates with deprecated parameters',
569 		hidden = false },
570 	empty_citation = {
571 		message = 'Empty citation',
572 		anchor = 'empty_citation',
573 		category = 'Pages with empty citations',
574 		hidden = false },
575 	first_missing_last = {
576 		message = '<code style="'..code_style..'">&#124;first$2=</code> missing <code style="'..code_style..'">&#124;last$2=</code> in $1',
577 		anchor = 'first_missing_last',
578 		category = 'CS1 errors: missing author or editor',
579 		hidden = false },
580 	format_missing_url = {
581 		message = '<code style="'..code_style..'">&#124;$1=</code> requires <code style="'..code_style..'">&#124;$2=</code>',
582 		anchor = 'format_missing_url',
583 		category = 'Pages using citations with format and no URL',
584 		hidden = true },
585 	invalid_param_val = {
586 		message = 'Invalid <code style="'..code_style..'">&#124;$1=$2</code>',
587 		anchor = 'invalid_param_val',
588 		category = 'CS1 errors: invalid parameter value',
589 		hidden = false },
590 	invisible_char = {
591 		message = '$1 in $2 at position $3',
592 		anchor = 'invisible_char',
593 		category = 'CS1 errors: invisible characters',
594 		hidden = false },
595 	missing_name = {
596 		message = 'Missing <code style="'..code_style..'">&#124;last$2=</code> in $1',
597 		anchor = 'missing_name',
598 		category = 'CS1 errors: missing author or editor',
599 		hidden = false },
600 	param_has_ext_link = {
601 		message = 'External link in <code style="'..code_style..'">$1</code>',
602 		anchor = 'param_has_ext_link',
603 		category = 'CS1 errors: external links',
604 		hidden = false },
605 	parameter_ignored = {
606 		message = 'Unknown parameter <code style="'..code_style..'">&#124;$1=</code> ignored',
607 		anchor = 'parameter_ignored',
608 		category = 'Pages with citations using unsupported parameters',
609 		hidden = false },
610 	parameter_ignored_suggest = {
611 		message = 'Unknown parameter <code style="'..code_style..'">&#124;$1=</code> ignored (<code style="'..code_style..'">&#124;$2=</code> suggested)',
612 		anchor = 'parameter_ignored_suggest',
613 		category = 'Pages with citations using unsupported parameters',
614 		hidden = false },
615 	redundant_parameters = {
616 		message = 'More than one of $1 specified',
617 		anchor = 'redundant_parameters',
618 		category = 'Pages with citations having redundant parameters',
619 		hidden = false },
620 	text_ignored = {
621 		message = 'Text "$1" ignored',
622 		anchor = 'text_ignored',
623 		category = 'Pages with citations using unnamed parameters',
624 		hidden = false },
625 	trans_missing_title = {
626 		message = '<code style="'..code_style..'">&#124;trans-$1=</code> requires <code style="'..code_style..'">&#124;$1=</code>',
627 		anchor = 'trans_missing_title',
628 		category = 'CS1 errors: translated title',
629 		hidden = false },
630 	vancouver = {
631 		message = 'Vancouver style error',
632 		anchor = 'vancouver',
633 		category = 'CS1 errors: Vancouver style',
634 		hidden = false },
635 	wikilink_in_url = {
636 		message = 'URL–wikilink conflict',										-- uses ndash
637 		anchor = 'wikilink_in_url',
638 		category = 'CS1 errors: URL–wikilink conflict',							-- uses ndash
639 		hidden = false },
640 }
641 
642 --[[--------------------------< I D _ H A N D L E R S >--------------------------------------------------------
643 
644 The following contains a list of values for various defined identifiers.  For each identifier we specify a
645 variety of information necessary to properly render the identifier in the citation.
646 
647 	parameters: a list of parameter aliases for this identifier
648 	link: Wikipedia article name
649 	label: the alternate name to apply to link
650 	mode: 	'manual' when there is a specific function in the code to handle the identifier;
651 			'external' for identifiers that link outside of Wikipedia;
652 	prefix: the first part of a url that will be concatenated with a second part which usually contains the identifier
653 	encode: true if uri should be percent encoded; otherwise false
654 	COinS: identifier link or keyword for use in COinS:
655 		for identifiers registered at info-uri.info use: info:....
656 		for identifiers that have COinS keywords, use the keyword: rft.isbn, rft.issn, rft.eissn
657 		for others make a url using the value in prefix, use the keyword: pre (not checked; any text other than 'info' or 'rft' works here)
658 		set to nil to leave the identifier out of the COinS
659 	separator: character or text between label and the identifier in the rendered citation
660 ]]
661 
662 local id_handlers = {
663 	['ARXIV'] = {
664 		parameters = {'arxiv', 'ARXIV', 'eprint'}, 
665 		link = 'arXiv',
666 		label = 'arXiv',
667 		mode = 'manual',
668 		prefix = '//arxiv.org/abs/', 											-- protocol relative tested 2013-09-04
669 		encode = false,
670 		COinS = 'info:arxiv',
671 		separator = ':',
672 	},
673 	['ASIN'] = {
674 		parameters = { 'asin', 'ASIN' },	   
675 		link = 'Amazon Standard Identification Number',
676 		label = 'ASIN',
677 		mode = 'manual',
678 		prefix = '//www.amazon.',
679 		COinS = nil,															-- no COinS for this id (needs thinking on implementation because |asin-tld=)
680 		separator = '&nbsp;',
681 		encode = false;
682 	},
683 	['BIBCODE'] = {
684 		parameters = {'bibcode', 'BIBCODE'}, 
685 		link = 'Bibcode',
686 		label = 'Bibcode',
687 		mode = 'external',
688 		prefix = 'http://adsabs.harvard.edu/abs/',
689 		encode = false,
690 		COinS = 'info:bibcode',
691 		separator = ':',
692 	},
693 	['DOI'] = {
694 		parameters = { 'doi', 'DOI' },
695 		link = 'Digital object identifier',
696 		label = 'doi',
697 		mode = 'manual',
698 		prefix = '//dx.doi.org/',
699 		COinS = 'info:doi',
700 		separator = ':',
701 		encode = true,
702 	},
703 	['EISSN'] = {
704 		parameters = {'eissn', 'EISSN'}, 
705 		link = 'International_Standard_Serial_Number#Electronic_ISSN',
706 		label = 'eISSN',
707 		mode = 'manual',
708 		prefix = '//www.worldcat.org/issn/',
709 		COinS = 'rft.eissn',
710 		encode = false,
711 		separator = '&nbsp;',
712 	},
713 	['HDL'] = {
714 		parameters = { 'hdl', 'HDL' },
715 		link = 'Handle System',
716 		label = 'hdl',
717 		mode = 'manual',
718 		prefix = '//hdl.handle.net/',
719 		COinS = 'info:hdl',
720 		separator = ':',
721 		encode = true,
722 	},
723 	['ISBN'] = {
724 		parameters = {'isbn', 'ISBN', 'isbn13', 'ISBN13'}, 
725 		link = 'International Standard Book Number',
726 		label = 'ISBN',
727 		mode = 'manual',
728 		prefix = 'Special:BookSources/',
729 		COinS = 'rft.isbn',
730 		separator = '&nbsp;',
731 	},
732 	['ISMN'] = {
733 		parameters = {'ismn', 'ISMN'}, 
734 		link = 'International Standard Music Number',
735 		label = 'ISMN',
736 		mode = 'manual',
737 		prefix = '',															-- not currently used; 
738 		COinS = 'nil',															-- nil because we can't use pre or rft or info:
739 		separator = '&nbsp;',
740 	},
741 	['ISSN'] = {
742 		parameters = {'issn', 'ISSN'}, 
743 		link = 'International Standard Serial Number',
744 		label = 'ISSN',
745 		mode = 'manual',
746 		prefix = '//www.worldcat.org/issn/',
747 		COinS = 'rft.issn',
748 		encode = false,
749 		separator = '&nbsp;',
750 	},
751 	['JFM'] = {
752 		parameters = {'jfm', 'JFM'}, 
753 		link = 'Jahrbuch über die Fortschritte der Mathematik',
754 		label = 'JFM',
755 		mode = 'external',
756 		prefix = '//zbmath.org/?format=complete&q=an:',
757 		COinS = 'pre',															-- use prefix value
758 		encode = true,
759 		separator = '&nbsp;',
760 	},
761 	['JSTOR'] = {
762 		parameters = {'jstor', 'JSTOR'}, 
763 		link = 'JSTOR',
764 		label = 'JSTOR',
765 		mode = 'external',
766 		prefix = '//www.jstor.org/stable/', 									-- protocol relative tested 2013-09-04
767 		COinS = 'pre',															-- use prefix value
768 		encode = false,
769 		separator = '&nbsp;',
770 	},
771 	['LCCN'] = {
772 		parameters = {'LCCN', 'lccn'}, 
773 		link = 'Library of Congress Control Number',
774 		label = 'LCCN',
775 		mode = 'manual',
776 		prefix = '//lccn.loc.gov/', 											-- protocol relative tested 2015-12-28
777 		COinS = 'info:lccn',													-- use prefix value
778 		encode = false,
779 		separator = '&nbsp;',
780 	},
781 	['MR'] = {
782 		parameters = {'MR', 'mr'}, 
783 		link = 'Mathematical Reviews',
784 		label = 'MR',
785 		mode = 'external',
786 		prefix = '//www.ams.org/mathscinet-getitem?mr=', 						-- protocol relative tested 2013-09-04
787 		COinS = 'pre',															-- use prefix value
788 		encode = true,
789 		separator = '&nbsp;',
790 	},
791 	['OCLC'] = {
792 		parameters = {'OCLC', 'oclc'}, 
793 		link = 'OCLC',
794 		label = 'OCLC',
795 		mode = 'manual',
796 		prefix = '//www.worldcat.org/oclc/',
797 		COinS = 'info:oclcnum',
798 		encode = true,
799 		separator = '&nbsp;',
800 	},
801 	['OL'] = {
802 		parameters = { 'ol', 'OL' },
803 		link = 'Open Library',
804 		label = 'OL',
805 		mode = 'manual',
806 		prefix = '//openlibrary.org/',
807 		COinS = nil,															-- no COinS for this id (needs thinking on implementation because /authors/books/works/OL)
808 		separator = '&nbsp;',
809 		encode = true,
810 	},
811 	['OSTI'] = {
812 		parameters = {'OSTI', 'osti'}, 
813 		link = 'Office of Scientific and Technical Information',
814 		label = 'OSTI',
815 		mode = 'external',
816 		prefix = '//www.osti.gov/energycitations/product.biblio.jsp?osti_id=',	-- protocol relative tested 2013-09-04
817 		COinS = 'pre',															-- use prefix value
818 		encode = true,
819 		separator = '&nbsp;',
820 	},
821 	['PMC'] = {
822 		parameters = {'PMC', 'pmc'}, 
823 		link = 'PubMed Central',
824 		label = 'PMC',
825 		mode = 'manual',
826 		prefix = '//www.ncbi.nlm.nih.gov/pmc/articles/PMC', 
827 		suffix = " ",
828 		COinS = 'pre',															-- use prefix value
829 		encode = true,
830 		separator = '&nbsp;',
831 	},
832 	['PMID'] = {
833 		parameters = {'PMID', 'pmid'}, 
834 		link = 'PubMed Identifier',
835 		label = 'PMID',
836 		mode = 'manual',
837 		prefix = '//www.ncbi.nlm.nih.gov/pubmed/',
838 		COinS = 'info:pmid',
839 		encode = false,
840 		separator = '&nbsp;',
841 	},
842 	['RFC'] = {
843 		parameters = {'RFC', 'rfc'}, 
844 		link = 'Request for Comments',
845 		label = 'RFC',
846 		mode = 'external',
847 		prefix = '//tools.ietf.org/html/rfc',
848 		COinS = 'pre',															-- use prefix value
849 		encode = false,
850 		separator = '&nbsp;',
851 	},
852 	['SSRN'] = {
853 		parameters = {'SSRN', 'ssrn'}, 
854 		link = 'Social Science Research Network',
855 		label = 'SSRN',
856 		mode = 'external',
857 		prefix = '//ssrn.com/abstract=', 										-- protocol relative tested 2013-09-04
858 		COinS = 'pre',															-- use prefix value
859 		encode = true,
860 		separator = '&nbsp;',
861 	},
862 	['USENETID'] = {
863 		parameters = {'message-id'},
864 		link = 'Usenet',
865 		label = 'Usenet:',
866 		mode = 'manual',
867 		prefix = 'news:',
868 		encode = false,
869 		COinS = 'pre',															-- use prefix value
870 		separator = '&nbsp;',
871 	},
872 	['ZBL'] = {
873 		parameters = {'ZBL', 'zbl'}, 
874 		link = 'Zentralblatt MATH',
875 		label = 'Zbl',
876 		mode = 'external',
877 		prefix = '//zbmath.org/?format=complete&q=an:',
878 		COinS = 'pre',															-- use prefix value
879 		encode = true,
880 		separator = '&nbsp;',
881 	},
882 }
883 
884 return 	{
885 	aliases = aliases,
886 	defaults = defaults,
887 	error_conditions = error_conditions,
888 	id_handlers = id_handlers,
889 	keywords = keywords,
890 	invisible_chars = invisible_chars,
891 	maint_cats = maint_cats,
892 	messages = messages,
893 	presentation = presentation,
894 	prop_cats = prop_cats,
895 	title_types = title_types,
896 	uncategorized_namespaces = uncategorized_namespaces,
897 	uncategorized_subpages = uncategorized_subpages,
898 	templates_using_volume = templates_using_volume,
899 	templates_using_issue = templates_using_issue,
900 	templates_not_using_page = templates_not_using_page,
901 	}