Module:Citation/CS1/Configuration: Difference between revisions

Jump to navigation Jump to search
Synch from sandbox;
(Synch from sandbox;)
(Synch from sandbox;)
Line 1:
 
local citation_config = {};
 
-- override <code>...</code> styling to remove color, border, and padding. <code> css is specified here:
Line 13:
 
]]
local uncategorized_namespaces = { 'User', 'Talk', 'User_talk', 'Wikipedia_talk', 'File_talk', 'Template_talk',
 
citation_config.uncategorized_namespaces = { 'User', 'Talk', 'User_talk', 'Wikipedia_talk', 'File_talk', 'Template_talk',
'Help_talk', 'Category_talk', 'Portal_talk', 'Book_talk', 'Draft', 'Draft_talk', 'Education_Program_talk',
'Module_talk', 'MediaWiki_talk' };
 
local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases'}; -- list of Lua patterns found in page names of pages we should not categorize
 
--[[--------------------------< M E S S A G E S >--------------------------------------------------------------
Line 28 ⟶ 29:
]]
 
citation_config.local messages = {
['published'] = 'published $1',
['lay summary'] = 'Lay summary',
Line 41 ⟶ 42:
['editors'] = 'eds.',
['edition'] = '($1 ed.)',
['episode'] = 'episodeEpisode $1',
['season'] = 'seasonSeason $1',
['series'] = 'seriesSeries $1',
['cartography'] = 'Cartography by $1',
-- ['section'] = 'Section $1',
['section'] = '§ $1',
['sections'] = '§§ $1',
Line 86:
 
]]
citation_config.local presentation =
{
-- Error output
Line 97:
 
['bdi'] = '<bdi$1>$2</bdi>', -- bidirectional isolation used with |script-title= and the like
 
['format'] = ' <span style="font-size:85%;">($1)</span>', -- for |format=, |chapter-format=, etc
 
['italic-title'] = "''$1''",
Line 121 ⟶ 123:
]]
 
