మాడ్యూల్:Cs1 documentation support: కూర్పుల మధ్య తేడాలు

Content deleted Content added
దిద్దుబాటు సారాంశం లేదు
దిద్దుబాటు సారాంశం లేదు
పంక్తి 384:
returns first (canonical) name when metaparameter is assigned a table of names
returns name when metaparameter is assigned a single name
returns empty string when metaparameter name not found in alias_src{}, id_src{}, or id_src[meta].custom_access
 
Some lists of aliases might be better served when a particular alias is identified as the canonical alias for a
పంక్తి 396:
to match similar functionality in alias_names_get() (there are slight differences)
<override> must exist in the alias list
does not apply to identifierthe access icon parameters (ignored - these have no aliases)
does not apply to the access icon parameters (ignored)
 
(and which would be best for {{cite news}}? |newspaper= or |work=? can't solve all of the worlds problems at once).
Line 431 ⟶ 430:
for _, v in ipairs (name) do -- here when override is set; spin throu the aliases to make sure override matches alias in table
if v == override then
name = v; -- declare overrideroverride to thebe the canonical param for this use case
break;
end
Line 446 ⟶ 445:
end
else
if not override then
name = id_src[meta].parameters[1]; -- get canonical id handler parameter
else
for _, v in ipairs (id_src[meta].parameters) do -- here when override is set; spin throu the aliases to make sure override matches alias in table
if v == override then
name = v; -- declare override to be the canonical param for this use case
break;
end
end
end
end
else
return ''; -- metaparameter not specified, or no such metaparameter
return '';
end
if 'plain' == args.format then -- format and return the output
if args.id then
return string.format ('<span id="%s">%s</span>', args.id, name); -- plain text with id attribute
Line 472 ⟶ 480:
returns list of aliases for metaparameter <metaparam>
returns empty string when there are no aliases
returns empty string when <metaparam> name not found in alias_src{} or id_src{}; access icon parameters have no aliases so ignored
 
Some lists of aliases might be better served when a particular alias is identified as the canonical alias for a
Line 482 ⟶ 490:
to be the canonical parameter so it won't be listed with the rest of the aliases (normal canonical journal will be)
 
<override> must exist in the alias list except:
when <override> value is 'all', returns the canonical parameter plus all of the aliases
does not apply to identifier parameters (ignored)
 
output format is controlled by |format=
plain - renders in plain text in a <span> tag; may have id attribute
para - renders as it would in {{para|<param>}}
when not specified, refurns the default bold format used for {{csdoc}}
 
{{#invoke:cs1 documentation support|alias_name_get|<metaparam>|<override>|format=[plain|para]}}
 
]]
Line 533 ⟶ 542:
for i, alias in ipairs (aliases) do
if 1 ~= i then -- aliases[1] is the canonical name; don't include it
if 'plain' == args.format then -- format and return the output
table.insert (out, alias); -- plain text
elseif 'para' == args.format then
Line 546 ⟶ 555:
end
 
return ''; -- no meta parammetaparameter with that name or no aliases
end
 
"https://te.wikipedia.org/wiki/మాడ్యూల్:Cs1_documentation_support" నుండి వెలికితీశారు