"ମଡ୍ୟୁଲ:Citation/CS1" ପୃଷ୍ଠାର ସଂସ୍କରଣଗୁଡ଼ିକ ମଧ୍ୟରେ ତଫାତ
Content deleted Content added
ଅଦ୍ୟତନ: ଇଂରାଜୀ ଉଇକିପିଡ଼ିଆ ସହ ମେଳ କରାଗଲା ଟ୍ୟାଗ: Reverted |
ଟିକେ MKar (ଆଲୋଚନା)ଙ୍କ ଦେଇ କରାଯାଇଥିବା ବଦଳକୁ Jnanaranjan sahuଙ୍କ ଦେଇ କରାଯାଇଥିବା ଶେଷ ବଦଳକୁ ଫେରାଇ ଦିଆଗଲା ଟ୍ୟାଗ: Rollback |
||
୬୦୦ କ ଧାଡ଼ି:
--[[--------------------------< W I K I S O U R C E _ U R L _ M A K E >----------------------------------------
Makes a Wikisource URL from Wikisource interwiki-link. Returns the URL and appropriate label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
Line ୬୪୪ ⟶ ୬୪୩:
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable URL
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent
end
Line ୬୫୪ ⟶ ୬୫୩:
--[[--------------------------< F O R M A T _ P E R I O D I C A L >--------------------------------------------
Format the three periodical parameters: |script-<periodical>=, |<periodical>=, and |trans-<periodical>= into a single Periodical meta-
parameter.
]]
Line ୬୮୬ ⟶ ୬୮୫:
--[[--------------------------< F O R M A T _ C H A P T E R _ T I T L E >--------------------------------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=, and |chapter-url= into a single chapter meta-
]]
Line ୬୯୯ ⟶ ୬୯୭:
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource URL and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', '
chapter = ws_label;
end
Line ୭୩୬ ⟶ ୭୩୪:
--[[--------------------------< H A S _ I N V I S I B L E _ C H A R S >----------------------------------------
This function searches a parameter's value for non-printable or invisible characters. The search stops at the
This function will detect the visible replacement character when it is part of the Wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers (gallery, math, pre, ref)
Output of this function is an error message that identifies the character or the Unicode group, or the stripmarker
parameter value.
]]
Line ୭୯୪ ⟶ ୭୯୧:
end
end
i = i
end
end
--[[--------------------------< A R G U M E N T _ W R A P P E R >----------------------------------------------
Argument wrapper. This function provides support for argument mapping defined in the configuration file so that
]]
Line ୮୧୨ ⟶ ୮୦୮:
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; --
return origin[k];
end
Line ୮୫୦ ⟶ ୮୪୬:
--[[--------------------------< N O W R A P _ D A T E >--------------------------------------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>. When date is DD MMMM YYYY or is
DOES NOT yet support MMMM YYYY or any of the date ranges.
Line ୮୭୬ ⟶ ୮୭୧:
--[[--------------------------< S E T _ T I T L E T Y P E >----------------------------------------------------
This function sets default title types (equivalent to the citation including |type=<default value>) for those templates that have defaults.
Also handles the special case where it is desirable to omit the title type from the rendered citation (|type=none).
]]
Line ୮୯୯ ⟶ ୮୯୨:
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate like items; unlike items are
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and digit is supported – a.1-a.5 or a-1-a-5)
any other forms are returned unmodified.
Line ୯୨୦ ⟶ ୯୧୧:
end
local accept;
str, accept = utilities.has_accept_as_written (str); -- remove accept-this-as-written markup when it wraps all of str
if accept then
return str; -- when markup removed, nothing to do, we're done
end
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-');
str = str:gsub ('
local out = {};
Line ୯୩୩ ⟶ ୯୨୫:
for _, item in ipairs (list) do -- for each item in the list
if mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
Line ୯୪୫ ⟶ ୯୩୬:
end
end
item = utilities.has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of str
table.insert (out, item); -- add the (possibly modified) item to the output table
end
return table.concat (out,
end
--[[--------------------------< S A F E _ J O I N >------------------------------------------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
Line ୧,୦୩୪ ⟶ ୧,୦୨୧:
end
end
str = str .. value;
end
end
Line ୧,୦୪୧ ⟶ ୧,୦୨୮:
--[[--------------------------< I S _ S U F F I X >------------------------------------------------------------
returns true is suffix is properly formed Jr, Sr, or ordinal in the range 1–9. Puncutation not allowed.
]]
Line ୧,୦୫୬ ⟶ ୧,୦୪୨:
--[[--------------------------< I S _ G O O D _ V A N C _ N A M E >--------------------------------------------
For Vancouver style, author/editor names are supposed to be rendered in Latin (read ASCII) characters. When a name
When a name is written using a non-Latin alphabet or logogram, that name is to be transliterated into Latin characters.
These things are not currently possible in this module so are left to the editor to do.
This test allows |first= and |last= names to contain any of the letters defined in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
Line ୧,୦୭୧ ⟶ ୧,୦୫୫:
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes. (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$") or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written outside of the code editor and pasted here because the code editor gets confused between character insertion point and cursor position.
The test has been rewritten to use decimal character escape sequence for the individual bytes of the Unicode characters so that it is not necessary
to use an external editor to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
Line ୧,୧୧୭ ⟶ ୧,୦୯୭:
Attempts to convert names to initials in support of |name-list-style=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the Unicode Latin characters accepted by is_good_vanc_name ().
]]
Line ୧,୧୬୮ ⟶ ୧,୧୪୪:
table.insert (initials, mw.ustring.sub(names[i], 1, 1)); -- insert the initial at end of initials table
end
i = i
end
Line ୧,୧୭୫ ⟶ ୧,୧୫୧:
--[[--------------------------< L I S T _ P E O P L E >-------------------------------------------------------
Formats a list of people (e.g. authors, contributors, editors, interviewers, translators)
names in the list will be linked when
|<name>-link= has a value
|<name>-mask- does NOT have a value; masked names are presumed to have been rendered previously so should have been linked there
when |<name>-mask=0, the associated name is not rendered
Line ୧,୧୯୩ ⟶ ୧,୧୬୮:
local format = control.format;
local maximum = control.maximum;
local lastauthoramp = control.lastauthoramp; -- TODO: delete after deprecation
local name_list = {};
Line ୧,୧୯୮ ⟶ ୧,୧୭୪:
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between names is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
lastauthoramp = nil; -- TODO: delete after deprecation -- unset because isn't used by Vancouver style
else
sep = cfg.presentation['sep_nl']; -- name-list separator between names is a semicolon
Line ୧,୨୨୦ ⟶ ୧,୧୯୭:
local n = tonumber (mask); -- convert to a number if it can be converted; nil else
if n then
one = 0 ~= n and string.rep("—",
person.link = nil; -- don't create link to name if name is replaces with mdash string or has been set nil
else
Line ୧,୨୫୨ ⟶ ୧,୨୨୯:
if 0 < count then
if 1 < count and not etal then
if 'amp' == format or utilities.is_set (lastauthoramp) then -- TODO: delete lastauthoramp after deprecation
name_list[#name_list-2] = " & "; -- replace last separator with ampersand text
elseif 'and' == format then
Line ୧,୨୭୪ ⟶ ୧,୨୫୧:
--[[--------------------------< A N C H O R _ I D >------------------------------------------------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that order. year is Year or anchor_year.
]]
Line ୧,୩୦୦ ⟶ ୧,୨୭୫:
--[[--------------------------< N A M E _ H A S _ E T A L >----------------------------------------------------
Evaluates the content of name parameters (author, editor, etc.) for variations on the theme of et al. If found,
This function never sets the flag to false but returns
]]
Line ୧,୩୧୫ ⟶ ୧,୨୮୮:
if utilities.is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns;
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
Line ୧,୩୩୨ ⟶ ୧,୩୦୫:
--[[--------------------------< N A M E _ I S _ N U M E R I C >------------------------------------------------
Add maint cat when name parameter value does not contain letters. Does not catch mixed alphanumeric names so
returns nothing
Line ୧,୩୫୧ ⟶ ୧,୩୨୩:
--[[--------------------------< N A M E _ H A S _ E D _ M A R K U P >------------------------------------------
Evaluates the content of author and editor parameters for extraneous editor annotations: ed, ed., eds, (Ed.), etc.
returns nothing
Line ୧,୩୭୬ ⟶ ୧,୩୪୭:
--[[--------------------------< N A M E _ H A S _ M U L T _ N A M E S >----------------------------------------
Evaluates the content of last/surname (authors etc.) parameters for multiple names. Multiple names are indicated
returns nothing
Line ୧,୩୮୮ ⟶ ୧,୩୫୭:
local function name_has_mult_names (name, list_name)
local _, commas, semicolons
if utilities.is_set (name) then
_, commas = name:gsub (',', ''); -- count the number of commas
_, semicolons = name:gsub (';', ''); -- count the number of semicolons
if 1 < commas or 0 < semicolons then
utilities.set_message ('maint_mult_names', cfg.special_case_translation [list_name]); -- add a maint message
end
Line ୧,୪୦୯ ⟶ ୧,୩୬୯:
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding
]]
Line ୧,୪୨୫ ⟶ ୧,୩୮୫:
name_has_mult_names (last, list_name); -- check for multiple names in the parameter (last only)
name_has_ed_markup (last, list_name); -- check for extraneous 'editor' annotation
name_is_numeric (last, list_name); -- check for names that are
end
end
Line ୧,୪୩୪ ⟶ ୧,୩୯୪:
if not accept_name then -- <first> not wrapped in accept-as-written markup
name_has_ed_markup (first, list_name); -- check for extraneous 'editor' annotation
name_is_numeric (first, list_name); -- check for names that are
end
end
Line ୧,୪୪୨ ⟶ ୧,୪୦୨:
--[[--------------------------< E X T R A C T _ N A M E S >----------------------------------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters (or their aliases), and their matching link and mask parameters.
Stops searching when both |lastn= and |firstn= are not found in args after two sequential attempts: found |last1=, |last2=, and |last3= but doesn't
find |last4= and |last5= then the search is done.
This function emits an error message when there is a |firstn= without a matching |lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.' is stripped from the parameter and a flag (etal) returned
that will cause list_people() to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps 'et al.' out of the
template's metadata. When this occurs, the page is added to a maintenance category.
]]
Line ୧,୫୨୧ ⟶ ୧,୪୭୬:
Validates language names provided in |language= parameter if not an ISO639-1 or 639-2 code.
Returns the language name and associated two- or three-character code. Because case of the source may be incorrect
found, the Wikimedia version (assumed to be correct) is returned along with the code. When there is no match, we
return the original language name string.
mw.language.fetchLanguageNames(<local wiki language>, 'all') returns a list of languages that in some cases may include
are used as sub-domain names: cbk-zam.wikipedia.org. A list of language names and codes supported by fetchLanguageNames()
can be found at Template:Citation Style documentation/language/doc
Names that are included in the list will be found if that name is provided in the |language= parameter. For example,
Some language names have multiple entries under different codes:
Line ୧,୫୭୩ ⟶ ୧,୫୨୩:
--[[--------------------------< L A N G U A G E _ P A R A M E T E R >------------------------------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code is recognized by MediaWiki,
When |language= contains a recognized language (either code or name), the page is assigned to the category for
to the single category for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does not recognize three-character
This function supports multiple languages in the form |language=nb, French, th where the language names or codes are
]]
Line ୧,୬୫୬ ⟶ ୧,୬୦୨:
--[[--------------------------< S E T _ C S 1 _ S T Y L E >----------------------------------------------------
Set style settings for CS1 citation templates. Returns separator and postscript settings
Line ୧,୬୭୩ ⟶ ୧,୬୧୯:
--[[--------------------------< S E T _ C S 2 _ S T Y L E >----------------------------------------------------
Set style settings for CS2 citation templates. Returns separator, postscript, ref settings
Line ୧,୬୯୩ ⟶ ୧,୬୩୯:
--[[--------------------------< G E T _ S E T T I N G S _ F R O M _ C I T E _ C L A S S >----------------------
When |mode= is not set or when its value is invalid, use config.CitationClass and parameter values to establish
]]
Line ୧,୭୧୪ ⟶ ୧,୬୬୦:
--[[--------------------------< S E T _ S T Y L E >------------------------------------------------------------
Establish basic style settings to be used when rendering the citation. Uses |mode= if set and valid or uses
]]
Line ୧,୭୩୭ ⟶ ୧,୬୮୩:
--[=[-------------------------< I S _ P D F >------------------------------------------------------------------
Determines if a URL has the file extension that is one of the PDF file extensions used by [[MediaWiki:Common.css]] when
returns true if file extension is one of the recognized extensions, else false
Line ୧,୭୫୩ ⟶ ୧,୬୯୯:
--[[--------------------------< S T Y L E _ F O R M A T >------------------------------------------------------
Applies CSS style to |format=, |chapter-format=, etc. Also emits an error message if the format parameter does
is recognized as a PDF document by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
Line ୧,୭୭୮ ⟶ ୧,୭୨୩:
--[[--------------------------< G E T _ D I S P L A Y _ N A M E S >--------------------------------------------
Returns a number that defines the number of names displayed for author and editor name lists and a Boolean flag
When the value assigned to |display-xxxxors= is a number greater than or equal to zero, return the number and
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number that is one greater than the
In all other cases, returns nil and the previous state of the 'etal' flag.
Line ୧,୮୨୨ ⟶ ୧,୭୬୭:
--[[--------------------------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >------------------------------
Adds
check
good pattern: '^P[^%.P%l]' matches when |page(s)= begins PX or P# but not Px where x and X are letters and # is a dgiit
bad pattern: '^[Pp][Pp]' matches matches when |page(s)= begins pp or pP or Pp or PP
]]
local function extra_text_in_page_check (page)
local good_pattern = '^P[^%.
local bad_pattern = '^[Pp]?[
if not page:match (good_pattern) and (page:match (bad_pattern) or page:match ('^[Pp]ages
end
end
Line ୧,୮୫୬ ⟶ ୧,୮୦୦:
local function get_v_name_table (vparam, output_table, output_link_table)
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a
local i = 1;
Line ୧,୯୭୮ ⟶ ୧,୯୨୨:
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editors=, |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest
similarly, |editorn= (and aliases) highest and |
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
Line ୧,୯୮୯ ⟶ ୧,୯୩୩:
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors or editors as appropriate.
]]
Line ୨,୦୭୮ ⟶ ୨,୦୨୨:
if 'magazine' == cite_class or (utilities.in_array (cite_class, {'citation', 'map'}) and 'magazine' == origin) then
if utilities.is_set (volume) and utilities.is_set (issue) then
return wrap_msg ('vol-no', {sepc,
elseif utilities.is_set (volume) then
return wrap_msg ('vol', {sepc,
else
return wrap_msg ('issue', {sepc, issue}, lower);
Line ୨,୦୯୪ ⟶ ୨,୦୩୮:
if utilities.is_set (volume) then
if volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$') then -- volume value is all digits or all uppercase Roman numerals
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, hyphen_to_dash(volume)}); -- render in bold face
elseif (4 < mw.ustring.len(volume)) then -- not all digits or Roman numerals and longer than 4 characters
vol = utilities.substitute (cfg.messages['j-vol'], {sepc,
utilities.add_prop_cat ('long_vol');
else -- four or less characters
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, hyphen_to_dash
end
end
Line ୨,୧୬୭ ⟶ ୨,୧୧୧:
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki-link to
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
Line ୨,୧୮୫ ⟶ ୨,୧୨୯:
at = '';
end
extra_text_in_page_check (page); -- add this page to maint cat if |page= value begins with what looks like p.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws URL from |page= interwiki link; link portion L becomes tooltip label
Line ୨,୧୯୭ ⟶ ୨,୧୪୧:
at = ''; -- unset
end
extra_text_in_page_check (pages); -- add this page to maint cat if |pages= value begins with what looks like p.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws URL from |pages= interwiki link; link portion L becomes tooltip label
Line ୨,୩୨୮ ⟶ ୨,୨୭୨:
local function is_generic_title (title)
title = mw.ustring.lower(title); -- switch title to lower case
for _, generic_title in ipairs (cfg.special_case_translation['generic_titles']) do
if title:find (generic_title['en'][1], 1, generic_title['en'][2]) then
return true; -- found English generic title so done
Line ୨,୩୪୨ ⟶ ୨,୨୮୬:
--[[--------------------------< I S _ A R C H I V E D _ C O P Y >----------------------------------------------
compares |title= to 'Archived copy' (
]]
Line ୨,୪୦୯ ⟶ ୨,୩୫୩:
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'],
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListStyle = 'vanc';
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
elseif 3 == selected then
Editors = A['Editors']; -- use content of |editors=
end
end
Line ୨,୫୯୮ ⟶ ୨,୫୪୪:
At = A['At'];
end
local Edition = A['Edition'];
Line ୨,୬୫୭ ⟶ ୨,୬୦୧:
local ID = A['ID'];
local ASINTLD = A['ASINTLD'];
local IgnoreISBN = is_valid_parameter_value (A['IgnoreISBN'], A:ORIGIN('IgnoreISBN'), cfg.keywords_lists['yes_true_y'], nil);
local Embargo = A['Embargo'];
local Class = A['Class']; -- arxiv class identifier
local Quote = A['Quote'];
local QuotePage = A['QuotePage'];
local QuotePages = A['QuotePages'];
local ScriptQuote = A['ScriptQuote'];
local TransQuote = A['TransQuote'];
local LayFormat = A['LayFormat'];
local LayURL = A['LayURL'];
Line ୨,୬୭୧ ⟶ ୨,୬୧୯:
local TranscriptURL_origin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
local
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
if 'nocat' == A:ORIGIN('NoTracking') then
utilities.set_message ('maint_nocat'); -- this one so that we get the message; see main categorization at end of citation0()
end
--local variables that are not cs1 parameters
local use_lowercase; -- controls capitalization of certain static text
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
Line ୩,୦୧୮ ⟶ ୨,୯୭୧:
end -- end of do
local ID_list_coins = identifiers.extract_ids (args); -- gets identifiers and their values from args; this list used for COinS and source for build_id_list()
if utilities.is_set (DoiBroken) and not ID_list_coins['DOI'] then
table.insert (z.message_tail, {utilities.set_message ('err_doibroken_missing_doi', A:ORIGIN('DoiBroken'))});
end
local ID_access_levels = identifiers.extract_id_access_levels (args, ID_list_coins);
local ID_list = identifiers.build_id_list (ID_list_coins, {IdAccessLevels = ID_access_levels, DoiBroken = DoiBroken, ASINTLD = ASINTLD, IgnoreISBN = IgnoreISBN, Embargo = Embargo, Class = Class}); -- render identifiers
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite ssrn}}, before generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list) then
Line ୩,୦୭୨ ⟶ ୩,୦୨୪:
check_for_url ({ -- add error message when any of these parameters hold a URL
['title']
[A:ORIGIN('Chapter')]
[Periodical_origin] = Periodical,
[PublisherName_origin] = PublisherName
Line ୩,୧୧୧ ⟶ ୩,୦୬୩:
['Volume'] = Volume,
['Issue'] = Issue,
['Pages'] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At
['Edition'] = Edition,
['PublisherName'] = PublisherName or Newsgroup, -- any apostrophe markup already removed from PublisherName
Line ୩,୧୩୭ ⟶ ୩,୦୮୯:
local last_first_list;
local control = {
format = NameListStyle,
maximum = nil, -- as if display-authors or display-editors not set
lastauthoramp = LastAuthorAmp,
mode = Mode
};
Line ୩,୧୪୪ ⟶ ୩,୦୯୭:
do -- do editor name list first because the now unsupported coauthors used to modify control table
control.maximum , editor_etal = get_display_names (A['DisplayEditors'], #e, 'editors', editor_etal);
if utilities.is_set (Editors) then
Editors, editor_etal = name_has_etal (Editors, editor_etal, false, 'editors'); -- find and remove variations on et al.
if editor_etal then
Editors = Editors .. ' ' .. cfg.messages['et al']; -- add et al. to editors parameter beause |display-editors=etal
end
EditorCount = 2; -- we don't know but assume |editors= is multiple names; spoof to display (eds.) annotation
else
Editors = last_first_list; -- either an author name list or an empty string
end
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
Line ୩,୩୪୨ ⟶ ୩,୩୦୫:
TitleLink = ''; -- unset
end
if not utilities.is_set (TitleLink) and utilities.is_set (URL) then
Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. TransError .. Format;
Line ୩,୩୫୯ ⟶ ୩,୩୨୨:
else
local ws_url, ws_label, L; -- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)
ws_url, ws_label, L = wikisource_url_make (Title:gsub('
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Line ୩,୪୫୨ ⟶ ୩,୪୧୫:
TitleNote = utilities.is_set (TitleNote) and (sepc .. " " .. TitleNote) or "";
if utilities.is_set (Edition) then
if Edition:match ('%f[%a][Ee]d
end
Edition = " " .. wrap_msg ('edition', Edition);
Line ୩,୫୧୧ ⟶ ୩,୪୭୪:
end
if utilities.is_set (QuotePage) or utilities.is_set (QuotePages) then -- add page prefix
local quote_prefix = '';
if utilities.is_set (QuotePage) then
if not NoPP then
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePage}), '', '', '';
Line ୩,୫୨୨ ⟶ ୩,୪୮୩:
end
elseif utilities.is_set (QuotePages) then
if tonumber(QuotePages) ~= nil and not NoPP then -- if only digits, assume single page
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePages}), '', '';
Line ୩,୭୬୬ ⟶ ୩,୭୨୬:
if utilities.is_set (PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); --
text = text:sub(1, -sepc:len() - 1);
end
Line ୩,୮୩୮ ⟶ ୩,୭୯୮:
table.insert (maint, v); -- maint msg is the category name
table.insert (maint, ' ('); -- open the link text
table.insert (maint, utilities.
table.insert (maint, ')'); -- and close it
table.insert (maint_msgs, table.concat (maint)); -- assemble new maint message and add it to the maint_msgs table
Line ୩,୮୪୬ ⟶ ୩,୮୦୬:
if not no_tracking_cats then
for _, v in ipairs( z.error_categories ) do
table.insert (render, utilities.
end
for _, v in ipairs( z.maintenance_cats ) do -- append maintenance categories
table.insert (render, utilities.
end
for _, v in ipairs( z.properties_cats ) do -- append properties categories
table.insert (render, utilities.
end
elseif 'nocat' == A:ORIGIN('NoTracking') then -- peculiar special case; can't track nocat without tracking nocat
table.insert (render, utilities.make_wikilink ('Category:CS1 maint: nocat')); -- hand-set this category because it is supposed to be temporary
end
Line ୪,୦୭୬ ⟶ ୪,୦୩୮:
end
end
if not utilities.is_set (error_text) then -- couldn't match with a pattern, is there an
if suggestions.suggestions[ k:lower() ] ~= nil then
error_text, error_state = utilities.set_message ( 'err_parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]}, true );
Line ୪,୧୧୯ ⟶ ୪,୦୮୧:
end
return table.concat ({citation0( config, args), frame:extensionTag ('templatestyles', '', {src=styles})});
end
|