Module:Citation/CS1/Configuration: Difference between revisions

Synch from sandbox;
m>Trappist the monk
(Synch from sandbox;)
m>Trappist the monk
(Synch from sandbox;)
Line 1: Line 1:


citation_config = {};
local citation_config = {};


-- override <code>...</code> styling to remove color, border, and padding.  <code> css is specified here:
-- override <code>...</code> styling to remove color, border, and padding.  <code> css is specified here:
Line 13: 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',  
'Help_talk', 'Category_talk', 'Portal_talk', 'Book_talk', 'Draft', 'Draft_talk', 'Education_Program_talk',  
'Module_talk', 'MediaWiki_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 >--------------------------------------------------------------
--[[--------------------------< M E S S A G E S >--------------------------------------------------------------
Line 28: Line 29:
]]
]]


citation_config.messages = {
local messages = {
   ['published'] = 'published $1',
   ['published'] = 'published $1',
   ['lay summary'] = 'Lay summary',
   ['lay summary'] = 'Lay summary',
Line 41: Line 42:
   ['editors'] = 'eds.',  
   ['editors'] = 'eds.',  
   ['edition'] = '($1 ed.)',  
   ['edition'] = '($1 ed.)',  
   ['episode'] = 'episode',
   ['episode'] = 'Episode $1',
   ['season'] = 'season',  
   ['season'] = 'Season $1',  
   ['series'] = 'series',
   ['series'] = 'Series $1',
   ['cartography'] = 'Cartography by $1',
   ['cartography'] = 'Cartography by $1',
--  ['section'] = 'Section $1',
   ['section'] = '§ $1',
   ['section'] = '§ $1',
   ['sections'] = '§§ $1',
   ['sections'] = '§§ $1',
Line 86: Line 86:


]]
]]
citation_config.presentation =  
local presentation =  
{
{
-- Error output
-- Error output
Line 97: Line 97:


['bdi'] = '<bdi$1>$2</bdi>', -- bidirectional isolation used with |script-title= and the like
['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''",
['italic-title'] = "''$1''",
Line 121: Line 123:
]]
]]


