Module:Citation/CS1: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
D'oh, meant to edit sandbox
sync to sandbox, mostly translation handles almost uniformity for archiveurl errors.
வரிசை 4:
message_tail = {};
}
 
local SEEN = {};
local DATA = {};
 
-- Include translation message hooks, ID and error handling configuration settings.
local cfg = mw.loadDatarequire( 'Module:Citation/CS1/Configuration' );
-- Contains a list of all recognized parameters
local whitelist = mw.loadData( 'Module:Citation/CS1/Whitelist' );
 
-- Populates numbered arguments in a message string using
-- Checks that parameter name is valid
-- an argument table.
function substitute( message, arguments )
if arguments == nil then
return message;
end
message = message .. " ";
for k, v in ipairs( arguments ) do
v = v:gsub( "%%", "%%%%" );
message = message:gsub( "$" .. k .. "(%D)", v .. "%1" );
end
message = message:sub(1,-2);
return message;
end
 
--[[
Argument wrapper. This function provides support for argument
mapping defined in the configuration file so that multiple names
can be transparently aliased to single internal variable.
]]
function argument_wrapper( args )
DATA = args;
local tbl = {};
local mt = {
__index = function ( tbl, k )
if SEEN[k] then
return nil;
end
local list = cfg.argument_map[k];
 
if list == nil then
error( cfg.message_list['unknown_argument_map'] );
elseif type( list ) == 'string' then
v = DATA[list];
else
v = selectone( DATA, cfg.argument_map[k],
'redundant_parameters' );
end
if v == nil then
v = cfg.default_values[k];
end
SEEN[k] = true;
tbl = rawset( tbl, k, v );
return v;
end,
}
return setmetatable( tbl, mt );
end
 
-- Checks that parameter name is valid using the whitelist
function validate( name )
name = tostring( name );
வரி 33 ⟶ 89:
function errorcomment( content, hidden )
if hidden then
return substitute( cfg.message_list['<span style="display:none;fonthidden-size:100%" class="error citation-comment">'], ..{ content ..} '</span>');
else
return substitute( cfg.message_list['<span style="fontvisible-size:100%" class="error">'], ..{ content ..} '</span>');
end
end
வரி 43 ⟶ 99:
of the error message in the output is the responsibility of the calling function.
]]
function seterror( error_id, argsarguments, raw, prefix, suffix )
local error_state = cfg.error_conditions[ error_id ];
prefix = prefix or "";
வரி 57 ⟶ 113:
local message = error_state.message;
message = substitute( message, arguments );
if args ~= nil then
for k, m in ipairs( args ) do
m = m:gsub( "%%", "%%%%" );
message = message:gsub( "$" .. k .. "(%D)", m .. "%1" );
end
end
 
message = wikiescape(message) .. " ([[" .. cfg.message_list['help page link'] ..
வரி 91 ⟶ 142:
[']'] = '&#93;',
['{'] = '&#123;',
['|'] = '&#124;',
['}'] = '&#125;' } );
return text;
வரி 289 ⟶ 340:
if str:sub(1,1) == "'" then str = "<span />" .. str; end
if str:sub(-1,-1) == "'" then str = str .. "<span />"; end
-- Remove newlines as they break italics.
return str:gsub( '\n', ' ' );
end
வரி 458 ⟶ 511:
end
 
-- Gets authorname list from the input arguments
function extractauthorsextractnames(args, list_name)
local authorsnames = {};
local i = 1;
local last;
while true do
if i == 1 then
last = selectone( args, {"author" .. i .. "-last", "author-last" .. i,
"last" .. i, "surname" .. i, "Author" .. i, "author" .. i,
"author-last", "last", "surname", "Author", "author", "authors"}, 'redundant_parameters' );
else
last = selectone( args, {"author" .. i .. "-last", "author-last" .. i,
"last" .. i, "surname" .. i, "Author" .. i, "author" .. i}, 'redundant_parameters' );
end
if ( last and "" < last ) then -- just in case someone passed in an empty parameter
if i == 1 then
authors[i] = {
last = last,
first = selectone( args, {"author" .. i .. "-first", "author-first" .. i,
"first" .. i, "given" .. i, "author-first",
"first", "given"}, 'redundant_parameters' ),
link = selectone( args, {"author" .. i .. "-link", "author-link" .. i,
"author" .. i .. "link", "authorlink" .. i, "author-link",
"authorlink"}, 'redundant_parameters' ),
mask = selectone( args, {"author" .. i .. "-mask", "author-mask" .. i,
"author" .. i .. "mask", "authormask" .. i, "author-mask",
"authormask" }, 'redundant_parameters' )
}
else
authors[i] = {
last = last,
first = selectone( args, {"author" .. i .. "-first", "author-first" .. i,
"first" .. i, "given" .. i}, 'redundant_parameters' ),
link = selectone( args, {"author" .. i .. "-link", "author-link" .. i,
"author" .. i .. "link", "authorlink" .. i}, 'redundant_parameters' ),
mask = selectone( args, {"author" .. i .. "-mask", "author-mask" .. i,
"author" .. i .. "mask", "authormask" .. i}, 'redundant_parameters' )
}
end
else
break;
end
i = i + 1;
end
return authors;
end
 