citation_config.local aliases = {
['AccessDate'] = {'access-date', 'accessdate'},
['Agency'] = 'agency',
['AirDate'] = {'air-date', 'airdate'},
['ArchiveDate'] = {'archive-date', 'archivedate'},
['ArchiveFormat'] = 'archive-format',
['ArchiveURL'] = {'archive-url', 'archiveurl'},
['ASINTLD'] = {'ASIN-TLD', 'asin-tld'},
['At'] = 'at',
['Authors'] = {'authors', 'people', 'host', 'credits'},
['AuthorFormat'] = {'author-format', 'authorformat'}, -- deprecated in favor of NameListFormat;
['AuthorSeparator'] = 'author-separator', -- deprecated
['AuthorNameSeparator'] = 'author-name-separator', -- deprecated
['Began'] = 'began', -- cite episode and cite series
['BookTitle'] = {'book-title', 'booktitle'},
['Callsign'] = {'call-sign', 'callsign'}, -- cite interview
['Cartography'] = 'cartography',
['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
['ChapterFormat'] = {'chapter-format', 'contribution-format', 'section-format'};
['ChapterLink'] = {'chapter-link', 'chapterlink'}, -- deprecated; remove after 1 January 2015?
['ChapterURL'] = {'chapter-url', 'chapterurl', 'contribution-url', 'contributionurl', 'section-url', 'sectionurl'},
['City'] = 'city', -- cite interview
['Class'] = 'class', -- cite arxiv and arxiv identifiers
['Coauthors'] = {'coauthors', 'coauthor'}, -- coauthor and coauthors are deprecated; remove after 1 January 2015?
['Conference'] = {'conference', 'event'},
['ConferenceFormat'] = {'conference-format', 'event-format'},
['ConferenceURL'] = {'conference-url', 'conferenceurl', 'event-url', 'eventurl'},
['Date'] = {'date', 'air-date', 'airdate'},
['DeadURL'] = {'dead-url', 'deadurl'},
['Degree'] = 'degree',
Line 150 ⟶ 156:
['DisplayEditors'] = {'display-editors', 'displayeditors'},
['Docket'] = 'docket',
['DoiBroken'] = {'doi-broken', 'doi-broken-date', 'doi-inactive-date', 'DoiBroken', 'doi_brokendate', 'doi_inactivedate'},
['Edition'] = 'edition',
['Editors'] = 'editors',
Line 156 ⟶ 162:
['EditorSeparator'] = 'editor-separator', -- deprecated
['EditorNameSeparator'] = 'editor-name-separator', -- deprecated
['Embargo'] = {'Embargo', 'embargo'},
['Encyclopedia'] = {'encyclopedia', 'encyclopaedia'}, -- this one only used by citation
['Ended'] = 'ended', -- cite episode and cite series
['Episode'] = 'episode', -- cite serial only TODO: make available to cite episode?
['Format'] = 'format',
['ID'] = {'id', 'ID'},
Line 166 ⟶ 174:
['LastAuthorAmp'] = {'last-author-amp', 'lastauthoramp'},
['LayDate'] = {'lay-date', 'laydate'},
['LayFormat'] = 'lay-format',
['LaySource'] = {'lay-source', 'laysource'},
['LayURL'] = {'lay-url', 'lay-summary', 'layurl', 'laysummary'},
Line 190 ⟶ 199:
['Place'] = {'place', 'location'},
['PPrefix'] = {'p-prefix', 'PPrefix'},
['PPPrefix'] = {'pp-prefix', 'PPPrefix'},
['Program'] = 'program', -- cite interview
['PostScript'] = 'postscript',
Line 209 ⟶ 218:
['SeriesLink'] = {'series-link', 'serieslink'},
['SeriesNumber'] = {'series-number', 'series-no', 'seriesnumber', 'seriesno'},
['Sheet'] = 'sheet', -- cite map only
['Sheets'] = 'sheets', -- cite map only
['Station'] = 'station',
['SubscriptionRequired'] = 'subscription',
Line 218 ⟶ 229:
['TitleType'] = {'type', 'medium'},
['TransChapter'] = {'trans-chapter', 'trans_chapter'},
['TransMap'] = 'trans-map', -- cite map only
['Transcript'] = 'transcript',
['TranscriptFormat'] = 'transcript-format',
['TranscriptURL'] = {'transcript-url', 'transcripturl'},
['TransTitle'] = {'trans-title', 'trans_title'},
Line 226 ⟶ 239:
['Year'] = 'year',
 
['AuthorList-First'] = {"author#-first", "author-first#", "first#", "given#"},
['AuthorList-Last'] = {"author#-last", "author-last#", "last#", "surname#", "Author#", "author#", "subject#"},
"first#", "given#"},
['AuthorList-LastLink'] = {"author#-lastlink", "author-lastlink#", "author#link", "authorlink#", "subject-link#", "subject#link", "subject#-link", "subjectlink#"},
"last#", ['AuthorList-Mask'] "surname#",= {"Authorauthor#-mask", "author-mask#", "authorsauthor#mask", "subjectauthormask#"},
['AuthorList-Link'] = {"author#-link", "author-link#",
"author#link", "authorlink#", "subject-link#", "subject#link", "subject#-link", "subjectlink#"},
['AuthorList-Mask'] = {"author#-mask", "author-mask#",
"author#mask", "authormask#"},
['EditorList-First'] = {"editor#-first",
"editor-first#", "editor#-given", "editor-given#", "EditorGiven#"},
['EditorList-Last'] = {"editor#-last", "editor-last#",
"editor#-surname", "editor-surname#", "EditorSurname#", "Editor#", "editor#", "editors#"},
['EditorList-Link'] = {"editor#-link", "editor-link#",
"editor#link", "editorlink#"},
['EditorList-Mask'] = {"editor#-mask", "editor-mask#",
"editor#mask", "editormask#"},
['EditorList-First'] = {"editor#-first", "editor-first#", "editor#-given", "editor-given#", "EditorGiven#"},
['EditorList-Last'] = {"editor#-last", "editor-last#", "editor#-surname", "editor-surname#", "EditorSurname#", "Editor#", "editor#", "editors#"},
['EditorList-Link'] = {"editor#-link", "editor-link#", "editor#link", "editorlink#"},
['EditorList-Mask'] = {"editor#-mask", "editor-mask#", "editor#mask", "editormask#"},
}
 