citation_config.aliases = {
local aliases = {
['AccessDate'] = {'access-date', 'accessdate'},
['AccessDate'] = {'access-date', 'accessdate'},
['Agency'] = 'agency',
['Agency'] = 'agency',
['AirDate'] = {'air-date', 'airdate'},
['AirDate'] = {'air-date', 'airdate'},
['ArchiveDate'] = {'archive-date', 'archivedate'},
['ArchiveDate'] = {'archive-date', 'archivedate'},
['ArchiveFormat'] = 'archive-format',
['ArchiveURL'] = {'archive-url', 'archiveurl'},
['ArchiveURL'] = {'archive-url', 'archiveurl'},
['ASINTLD'] = {'ASIN-TLD', 'asin-tld'},
['ASINTLD'] = {'ASIN-TLD', 'asin-tld'},
['At'] = 'at',
['At'] = 'at',
['Authors'] = {'authors', 'people', 'host'},
['Authors'] = {'authors', 'people', 'host', 'credits'},
['AuthorFormat'] = {'author-format', 'authorformat'}, -- deprecated in favor of NameListFormat;
['AuthorFormat'] = {'author-format', 'authorformat'}, -- deprecated in favor of NameListFormat;
['AuthorSeparator'] = 'author-separator', -- deprecated
['AuthorSeparator'] = 'author-separator', -- deprecated
['AuthorNameSeparator'] = 'author-name-separator', -- deprecated
['AuthorNameSeparator'] = 'author-name-separator', -- deprecated
['Began'] = 'began', -- cite episode and cite series
['BookTitle'] = {'book-title', 'booktitle'},
['BookTitle'] = {'book-title', 'booktitle'},
['Callsign'] = {'call-sign', 'callsign'}, -- cite interview
['Callsign'] = {'call-sign', 'callsign'}, -- cite interview
['Cartography'] = 'cartography',
['Cartography'] = 'cartography',
['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
['ChapterFormat'] = 'chapter-format';
['ChapterFormat'] = {'chapter-format', 'contribution-format', 'section-format'};
['ChapterLink'] = {'chapter-link', 'chapterlink'}, -- deprecated; remove after 1 January 2015?
['ChapterLink'] = {'chapter-link', 'chapterlink'}, -- deprecated; remove after 1 January 2015?
['ChapterURL'] = {'chapter-url', 'chapterurl', 'contribution-url', 'contributionurl', 'section-url', 'sectionurl'},
['ChapterURL'] = {'chapter-url', 'chapterurl', 'contribution-url', 'contributionurl', 'section-url', 'sectionurl'},
['City'] = 'city', -- cite interview
['City'] = 'city', -- cite interview
['Class'] = 'class', -- cite arxiv and arxiv identifiers
['Coauthors'] = {'coauthors', 'coauthor'}, -- coauthor and coauthors are deprecated; remove after 1 January 2015?
['Coauthors'] = {'coauthors', 'coauthor'}, -- coauthor and coauthors are deprecated; remove after 1 January 2015?
['Conference'] = {'conference', 'event'},
['Conference'] = {'conference', 'event'},
['ConferenceFormat'] = {'conference-format', 'event-format'},
['ConferenceURL'] = {'conference-url', 'conferenceurl', 'event-url', 'eventurl'},
['ConferenceURL'] = {'conference-url', 'conferenceurl', 'event-url', 'eventurl'},
['Date'] = 'date',
['Date'] = {'date', 'air-date', 'airdate'},
['DeadURL'] = {'dead-url', 'deadurl'},
['DeadURL'] = {'dead-url', 'deadurl'},
['Degree'] = 'degree',
['Degree'] = 'degree',
Line 150: Line 156:
['DisplayEditors'] = {'display-editors', 'displayeditors'},
['DisplayEditors'] = {'display-editors', 'displayeditors'},
['Docket'] = 'docket',
['Docket'] = 'docket',
['DoiBroken'] = {'doi-broken', 'doi-broken-date', 'doi-inactive-date', 'DoiBroken', 'doi_brokendate', 'doi_inactivedate'},
['DoiBroken'] = {'doi-broken', 'doi-broken-date', 'doi-inactive-date', 'doi_brokendate', 'doi_inactivedate'},
['Edition'] = 'edition',
['Edition'] = 'edition',
['Editors'] = 'editors',
['Editors'] = 'editors',
Line 156: Line 162:
['EditorSeparator'] = 'editor-separator', -- deprecated
['EditorSeparator'] = 'editor-separator', -- deprecated
['EditorNameSeparator'] = 'editor-name-separator', -- deprecated
['EditorNameSeparator'] = 'editor-name-separator', -- deprecated
['Embargo'] = {'Embargo', 'embargo'},
['Embargo'] = 'embargo',
['Encyclopedia'] = {'encyclopedia', 'encyclopaedia'}, -- this one only used by citation
['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',
['Format'] = 'format',
['ID'] = {'id', 'ID'},
['ID'] = {'id', 'ID'},
Line 166: Line 174:
['LastAuthorAmp'] = {'last-author-amp', 'lastauthoramp'},
['LastAuthorAmp'] = {'last-author-amp', 'lastauthoramp'},
['LayDate'] = {'lay-date', 'laydate'},
['LayDate'] = {'lay-date', 'laydate'},
['LayFormat'] = 'lay-format',
['LaySource'] = {'lay-source', 'laysource'},
['LaySource'] = {'lay-source', 'laysource'},
['LayURL'] = {'lay-url', 'lay-summary', 'layurl', 'laysummary'},
['LayURL'] = {'lay-url', 'lay-summary', 'layurl', 'laysummary'},
Line 190: Line 199:
['Place'] = {'place', 'location'},
['Place'] = {'place', 'location'},
['PPrefix'] = {'p-prefix', 'PPrefix'},
['PPrefix'] = {'p-prefix', 'PPrefix'},
['PPPrefix'] = {'pp-prefix', 'PPPrefix'},
['PPPrefix'] = 'pp-prefix',
['Program'] = 'program', -- cite interview
['Program'] = 'program', -- cite interview
['PostScript'] = 'postscript',
['PostScript'] = 'postscript',
Line 209: Line 218:
['SeriesLink'] = {'series-link', 'serieslink'},
['SeriesLink'] = {'series-link', 'serieslink'},
['SeriesNumber'] = {'series-number', 'series-no', 'seriesnumber', 'seriesno'},
['SeriesNumber'] = {'series-number', 'series-no', 'seriesnumber', 'seriesno'},
['Sheet'] = 'sheet', -- cite map only
['Sheets'] = 'sheets', -- cite map only
['Station'] = 'station',
['Station'] = 'station',
['SubscriptionRequired'] = 'subscription',
['SubscriptionRequired'] = 'subscription',
Line 218: Line 229:
['TitleType'] = {'type', 'medium'},
['TitleType'] = {'type', 'medium'},
['TransChapter'] = {'trans-chapter', 'trans_chapter'},
['TransChapter'] = {'trans-chapter', 'trans_chapter'},
['TransMap'] = 'trans-map', -- cite map only
['Transcript'] = 'transcript',
['Transcript'] = 'transcript',
['TranscriptFormat'] = 'transcript-format',
['TranscriptURL'] = {'transcript-url', 'transcripturl'},
['TranscriptURL'] = {'transcript-url', 'transcripturl'},
['TransTitle'] = {'trans-title', 'trans_title'},
['TransTitle'] = {'trans-title', 'trans_title'},
Line 226: Line 239:
['Year'] = 'year',
['Year'] = 'year',


['AuthorList-First'] = {"author#-first", "author-first#",
['AuthorList-First'] = {"author#-first", "author-first#", "first#", "given#"},
"first#", "given#"},
['AuthorList-Last'] = {"author#-last", "author-last#", "last#", "surname#", "Author#", "author#", "subject#"},
['AuthorList-Last'] = {"author#-last", "author-last#",  
['AuthorList-Link'] = {"author#-link", "author-link#", "author#link", "authorlink#", "subject-link#", "subject#link", "subject#-link", "subjectlink#"},
"last#", "surname#", "Author#", "author#", "authors#", "subject#"},
['AuthorList-Mask'] = {"author#-mask", "author-mask#", "author#mask", "authormask#"},
['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
-- Default parameter values
citation_config.defaults = {
 
]]
 
local defaults = {
['DeadURL'] = 'yes',
['DeadURL'] = 'yes',
['PPrefix'] = "p.&nbsp;",
['PPrefix'] = "p.&nbsp;",
['PPPrefix'] = "pp.&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 >----------------------------------------------
--[[--------------------------< E R R O R _ C O N D I T I O N S >----------------------------------------------
Error condition table
Error condition table


Line 264: Line 323:
]]
]]


citation_config.error_conditions = {
local error_conditions = {
accessdate_missing_url = {
accessdate_missing_url = {
message = '<code style="'..code_style..'">&#124;accessdate=</code> requires <code style="'..code_style..'">&#124;url=</code>',
message = '<code style="'..code_style..'">&#124;accessdate=</code> requires <code style="'..code_style..'">&#124;url=</code>',
Line 279: Line 338:
anchor = 'archive_missing_url',
anchor = 'archive_missing_url',
category = 'Pages with archiveurl citation errors',
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 },
hidden = false },
bad_arxiv = {
bad_arxiv = {
Line 452: Line 521:
}
}


citation_config.id_handlers = {
--[[--------------------------< I D _ H A N D L E R S >--------------------------------------------------------
 
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'] = {
['ARXIV'] = {
parameters = {'arxiv', 'ARXIV'},  
parameters = {'arxiv', 'ARXIV', 'eprint'},  
link = 'arXiv',
link = 'arXiv',
label = 'arXiv',
label = 'arXiv',
Line 528: Line 613:
prefix = '//www.jstor.org/stable/', -- protocol relative tested 2013-09-04
prefix = '//www.jstor.org/stable/', -- protocol relative tested 2013-09-04
COinS = 'rft.jstor',
COinS = 'rft.jstor',
-- encode = true,
encode = false,
encode = false,
separator = '&nbsp;',
separator = '&nbsp;',
Line 644: Line 728:
}
}


return citation_config;
return {
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