-- Gets editor list from the input arguments
function extracteditors(args)
local editors = {};
local i = 1;
local last;
while true do
last = selectone( args, cfg.argument_map[list_name .. '-Last'], 'redundant_parameters', i );
if i == 1 then
last = selectone( args, {"editor" .. i .. "-last", "editor-last" .. i,
"EditorSurname" .. i, "Editor" .. i, "editor" .. i, "editor-last",
"EditorSurname", "Editor", "editor", "editors"}, 'redundant_parameters' );
else
last = selectone( args, {"editor" .. i .. "-last", "editor-last" .. i,
"EditorSurname" .. i, "Editor" .. i, "editor" .. i}, 'redundant_parameters' );
end
if ( last and "" < last ) then -- just in case someone passed in an empty parameter
if names[i] == 1 then{
editors[i]last = {last,
first = selectone( args, lastcfg.argument_map[list_name =.. '-First'], 'redundant_parameters', i last),
firstlink = selectone( args, {"editor" cfg.. iargument_map[list_name .. "'-first"Link'], 'redundant_parameters', i ),
mask = selectone( args, "editor-first"cfg.argument_map[list_name .. i'-Mask'], "EditorGiven" ..'redundant_parameters', i, "editor-first", )
} "EditorGiven"}, 'redundant_parameters' ),
link = selectone( args, {"editor" .. i .. "-link", "editor-link" .. i,
"editor" .. i .. "link", "editorlink" .. i, "editor-link",
"editorlink"}, 'redundant_parameters' ),
mask = selectone( args, {"editor" .. i .. "-mask", "editor-mask" .. i,
"editor" .. i .. "mask", "editormask" .. i, "editor-mask",
"editormask"}, 'redundant_parameters' )
}
else
editors[i] = {
last = last,
first = selectone( args, {"editor" .. i .. "-first",
"editor-first" .. i, "EditorGiven" .. i}, 'redundant_parameters' ),
link = selectone( args, {"editor" .. i .. "-link", "editor-link" .. i,
"editor" .. i .. "link", "editorlink" .. i}, 'redundant_parameters' ),
mask = selectone( args, {"editor" .. i .. "-mask", "editor-mask" .. i,
"editor" .. i .. "mask", "editormask" .. i}, 'redundant_parameters' )
}
end
else
break;
வரி 550 ⟶ 531:
i = i + 1;
end
return editorsnames;
end
 
வரி 617 ⟶ 598:
-- Chooses one matching parameter from a list of parameters to consider
-- Generates an error if more than one match is present.
function selectone( args, possible, error_condition, index )
local value = nil;
local selected = '';
local error_list = {};
if index ~= nil then index = tostring(index); end
-- Handle special case of "#" replaced by empty string
if index == '1' then
for _, v in ipairs( possible ) do
v = v:gsub( "#", "" );
if args[v] ~= nil then
if value ~= nil and selected ~= v then
table.insert( error_list, v );
else
value = args[v];
selected = v;
end
end
end
end
 
for _, v in ipairs( possible ) do
if index ~= nil then
v = v:gsub( "#", index );
end
if args[v] ~= nil then
if value ~= nil then
வரிசை 632:
end
end
 
if #error_list > 0 then
local error_str = "";
வரிசை 656:
]]
function citation0( config, args)
--[[ Load Input Parameters
Load Input Parameters
The argment_wrapper facillitates the mapping of multiple
aliases to single internal variable.
]]
local A = argument_wrapper( args );
 