--[[--------------------------< D E F A U L T S >--------------------------------------------------------------
 
-- Default parameter values
 
citation_config.defaults = {
]]
 
local defaults = {
['DeadURL'] = 'yes',
['PPrefix'] = "p.&nbsp;",
['PPPrefix'] = "pp.&nbsp;",
}
 
--[[--------------------------< M A I N T E N A N C E _ C A T E G O R I E S >----------------------------------
 
Here we name maintenance categories to be used in maintenance messages.
 
]]
 
local maint_cats = {
['ASIN'] = 'CS1 maint: ASIN uses ISBN',
['date_year'] = 'CS1 maint: Date and year',
['disp_auth_ed'] = 'CS1 maint: display-$1', -- $1 is authors or editors
['embargo'] = 'CS1 maint: PMC embargo expired',
['english'] = 'CS1 maint: English language specified',
['etal'] = 'CS1 maint: Explicit use of et al.',
['unknown_lang'] = 'CS1 maint: Unrecognized language',
['untitled'] = 'CS1 maint: Untitled periodical',
}
 
--[[--------------------------< P R O P E R T I E S _ C A T E G O R I E S >------------------------------------
 
Here we name properties categories
 
]]
 
local prop_cats = {
['foreign_lang_source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is language name, $2 is ISO639-1 code
['script'] = 'CS1 uses foreign language script', -- when language specified by |script-title=xx: doesn't have its own category
['script_with_name'] = 'CS1 uses $1-language script ($2)', -- |script-title=xx: has matching category; $1 is language name, $2 is ISO639-1 code
}
 
 
 
--[[--------------------------< T I T L E _ T Y P E S >--------------------------------------------------------
 
Here we map a template's CitationClass to TitleType
 
]]
 
local title_types = {
['AV-media-notes'] = 'Media notes',
['DVD-notes'] = 'Media notes',
['mailinglist'] = 'Mailing list',
['map'] = 'Map',
['podcast'] = 'Podcast',
['pressrelease'] = 'Press release',
['report'] = 'Report',
['techreport'] = 'Technical report',
['thesis'] = 'Thesis',
}
 
--[[--------------------------< E R R O R _ C O N D I T I O N S >----------------------------------------------
 
Error condition table
 
Line 264 ⟶ 323:
]]
 
citation_config.local error_conditions = {
accessdate_missing_url = {
message = '<code style="'..code_style..'">&#124;accessdate=</code> requires <code style="'..code_style..'">&#124;url=</code>',
Line 279 ⟶ 338:
anchor = 'archive_missing_url',
category = 'Pages with archiveurl citation errors',
hidden = false },
arxiv_missing = {
message = '<code style="'..code_style..'">&#124;arxiv=</code> required',
anchor = 'arxiv_missing',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false },
arxiv_params_not_supported = {
message = 'Unsupported parameter(s) in cite arXiv',
anchor = 'arxiv_params_not_supported',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false },
bad_arxiv = {
Line 452 ⟶ 521:
}
 
--[[--------------------------< I D _ H A N D L E R S >--------------------------------------------------------
citation_config.id_handlers = {
 
The following contains a list of values for various defined identifiers. For each identifier we specify a
variety of information necessary to properly render the identifier in the citation.
 
parameters: a list of parameter aliases for this identifier
link: Wikipedia article name
label: the alternate name to apply to link
mode: 'manual' when there is a specific function in the code to handle the identifier;
'external' for identifiers that link outside of Wikipedia;
prefix: the first part of a url that will be concatenated with a second part which usually contains the identifier
encode: true if uri should be percent encoded; otherwise false
COinS: into rft.id
separator: character or text between label and the identifier in the rendered citation
]]
 
local id_handlers = {
['ARXIV'] = {
parameters = {'arxiv', 'ARXIV', 'eprint'},
link = 'arXiv',
label = 'arXiv',
Line 528 ⟶ 613:
prefix = '//www.jstor.org/stable/', -- protocol relative tested 2013-09-04
COinS = 'rft.jstor',
-- encode = true,
encode = false,
separator = '&nbsp;',
Line 644 ⟶ 728:
}
 
return citation_config; {
aliases = aliases,
defaults = defaults,
error_conditions = error_conditions,
id_handlers = id_handlers,
maint_cats = maint_cats,
messages = messages,
presentation = presentation,
prop_cats = prop_cats,
title_types = title_types,
uncategorized_namespaces = uncategorized_namespaces,
uncategorized_subpages = uncategorized_subpages,
}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu