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

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
I think this should work for nowiki, restore previous edit
self rv, the mw.text library isn't installed? well joy
வரிசை 7:
local z = {
wikitext = require("Module:Wikitext"),
mw = require("Module:Mw")
extensiontags = {
nowiki = true,
ref = true,
gallery = true,
pre = true,
source = true,
categorytree = true,
charinsert = true,
hiero = true,
imagemap = true,
inputbox = true,
math = true,
poem = true,
ref = true,
references = true,
syntaxhighlight = true,
timeline = true,
}
}
 
வரி 35 ⟶ 18:
end
 
function nowiki(frame, content)
-- This returns a string with HTML character entities for wikitext markup characters.
return z.mw.text.nowikitag( {name="nowiki",contents=content,params={}}, frame);
function wikiescape(text)
text = text:gsub( '[&\'%[%]{|}]', {
['&'] = '&',
["'"] = ''',
['['] = '[',
[']'] = ']',
['{'] = '{',
['|'] = '|',
['}'] = '}' } );
return text;
end
 
function createTagexternallinkid(tframe, frameargs)
local name = t.name or "!-- --"
local content = t.contents or ""
local attrs = {}
if ( z.extensiontags[name] ) then
-- We have to preprocess these, so that they are properly turned into so-called "strip markers" in the generated wikitext.
if ( not frame ) then error ("Please supply an extra frame argument to the createTag() function.") end
local params = {}
for n,v in pairs(t.params) do
table.insert(params, "|" .. n .. "=" .. v)
end
return frame:preprocess("{{#tag:" .. name .. "|" .. content .. table.concat(params) .. "}}")
else
for n,v in pairs(t.params) do
if (v) then
table.insert(attrs, n .. "=\"" .. wikiescape(v) .. "\"")
else
table.insert(attrs, n)
end
end
if ("" == content) then
return "<" .. name .. " " .. table.concat(attrs, " ") .. "/>"
else
return "<" .. name .. " " .. table.concat(attrs, " ") .. ">" .. content .. "</" .. name .. ">"
end
end
end
 
function nowiki(content)
return mw.text.nowiki( content );
end
 
function externallinkid(args)
local sep = args.separator or "&nbsp;"
args.suffix = args.suffix or ""
வரி 89 ⟶ 31:
local t0 = onlyinprint(args.label .. sep .. args.id)
local t1 = hideinprint("[[" .. args.link .. "|" .. args.label .. "]]" .. sep .. "[" .. args.prefix .. url_string .. args.suffix .. " " .. nowiki(frame, args.id) .. "]")
return t0 .. t1
end
 
function internallinkid(frame, args)
local sep = args.separator or "&nbsp;"
args.suffix = args.suffix or ""
local t0 = onlyinprint(args.label .. sep .. args.id)
local t1 = hideinprint("[[" .. args.link .. "|" .. args.label .. "]]" .. sep .. "[[" .. args.prefix .. args.id .. args.suffix .. "|" .. nowiki(frame, args.id) .. "]]")
return t0 .. t1
end
 
function amazon(frame, id, domain)
if ( nil == domain ) then
domain = "com"
வரி 108 ⟶ 50:
domain = "co." .. domain
end
return externallinkid(frame, {link="Amazon Standard Identification Number",label="ASIN",prefix="//www.amazon."..domain.."/dp/",id=id,encode=false})
end
 
function doi(frame, id, inactive, nocat)
local cat = ""
local text;
வரி 119 ⟶ 61:
inactive = " (inactive " .. inactive .. ")"
else
text = externallinkid(frame, {link="Digital object identifier",label="doi",prefix="http://dx.doi.org/",id=id,separator=":"})
inactive = ""
end
வரி 129 ⟶ 71:
end
 
function url(frame, id)
local t0 = onlyinprint(id)
local t1 = hideinprint("[" .. id .. " " .. nowiki(frame, id) .. "]")
return t0 .. t1
end
வரி 224 ⟶ 166:
end
 
function openlibrary(frame, id)
local cat = ""
local prefix = ""
வரி 238 ⟶ 180:
cat = cat .. "[[Category:Pages with OL errors]]"
end
local text = externallinkid(frame, {link="Open Library",label="OL",prefix=prefix,id=id})
return text .. cat
end
வரி 292 ⟶ 234:
end
if ( "scap" == format ) then result= createTagz.mw.text.tag({name="span", contents=result, params={class="smallcaps", style="font-variant:small-caps;"}}) end -- if necessary wrap result in <span> tag to format in Small Caps
return result, count
end
வரி 404 ⟶ 346:
end
 
function citation0( configframe, args)
local attrsconfig = {};
for k, v in pairs( frame.args ) do -- the arguments passed BY the template, in the wikitext of the template itself
nowikiconfig[k] = true,v;
}end
 
--------------------------------------------------- Get parameters
local PPrefix = config.PPrefix or "p.&nbsp;"
வரி 861 ⟶ 807:
if ( SubscriptionRequired ~= nil and
SubscriptionRequired ~= "" ) then
SubscriptionRequired = sepc .. " " .. createTagz.mw.text.tag({name="span", contents="(subscription required)", params={style="font-size:0.95em; font-size: 90%; color: #555"}})
else
SubscriptionRequired = ""
end
if ( ARXIV ~= nil and ARXIV ~= "" ) then
ARXIV = sepc .. " " .. externallinkid(frame, {label="arXiv",link="arXiv",prefix="http://arxiv.org/abs/",id=ARXIV,separator=":",encode=false}) else ARXIV = "" end
if ( ASIN ~= nil and ASIN ~= "" ) then
ASIN = sepc .. " " .. amazon(frame, ASIN, ASINTLD) else ASIN = "" end
if ( BIBCODE ~= nil and BIBCODE ~= "" ) then
BIBCODE = sepc .. " " .. externallinkid(frame, {label="Bibcode",link="Bibcode",prefix="http://adsabs.harvard.edu/abs/",id=BIBCODE,separator=":"}) else BIBCODE = "" end
if ( DOI ~= nil and DOI ~= "" ) then
DOI = sepc .. " " .. doi(frame, DOI, DoiBroken) else DOI = "" end
if ( ID ~= nil and ID ~="") then ID = sepc .." ".. ID else ID="" end
if ( ISBN ~= nil and ISBN ~= "") then
ISBN = sepc .. " " .. internallinkid(frame, {label="ISBN",link="International Standard Book Number",prefix="Special:BookSources/",id=ISBN}) else ISBN = "" end
if ( ISSN ~= nil and ISSN ~="" ) then
ISSN = sepc .. " " .. externallinkid(frame, {label="ISSN",link="International Standard Serial Number",prefix="//www.worldcat.org/issn/",id=ISSN,encode=false}) else ISSN = "" end
if ( JFM ~= nil and JFM ~="" ) then
JFM = sepc .." " .. externallinkid(frame, {label="JFM",link="Jahrbuch über die Fortschritte der Mathematik",prefix="http://www.zentralblatt-math.org/zmath/en/search/?format=complete&q=an:",id=JFM}) else JFM = "" end
if ( JSTOR ~= nil and JSTOR ~="") then
JSTOR = sepc .." " .. externallinkid(frame, {label="JSTOR",link="JSTOR",prefix="http://www.jstor.org/stable/",id=JSTOR}) else JSTOR = "" end
if ( LCCN ~= nil and LCCN ~="" ) then
LCCN = sepc .." " .. externallinkid(frame, {label="LCCN",link="Library of Congress Control Number",prefix="http://lccn.loc.gov/",id=LCCN,encode=false}) else LCCN = "" end
if ( MR ~= nil and MR ~="" ) then
MR = sepc .." " .. externallinkid(frame, {label="MR",link="Mathematical Reviews",prefix="http://www.ams.org/mathscinet-getitem?mr=",id=MR}) else MR = "" end
if ( OCLC ~= nil and OCLC ~="") then
OCLC = sepc .." " .. externallinkid(frame, {label="OCLC",link="OCLC",prefix="//www.worldcat.org/oclc/",id=OCLC}) else OCLC = "" end
if ( OL ~= nil and OL ~="") then
OL = sepc .." " .. openlibrary(frame, OL) else OL = "" end
if ( OSTI ~= nil and OSTI ~="") then
OSTI = sepc .." " .. externallinkid(frame, {label="OSTI",link="Office of Scientific and Technical Information",prefix="http://www.osti.gov/energycitations/product.biblio.jsp?osti_id=",id=OSTI}) else OSTI = "" end
if ( PMC ~= nil and PMC ~="") then
PMC = sepc .." " .. externallinkid(frame, {label="PMC",link="PubMed Central",prefix="//www.ncbi.nlm.nih.gov/pmc/articles/PMC",suffix=" ",id=PMC}) else PMC = "" end
if ( PMID ~= nil and PMID ~="") then
PMID = sepc .." " .. externallinkid(frame, {label="PMID",link="PubMed Identifier",prefix="//www.ncbi.nlm.nih.gov/pubmed/",id=PMID,encode=false}) else PMID = "" end
if ( RFC ~= nil and RFC ~="") then
RFC = sepc .." " .. externallinkid(frame, {label="RFC",link="Request for Comments",prefix="//tools.ietf.org/html/rfc",id=RFC,encode=false}) else RFC = "" end
if ( SSRN ~= nil and SSRN ~="") then
SSRN = sepc .." " .. externallinkid(frame, {label="SSRN",link="Social Science Research Network",prefix="http://ssrn.com/abstract=",id=SSRN}) else SSRN = "" end
if ( URL ~= nil and URL ~="") then
URL = " " .. url(frame, URL)
else
URL = ""
end
if ( ZBL ~= nil and ZBL ~="") then
ZBL = sepc .." " .. externallinkid(frame, {label="Zbl",link="Zentralblatt MATH",prefix="http://www.zentralblatt-math.org/zmath/en/search/?format=complete&q=an:",id=ZBL}) else ZBL = "" end
if ( Quote and Quote ~="" ) then
if Quote:sub(1,1) == '"' and Quote:sub(-1,-1) == '"' then
வரி 1,104 ⟶ 1,050:
end
text = createTagz.mw.text.tag({name="span", contents=text, params=args})
 
local empty_span = createTagz.mw.text.tag( {name="span", contents="&nbsp;", params={style="display: none;"}} );
-- Note: Using display: none on then COinS span breaks some clients.
local OCinS = createTagz.mw.text.tag({name="span", contents=empty_span, params={class="Z3988",title=OCinStitle }})
return text .. OCinS
வரி 1,120 ⟶ 1,066:
if ( page ~= nil ) then
local contents = ":" .. page
p = createTagz.mw.text.tag({name="sup",contents=contents,params={class="reference",style="white-space:nowrap;"}})
end
return createTagz.mw.text.tag({name="ref",contents="",params={name=name,group=group}}, frame) .. p
end
 
வரி 1,153 ⟶ 1,099:
params.style = params.style .. " " .. z.wikitext.columnwidthstyle(width)
end
local references = createTagz.mw.text.tag({name="references",contents=contents,params={group=group}}, frame)
return createTagz.mw.text.tag({name="div",contents=references,params=params})
end
 
வரி 1,209 ⟶ 1,155:
local pframe = frame:getParent()
local id = pframe.args.id or pframe.args[1] or ""
return doi(frame, id)
end
 
வரி 1,216 ⟶ 1,162:
local pframe = frame:getParent()
local Name = pframe.args[1] or ""
return hideinprint(frame, "[[International Standard Serial Number|ISSN]]&nbsp;[http://www.worldcat.org/search?fq=x0:jrnl&q=n2:" .. Name .. " " .. Name .. "]")
end
 
வரி 1,239 ⟶ 1,185:
args[k] = v;
end
return citation0( configframe, args)
 
local config = {};
for k, v in pairs( frame.args ) do
config[k] = v;
end
return citation0( config, args)
end
 
வரி 1,253 ⟶ 1,193:
local content = crossref(frame, pframe.args)
local args = { name = refid(pframe.args) }
return createTagz.mw.text.tag({name = "ref", contents = content, params = args}, frame)
end
 
வரி 1,287 ⟶ 1,227:
params.class="reference"
if ( args.noid == nil or args.noid == "" ) then params.id = "ref_" .. P1 .. P3 end
return createTagz.mw.text.tag({name="sup",contents=contents,params=params})
end
 
வரி 1,300 ⟶ 1,240:
local contents
if arrow ~= "" then
local sup_arrow = createTagz.mw.text.tag({name="sup",contents=arrow,params={}})
contents = "[[#ref_" .. id .. arrow .. "|<b>" .. sup_arrow .. "</b>]]" .. postscript
if "none" == arrow then arrow = "^" end -- Change this AFTER using it in the ID parameter and the contents.
வரி 1,310 ⟶ 1,250:
params.id = mw.uri.anchorEncode("endnote_" .. id .. arrow)
end
return createTagz.mw.text.tag({name="span",contents=contents,params=params})
end
 
வரி 1,342 ⟶ 1,282:
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
local args = pframe.args -- the arguments passed TO the template, in the wikitext that instantiates the template
return createTagz.mw.text.tag({name="ref",contents=(args[1] or ""),params={name=args.name,group=config.default_group}}, frame)
end
 
"https://tamilar.wiki/w/Module:Citation/CS1" இலிருந்து மீள்விக்கப்பட்டது