local i
local PPrefix = config.A['PPrefix or "p.&nbsp;"']
local PPPrefix = config.A['PPPrefix or "pp.&nbsp;"']
if ( nil ~= args.noppA['NoPP'] ) then PPPrefix = "" PPrefix = "" end
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local Authors = args.authorsA['Authors'];
local a = extractauthorsextractnames( args, 'AuthorList' );
 
local Coauthors = selectone( args, {A['coauthorsCoauthors', 'coauthor' }, 'redundant_parameters' )];
local Others = args.others A['Others'];
local Editors = args.editorsA['Editors'];
local e = extracteditorsextractnames( args, 'EditorList' );
 
local Year = args.year A['Year'];
local PublicationDate = selectone( args, {A['publicationdatePublicationDate', 'publication-date' }, 'redundant_parameters' )];
local OrigYear = args.origyearA['OrigYear'];
local Date = args.dateA['Date'];
local LayDate = args.laydateA['LayDate'];
------------------------------------------------- Get title data
local Title = A['Title'];
local Title = args.title or args.encyclopaedia or args.encyclopedia or args.dictionary
local BookTitle = args.booktitleA['BookTitle'];
local Conference = args.conferenceA['Conference'];
local TransTitle = selectone( args, {A['trans-titleTransTitle', 'trans_title' }, 'redundant_parameters' )];
local TitleNote = args.departmentA['TitleNote'];
local TitleLink = selectone( args, {A['titlelinkTitleLink', 'episodelink' }, 'redundant_parameters' )];
local Chapter = selectone( args, {A['chapterChapter', 'contribution', 'entry' }, 'redundant_parameters' )];
local ChapterLink = args.chapterlinkA['ChapterLink'];
local TransChapter = selectone( args, {A['trans-chapterTransChapter', 'trans_chapter' }, 'redundant_parameters' )];
local TitleType = args.typeA['TitleType'];
local ArchiveURL = selectone( args, {A['archive-urlArchiveURL', 'archiveurl' }, 'redundant_parameters' )];
local URL = selectone( args, {'url', A['URL'}, 'redundant_parameters' )];
local ChapterURL = A['ChapterURL'];
local ChapterURL = selectone( args, {'chapter-url', 'chapterurl', 'contribution-url', 'contributionurl' }, 'redundant_parameters' );
local ConferenceURL = selectone( args, {A['conference-urlConferenceURL', 'conferenceurl' }, 'redundant_parameters' )];
local Periodical = selectone( args, {A['journalPeriodical', 'newspaper', 'magazine', 'work', 'website', ];
'periodical', 'encyclopedia', 'encyclopaedia'}, 'redundant_parameters' );
if ( config.CitationClass == "encyclopaedia" ) then
if ( args.articleChapter and== args.articlenil or Chapter ~== ""'' ) then
if ( Title and== nil or Title ~== "") then Periodical = Title end
Chapter Title = args.articlePeriodical;
TransChapter Periodical = TransTitlenil;
Title = nil else
TransTitle = nil
elseif ( Chapter == nil or Chapter == '' ) then
if Title ~= args.encyclopedia then
Chapter = Title
TransChapter = TransTitle
வரி 710 ⟶ 711:
TransTitle = nil
end
end
if ( Periodical and Periodical ~= "") then
if Periodical == Title or Periodical == Chapter then Periodical = nil end
end
end
 
local Series = selectone( args, {'series', 'version'}, 'redundant_parameters' );
local VolumeSeries = args.volumeA['Series'];
local Volume = A['Volume'];
local Issue = selectone( args, {'issue', 'number'}, 'redundant_parameters' );
local Issue = A['Issue'];
local Position = nil
local Page, Pages, At, page_type;
Page = A['Page'];
Page, page_type = selectone( args, {'p', 'page', 'pp', 'pages', 'at'},
Pages = hyphentodash( A['extra_pagesPages'] );
At = A['At'];
if page_type == 'pp' or page_type == 'pages' then
if Page ~= nil then
Pages = hyphentodash( Page );
Pageif Pages ~= nil; or At ~= nil then
Page = Page .. " " .. seterror('extra_pages');
elseif page_type == 'at' then
At Pages = Pagenil;
Page At = nil;
end
elseif Pages ~= nil then
if At ~= nil then
Pages = Pages .. " " .. seterror('extra_pages');
At = nil;
end
end
local Edition = args.editionA['Edition'];
local PublicationPlace = selectone( args, {A['publication-placePublicationPlace', 'publicationplace' }, 'redundant_parameters' ); ]
local Place = selectone( args, {A['placePlace', 'location'}, 'redundant_parameters' )];
if PublicationPlace == nil and Place ~= nil then
PublicationPlace = Place;
வரி 739 ⟶ 744:
if PublicationPlace == Place then Place = nil end
local PublisherName = args.publisherA['PublisherName'];
local SubscriptionRequired = args.subscriptionA['SubscriptionRequired'];
local Via = args.viaA['Via'];
local AccessDate = selectone( args, {A['access-dateAccessDate', 'accessdate' }, 'redundant_parameters' )];
local ArchiveDate = selectone( args, {A['archive-dateArchiveDate', 'archivedate' }, 'redundant_parameters' )];
local Agency = args.agencyA['Agency'];
local DeadURL = args.deadurl or "yes" -- Only used if ArchiveURL is present.A['DeadURL']
local Language = selectone( args, {A['languageLanguage', 'in'}, 'redundant_parameters' )];
local Format = args.formatA['Format']
local Ref = selectone( args, {'ref', A['Ref'}, 'redundant_parameters' );]
 
local DoiBroken = selectone( args, {'doi_inactivedate', 'doi_brokendate', A['DoiBroken'}, 'redundant_parameters' );]
local ID = selectone( args, {'id', A['ID', 'docket'}, 'redundant_parameters' )];
local ASINTLD = selectone( args, {A['ASIN-TLDASINTLD', 'asin-tld'}, 'redundant_parameters' )];
local IgnoreISBN = selectone( args, {A['ignore-isbn-errorIgnoreISBN', 'ignoreisbnerror'}, 'redundant_parameters' );]
 
local ID_list = extractids( args );
local Quote = selectone( args, {A['quoteQuote', 'quotation'}, 'redundant_parameters' )];
local PostScript = args.postscript or "."A['PostScript']
local LaySummary = args.laysummaryA['LaySummary']
local LaySource = args.laysourceA['LaySource'];
local Transcript = args.transcriptA['Transcript'];
local TranscriptURL = selectone( args, {A['transcript-urlTranscriptURL', 'transcripturl'}, 'redundant_parameters' )];
local sepc = args.separator or "."A['Separator']
local LastAuthorAmp = args.lastauthorampA['LastAuthorAmp']
local no_tracking_cats = selectone( args, {"template doc demo", A['nocatNoTracking', ];
'notracking', "no-tracking"}, 'redundant_parameters' ) or "";
 
if ( config.CitationClass == "journal" ) then
if (URL == nil or URL == "") then
if (ID_list['PMC'] ~= nil) then
local Embargo = args.embargo or args.A['Embargo'];
if Embargo ~= nil then
local lang = mw.getContentLanguage();
வரி 801 ⟶ 805:
-- Account for the oddity that is {{cite episode}}, before generation of COinS data.
if config.CitationClass == "episode" then
local AirDate = args.airdateA['AirDate']
local SeriesLink = args.serieslinkA['SeriesLink']
local Season = args.seasonA['Season']
local SeriesNumber = args.seriesnumber or args.seriesnoA['SeriesNumber']
local Network = args.networkA['Network']
local Station = args.stationA['Station']
local s = {}
if Issue ~= nil then table.insert(s, cfg.message_list["episode"] .. " " .. Issue) Issue = nil end
வரி 821 ⟶ 825:
TitleLink = SeriesLink
TransTitle = nil
local Sep = args(A["series-separatorSeriesSeparator"] or argsA["separatorSeparator"]) or.. ". "
Series = table.concat(s, Sep)
ID = table.concat(n, Sep)
வரி 880 ⟶ 884:
end
if last ~= nil and first ~= nil then
table.insert( OCinSauthors, last .. (args.NameSep or ", ") .. first );
elseif last ~= nil then
table.insert( OCinSauthors, last );
வரி 923 ⟶ 927:
-- various parts of the citation, but only when they are non-nil.
if ( Authors == nil ) then
local Maximum = tonumber( (selectone( args, {"display-authors", "displayauthors"}, A['redundant_parametersDisplayAuthors' ))] );
-- Preserve old-style implicit et al.
வரி 934 ⟶ 938:
local control = {
sep = (argsA["author-separatorAuthorSeparator"] or ";") .. " ",
namesep = (argsA["author-name-separatorAuthorNameSeparator"] or argsA["name-separatorNameSeparator"] or ",") .. " ",
format = selectone( args, {A["author-formatAuthorFormat", "authorformat" }, 'redundant_parameters' )],
maximum = Maximum,
lastauthoramp = LastAuthorAmp
வரி 951 ⟶ 955:
local EditorCount
if ( Editors == nil ) then
local Maximum = tonumber( (selectone( args, {"display-editors", "displayeditors"}, A['redundant_parametersDisplayEditors' ))] );
 
-- Preserve old-style implicit et al.
வரி 962 ⟶ 966:
 
local control = {
sep = (argsA["editor-separatorEditorSeparator"] or ";") .. " ",
namesep = (argsA["editor-name-separatorEditorNameSeparator"] or argsA["name-separatorNameSeparator"] or ",") .. " ",
format = selectone( args, {"editor-format", "editorformat" }, A['redundant_parametersEditorFormat' )],
maximum = Maximum,
lastauthoramp = LastAuthorAmp
வரி 994 ⟶ 998:
Date = Year
if ( Date ~= nil and Date ~="") then
local Month = args.monthA['Month']
if ( Month ~= nil and Month ~= "") then
Date = Month .. " " .. Date
local Day = args.dayA['Day']
if ( Day ~= nil ) then Date = Day .. " " .. Date end
else Month = ""
வரி 1,057 ⟶ 1,061:
end
 
if ( TransTitle and "" < TransTitle ) then TransTitle = " [" .. TransTitlesubstitute( cfg..message_list['trans-title'], "&#93;"{ TransTitle } ) else TransTitle = "" end
if ( TransChapter and "" < TransChapter ) then TransChapter = " [" .. TransChaptersubstitute( cfg..message_list['trans-title'], "&#93;"{ TransChapter } ) else TransChapter = "" end
-- Format chapter / article title
வரி 1,065 ⟶ 1,069:
if ( Periodical and "" < Periodical ) and (Title ~= nil and Title ~= "" )
then
Chapter = "substitute( cfg.message_list['italic-title'"], ..{ (safeforitalics(Chapter)) ..} "''");
else
Chapter = "\""substitute( cfg..message_list['quoted-title'], { Chapter ..} "\"");
end
else
வரி 1,109 ⟶ 1,113:
Title = "[[" .. TitleLink .. "|" .. Title .. "]]" end
if ( Periodical and "" < Periodical ) then
Title = "\""substitute( cfg..message_list['quoted-title'], { Title ..} "\"");
elseif ( config.CitationClass == "web"
or config.CitationClass == "news"
or config.CitationClass == "pressrelease" ) and
Chapter == "" then
Title = "\""substitute( cfg..message_list['quoted-title'], { Title ..} "\"");
else
Title = "substitute( cfg.message_list['italic-title'"], ..{ (safeforitalics(Title)) ..} "''");
end
else
வரி 1,139 ⟶ 1,143:
if ( Place ~= nil and Place ~= "" ) then
if sepc == '.' then
Place = " " .. substitute( cfg.message_list['written'], ..{Place} " " .. Place) .. sepc .. " ";
else
Place = " " .. substitute( cfg.message_list['written']:lower(), ..{Place} " " .. Place) .. sepc .. " ";
end
else
வரி 1,159 ⟶ 1,163:
if ( nil ~= Position or nil ~= Page or nil ~= Pages ) then At = nil end
if ( nil == Position and "" ~= Position ) then
local Minutes = args.minutesA['Minutes'];
if ( nil ~= Minutes ) then
Position = " " .. Minutes .. " " .. cfg.message_list['minutes'];
else
local Time = args.timeA['Time'];
if ( nil ~= Time ) then
local TimeCaption = args.timecaption A['TimeCaption']
if TimeCaption == nil then
TimeCaption = cfg.message_list['event'];
வரி 1,218 ⟶ 1,222:
TitleNote = sepc .. " " .. TitleNote else TitleNote = "" end
if ( Language ~= nil and Language ~="" ) then
Language = " (" .. substitute( cfg.message_list['inlanguage'] .. " " .., {Language} .. ")" else Language = "" end
if ( Edition ~= nil and Edition ~="" ) then
Edition = " (" .. Edition .. " " ..substitute( cfg.message_list['edition'] .., {Edition} ")" else Edition = "" end
if ( Volume ~= nil and Volume ~="" )
then
வரி 1,239 ⟶ 1,243:
if ( Date ~= nil ) then Date = Date else Date = "" end
if ( Via ~= nil and Via ~="" ) then
Via = " &mdash; " .. substitute( cfg.message_list['via'], ..{Via} " " .. Via) else Via = "" end
if ( AccessDate ~= nil and AccessDate ~="" )
then local retrv_text = " " .. cfg.message_list['retrieved'] .. " "
if (sepc ~= ".") then retrv_text = retrv_text:lower() end
AccessDate = '<span class="reference-accessdate">' .. sepc
.. substitute( retrv_text, .. {AccessDate} ) .. '</span>'
else AccessDate = "" end
if ( SubscriptionRequired ~= nil and
வரி 1,273 ⟶ 1,277:
end
Quote = sepc .." \"" .. Quotesubstitute( cfg..message_list['quoted-text'], "\""{ Quote } );
PostScript = ""
else
வரி 1,282 ⟶ 1,286:
local Archived
if ( nil ~= ArchiveURL and "" ~= ArchiveURL ) then
if ( ArchiveDate ~== nil andor ArchiveDate ~=="" ) then
ArchiveDate = " " .. ArchiveDateseterror('archive_missing_date');
else
ArchiveDate = " " .. seterror('archive_missing_date') .. " "
end
local arch_text = cfg.message_list['archived'];
if (sepc ~= ".") then arch_text = arch_text:lower() end
if ( "no" == DeadURL ) then
Archived = sepc .. " " .. externallink( ArchiveURL,local arch_text )= cfg.. " " .. message_list['archived'];
if (sepc ~= ".") then arch_text = arch_text:lower() end
cfg.message_list['from'] .. " " .. cfg.message_list['original'] .. " " ..
Archived = sepc .. " " .. substitute( cfg.message_list['onarchived-not-dead'] .. ArchiveDate,
{ externallink( ArchiveURL, arch_text ), ArchiveDate } );
if OriginalURL == nil or OriginalUrl == '' then
Archived = Archived .. " " .. seterror('archive_missing_url_not_deadarchive_missing_url');
end
else
if OriginalURL ~= nil and OriginalURL ~= '' then
Archived = sepc .. " " ..local arch_text .. " " ..= cfg.message_list['fromarchived-dead'] .. ;
if (sepc ~= " .") ..then externallink(arch_text OriginalURL, cfg.message_list['original']= arch_text:lower() .. " "end
Archived = sepc .. cfg.message_list['on']" " .. ArchiveDatesubstitute( arch_text,
{ externallink( OriginalURL, cfg.message_list['original'] ), ArchiveDate } );
else
iflocal config.CitationClassarch_text ~= cfg.message_list['webarchived-missing' then ];
if (sepc Archived ~= sepc ".. ") " ..then arch_text ..= " " .. cfg.message_list['from'] .. " " ..arch_text:lower() end
Archived = cfg.message_list['original'] .. seterror('archive_missing_url')sepc .. " " .. cfg.message_list['on']substitute( ..arch_text, ArchiveDate
else { seterror('archive_missing_url'), ArchiveDate } );
Archived = sepc .. " " .. arch_text .. " " .. cfg.message_list['from'] .. " " ..
cfg.message_list['original'] .. seterror('archive_missing_url_web') .. " " .. cfg.message_list['on'] .. ArchiveDate
end
end
end
வரி 1,355 ⟶ 1,354:
if ( PublicationDate and PublicationDate ~="" ) then
if Publisher ~= '' then
Publisher = Publisher .. ", " .. substitute( cfg.message_list['published'], ..{PublicationDate} " " .. PublicationDate);
else
Publisher = PublicationDate;
வரி 1,365 ⟶ 1,364:
else
if ( PublicationDate and PublicationDate ~="" ) then
PublicationDate = " (" .. substitute( cfg.message_list['published'], ..{PublicationDate} " " .. PublicationDate) .. ")"
else
PublicationDate = ""
வரி 1,384 ⟶ 1,383:
if ( Periodical ~= nil and Periodical ~="" ) then
if ( Title and Title ~= "" ) or ( TitleNote and TitleNote ~= "" ) then
Periodical = sepc .. " ''" .. substitute( cfg.message_list['italic-title'], { (safeforitalics(Periodical)) ..} ) "''"
else
Periodical = "substitute( cfg.message_list['italic-title'"], ..{ (safeforitalics(Periodical)) ..} ) "''"
end
else Periodical = "" end
வரி 1,417 ⟶ 1,416:
if ( "" ~= Authors ) then
if (Coauthors ~= "")
then Authors = Authors .. A['AuthorSeparator'] .. "; " .. Coauthors
end
if ( "" ~= Date )
வரி 1,531 ⟶ 1,530:
if #z.message_tail ~= 0 then
text = text .. " ";
for i,v in ipairs( z.message_tail ) do
if v[1] ~= nil and v[1] ~= "" then
வரிசை 1,542:
end
if no_tracking_cats == ''nil then
for _, v in ipairs( z.error_categories ) do
text = text .. '[[Category:' .. v ..']]';
வரிசை 1,601:
 
return z
---------------------------------------------------------------------
--NOTES
--
-- NOTE A1: This Lua module was originally designed to handle a mix
-- of citation styles, crossing Vancouver style with Wikipedia's
-- local Citation Style 1 (CS1) from {Template:Citation/core}.
-- However, the conflicting positions of parameters, scattered
-- in twisted locations across this module, led to a separate
-- variation just to untangle the CS1 format of citations.
--
-- NOTE D2: The placement of dots and other separators between the
-- displayed parameters has been a continual headache, to keep
-- coordinated with the data in parentheses "(data)". There
-- has been a need to pre-check for the existence of related
-- options, to keep from putting double-dots ".." in some cases.
-- In particular, the omission of the "title=" parameter has led
-- to several cases of a spurious dot ". ." because the original
-- design had treated the title as a mandatory parameter.
--
------------------------------------------------------------------------
--HISTORY:
--18Oct2012 Fixed lead-space in Chapter by omitting " ".
--18Oct2012 Fixed lead-space in Chapter/Title as end " " of Authors/Date/...
--19Oct2012 Put HISTORY comments to log major changes (not typos).
--19Oct2012 Fixed extra dot ".." in Title by omitting at end of "tcommon=...".
--19Oct2012 For pages, put &nbsp in "p.&nbsp;" etc.
--19Oct2012 Enhanced "pages=" to detect lone page as "p." else "pp." prefix.
--19Oct2012 Fixed to show "." after Periodical name (work, newspaper...).
--19Oct2012 Fixed web-link to have spaces "[... Archived] from the original".
--19Oct2012 Fixed to show ";" between authors & coauthors.
--19Oct2012 Fixed to omit extra "." after coauthors.
--20Oct2012 Fixed COinS data to not urlencode all, as "ctx_ver=Z39.88-2004"
--20Oct2012 Fixed COinS to not end as "&" but use lead "&rft...=" form.
--20Oct2012 Fixed COinS to not url.encode page's "rfr_id=..." pagename.
--20Oct2012 Fixed COinS data when "web" to default to rft.genre "book".
--05Nov2012 Add a span wrapper even when there is no Ref parameter
--15Feb2013 Added Agency for "agency=xx".
--19Feb2013 Put NOTES comments to explain module operation.
--19Feb2013 Copied as Module:Citation/CS1 to alter to match wp:CS1 form.
--19Feb2013 Changed OrigYear to use [__] for CS1 style.
--19Feb2013 Fixed to not show duplicate Publisher/Agency.
--19Feb2013 Moved page-number parameters to after final date.
--19Feb2013 Fixed to not put double-dots after title again.
--20Feb2013 Changed to omit dot "." if already ends with dot.
--20Feb2013 If class "journal" shows Publisher after Periodical/Series.
--20Feb2013 Shifted Format to after Language, and Others after Volume.
--20Feb2013 Set AccessDate + <span class="reference-accessdate">
--20Feb2013 Fixed url when deadurl=no.
--20Feb2013 Added sepc for separator character between parameters.
--20Feb2013 Put "OCLC" for "Online Computer Library Center".
--20Feb2013 Fix empty "authorlink=" as person.link ~= "".
--20Feb2013 Added space after AuthorSep & AuthorNameSep.
--21Feb2013 Added args.contributor (was missing parameter).
--21Feb2013 Fixed EditorSep (was misspelled "EdithorSep").
--21Feb2013 Set OCinSdata.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"
--21Feb2013 Checked to omit blank codes (asin= | doi= etc.).
--21Feb2013 Set enddot to end line if not config.CitationClass "citation".
--21Feb2013 Fixed to show "issn=x" as the ISSN code.
--21Feb2013 Fixed to show "id=x" after Zbl code.
--21Feb2013 Changed to omit double-dot before date when already dot.
--21Feb2013 Order config.CitationClass "citation": Volume, Issue, Publisher.
--21Feb2013 Put warning "Bad DOI (expected "10."..)" in DOI result.
--21Feb2013 Automatically unbolded volume+comma when > 4 long.
--21Feb2013 Changed to allow lowercase "asin-tld".
--22Feb2013 Fixed ref=harv to extract Year from Date.
--22Feb2013 Set Harvard refer. span id if config.CitationClass "citation".
--22Feb2013 Fixed config.CitationClass "citation" as span class="citation".
--22Feb2013 Capitalized "Archived/Retrieved" only when sepc is dot ".".
--23Feb2013 Fixed author editor for "in" or "In" and put space after sepc.
--23Feb2013 Changed to omit dot in "et al." when sepc is "." separator.
--23Feb2013 Fixed "author1-first" to also get args.given or args.given1.
--23Feb2013 Fixed args.article to set Title, after Periodical is Title.
--23Feb2013 Fixed to allow blank Title (such as "contribution=mytitle").
--23Feb2013 Fixed double-dot ".." at end of Editors list
--26Feb2013 Moved "issue=" data to show before "page=".
--26Feb2013 Moved "type=" data to show after "format=".
--26Feb2013 For "pmc=" link, omitted suffix "/?tool=pmcentrez".
--27Feb2013 For coauthors, omitted extra separator after authors.
--27Feb2013 For date, allowed empty date to use month/day/year.
--27Feb2013 Fixed double-dot ".." at end of authors/coauthors list.
--27Feb2013 Reset editor suffix as ", ed." when date exists.
--27Feb2013 Removed duplicate display of "others=" data.
--27Feb2013 Removed parentheses "( )" around "department" TitleNote.
--05Mar2013 Moved Language to follow Periodical or Series.
--05Mar2013 Fixed Edition to follow Series or Volume.
--05Mar2013 Fixed class encyclopaedia to show article as quoted Chapter.
--05Mar2013 Fixed class encyclopaedia to show page as "pp." or "p.".
--07Mar2013 Changed class encyclopaedia to omit "( )" around publisher.
--07Mar2013 Fixed end double-dot by string.sub(idcommon,-1,-1) was "-1,1".
--13Mar2013 Removed enddot "." after "quote=" parameter.
--13Mar2013 Changed config.CitationClass "news" to use "p." page format.
--13Mar2013 Fixed missing "location=" when "web" or "encyclopaedia".
--14Mar2013 Fixed end double-dot after book/work title.
--14Mar2013 Fixed double-dot before "p." or "pp." page number.
--14Mar2013 Fixed config.CitationClass "book" to use p./pp. page.
--18Mar2013 Fixed "page=" to override "pages=" as in markup-based cites.
--19Mar2013 Fixed date of class=journal Periodical to show after page.
--19Mar2013 Changed null "postscript=" to suppress end-dot of citation.
--20Mar2013 If CitationClass is journal, show "others=" before title.
--20Mar2013 If CitationClass is book, show "others=" before edition.
--20Mar2013 If CitationClass is journal, adjust "others=" to have sepc.
--20Mar2013 For class "journal", use book format unless Periodical set.
--03Apr2013 Changed safejoin() to omit "." after wikilink ".]]" end dot.
--03Apr2013 Changed safejoin() to omit "." after external ".]" end dot.
--03Apr2013 Changed safejoin() to omit "." at italic wikilink ".]]" end.
--03Apr2013 Changed safejoin() to omit "." at italic external ".]" end.
--04Apr2013 Moved sepc before <span class="reference-accessdate"> for "..".
--
--End
"https://tamilar.wiki/w/Module:Citation/CS1" இலிருந்து மீள்விக்கப்பட்டது