Notice: Template failed integrity check: /home/jvzmxxx/wiki/extensions/MobileFrontend/includes/skins/minerva.mustache in /home/jvzmxxx/wiki/includes/TemplateParser.php on line 121
Zmiany – Czarnobyl Wiki
Otwórz menu główne

Czarnobyl Wiki β

Zmiany

Moduł:Cytuj

Dodane 2437 bajtów, 23:49, 3 mar 2018
wsparcie dla wielu automatycznych linków
local resources = { modes = { "auto", "książkę", "pismo", "stronęmw.loadData(" }, COinS = { false, -- auto "infoModuł:ofiCytuj/fmt:kev:mtx:bookdane", -- książkę) local access = mw.loadData("infoModuł:ofiCytuj/fmt:kev:mtx:journal", -- pismo "info:ofi/fmt:kev:mtx:journal", -- stronę },  categories = { empty = "[[Kategoria:Szablon cytowania bez parametrów]]", undetermined = "[[Kategoria:Szablon cytowania bez określonego trybu]]", missingArg = "[[Kategoria:Szablon cytowania w trybie 'cytuj %s' bez obowiązkowych parametrów]]", suspectedComma = dostęp"[[Kategoria:Szablon cytowania zawiera przecinek w polu z opisem autora]]", unusedUrl = "[[Kategoria:Szablon cytowania zawiera nieużywany URL]]", unusedPublished = "[[Kategoria:Szablon cytowania zawiera pola 'opublikowany' i 'wydawca']]", sameJournalAndPublished = "[[Kategoria:Szablon cytowania zawiera identyczne pola 'czasopismo' i 'opublikowany']]", }, --[[ ; name : name of the parameter used in the template ; used : indicator whether the parameter is used in specific citation mode list of modes is declared in variable 'modes' at the top of the module the first entry is reserved for automatic full citation mode, which accepts all parameters ; "!" : mandatory ; false : not used ; ''otherwise'' : optional ; "+" : only in one mode, and written differently for easier notice ; "*" : additional support in the code (in url and published for now) --]] params = { chapterauthor = { name = "autor r", used = { true, "+", false, false, }, }, chapter = { name = "rozdział", used = { true, "+", false, false, }, }, author = { name = "autor", used = { true, true, true, true, }, }, editor = { name = "redaktor", used = { true, true, true, true, }, }, url = { name = "url", used = { true, true, true, "*", }, }, title = { name = "tytuł", used = { true, "!", true, "!", }, }, others = { name = "inni", used = { true, "+", false, false, }, }, work = { name = "praca", used = { true, false, false, "+", }, }, journal = { name = "czasopismo", used = { true, false, "!", false, }, }, mediatype = { name = "typ nośnika", used = { true, true, true, true, }, }, responsibility = { name = "odpowiedzialność", used = { true, false, "+", false, }, }, issue = { name = "wydanie", used = { true, true, true, false, }, }, description = { name = "opis", used = { true, "+", false, false, }, }, place = { name = "miejsce", used = { true, true, true, false, }, }, published = { name = "opublikowany", used = { true, "*", "*", "*", }, }, publisher = { name = "wydawca", used = { true, true, true, false, }, }, date = { name = "data", used = { true, true, true, true, }, }, p = { name = "s", used = { true, true, true, true, }, }, doi = { name = "doi", used = { true, true, true, false, }, }, isbn = { name = "isbn", used = { true, "+", false, false, }, }, lccn = { name = "lccn", used = { true, "+", false, false, }, }, issn = { name = "issn", used = { true, true, true, false, }, }, pmid = { name = "pmid", used = { true, false, "+", false, }, }, pmc = { name = "pmc", used = { true, false, "+", false, }, }, bibcode = { name = "bibcode", used = { true, false, "+", false, }, }, oclc = { name = "oclc", used = { true, true, true, false, }, }, arxiv = { name = "arxiv", used = { true, false, false, true, }, }, id = { name = "id", used = { true, true, true, true, }, }, accessdate= { name = "data dostępu", used = { true, true, true, true, }, }, archive = { name = "archiwum", used = { true, true, true, true, }, }, archived = { name = "zarchiwizowano", used = { true, true, true, true, }, }, quotation = { name = "cytat", used = { true, true, true, true, }, }, lang = { name = "język", used = { true, true, true, true, }, }, odn = { name = "odn", used = { true, true, true, true, }, }, },  monthparser = { ["styczeń"] = 1, ["stycznia"] = 1, ["sty"] = 1, ["i"] = 1, ["luty"] = 2, ["lutego"] = 2, ["lut"] = 2, ["ii"] = 2, ["marzec"] = 3, ["marca"] = 3, ["mar"] = 3, ["iii"] = 3, ["kwiecień"] = 4, ["kwietnia"] = 4, ["kwi"] = 4, ["iv"] = 4, ["maj"] = 5, ["maja"] = 5, ["v"] = 5, ["czerwiec"] = 6, ["czerwca"] = 6, ["cze"] = 6, ["vi"] = 6, ["lipiec"] = 7, ["lipca"] = 7, ["lip"] = 7, ["vii"] = 7, ["sierpień"] = 8, ["sierpnia"] = 8, ["sie"] = 8, ["viii"] = 8, ["wrzesień"] = 9, ["września"] = 9, ["wrz"] = 9, ["ix"] = 9, ["październik"] = 10, ["października"] = 10, ["paź"] = 10, ["x"] = 10, ["listopad"] = 11, ["listopada"] = 11, ["lis"] = 11, ["xi"] = 11, ["grudzień"] = 12, ["grudnia"] = 12, ["gru"] = 12, ["xii"] = 12, },  months = { [1] = { m="styczeń", d="stycznia", }, [2] = { m="luty", d="lutego", }, [3] = { m="marzec", d="marca", }, [4] = { m="kwiecień", d="kwietnia", }, [5] = { m="maj", d="maja", }, [6] = { m="czerwiec", d="czerwca", }, [7] = { m="lipiec", d="lipca", }, [8] = { m="sierpień", d="sierpnia", }, [9] = { m="wrzesień", d="września", }, [10] = { m="październik", d="października", }, [11] = { m="listopad", d="listopada", }, [12] = { m="grudzień", d="grudnia", }, }, exactAuthors = { ["Praca zbiorowa"] = true, ["[[Gall Anonim]]"] = true, }}
local function softNoWiki(text)
local result, count = string.gsub(text, "</?[Ss][Pp][Aa][Nn][^>]*>", "")
return result
end
 
local function first(data)
return type(data) == "table" and data[1] or data
end
return false
end
 
authorMethodtable.isIlustrator = function(author)
return checkPatterns(author, {"il%.?", "ilus%.?", "ilustrator" }, {"[%(%[]il%.?[%)%]]", "[%(%[]ilus%.?[%)%]]", "[%(%[]ilustrator[%)%]]" })
end
 
authorMethodtable.isTranslator = function(author)
return checkPatterns(author, {"tłum%.?", "tłumacz" }, {"[%(%[]tłum%.?[%)%]]", "[%(%[]tłumacz[%)%]]" })
end
 
authorMethodtable.isEditor = function(author)
return checkPatterns(author, {"red%.?", "redaktor", "pod red%.?", "pod redakcją" }, {"[%(%[]red%.?[%)%]]", "[%(%[]redaktor[%)%]]" })
end
 
authorMethodtable.isDeveloper = function(author)
return checkPatterns(author, {"oprac%.?", "opracowała?" }, {"[%(%[]oprac%.?[%)%]]", "[%(%[]opracowała?[%)%]]" })
end
end
if initials then
before:tag("span"):css("display", "none"):addClass("cite-name-initials"):attr("title", namehint):wikitext(softNoWiki(data.nameinitials))
end
before:wikitext("&nbsp;")
if not namefirst and (name or initials) then
local after = data.familynamefirst and builder or builder:tag("span"):css("display", "none"):addClass("cite-name-after")
after:wikitext("&nbsp;")
if name then
after:tag("span"):addClass("cite-name-initials"):attr("title", namehint):wikitext(softNoWiki(data.nameinitials))
end
if data.js then
after:wikitext(",")
end
end
if data.js then
builder:wikitext("&nbsp;", data.js)
end
local function makeInitials(name)
local nameinitials = mw.ustring.gsub(name, "(%w[Hh]?)[%w]*%.?([%ws%-%.–—]+?)%s*", "%1. ") -- zostaw początki słów (jedna litera + opcjonalne następujące 'h') nameinitials = mw.ustring.gsub(nameinitials, "%f[%w]%l%.%s", "") -- usuń inicjały z małych liter nameinitials = mw.ustring.gsub(nameinitials, "([^C%W])[Hh]%.?%s", "%1. ") -- usuń drugie 'h' jeśli nie zaczyna się na 'C' nameinitials = mw.ustring.gsub(nameinitials, "(%u[Hh]?)[%.%s]*", "%1. ") -- dodaj brakujące kropki i usuń zbędne spacje
return mw.text.trim(nameinitials)
end
local function parseAuthor(author)
local result = {}
if string.match(author, "\127") then -- wpisy z <nowiki> nie są analizowane
result.exact = author
setmetatable(result, authorMetatable)
return result
end
local author = mw.text.trim(author)
local a = string.gsub(author, "\\[\\%.:]", { ["\\\\"]="\\", ["\\."]=",", ["\\:"]=";", })
if a ~= author then
result.exact = a
setmetatable(result, authorMetatable)
return result
end
 
if resources.exactAuthors[author] then
result.exact = author
end
local prefixprefix1, rest = mw.ustring.match(author, "^([%l%p%s]+)(.+)$") if not prefix prefix1 then
rest = author
prefix prefix1 = ""
end
local prefix = mw.text.trim(prefix0.." "..prefixprefix1)
if #prefix > 0 then
if mw.ustring.sub(prefix, -1) == "#" then
if #suffix > 0 then
result.suffix = mw.ustring.gsub(suffix, "%s+", " ") -- collapse spaces
suffix = " "..result.suffix
for i, v in ipairs(resources.js) do
if mw.ustring.match(suffix, v[1]) then
result.suffix = mw.text.trim(mw.ustring.gsub(suffix, v[1], ""))
result.js = v[2]
break
end
end
else
for i, v in ipairs(resources.js) do
if mw.ustring.match(rest2, v[1]) then
rest2 = mw.text.trim(mw.ustring.gsub(rest2, v[1], ""))
result.js = v[2]
break
end
end
end
local lastname, name = mw.ustring.match(rest2, "%s*([^,]-)%s*,%s*(.-)%s*$")
if not lastname then
lastname, name = mw.ustring.match(rest2, "%s*(%u[%l%d%p]*)%s+(.-)%s*$")
else
local prefix2 name, lastname, prefix2 = mw.ustring.match(rest2, "%s*(.-)%s+((%l[%l%p]%l?)%u[%w%p]-)%s*$") if not resources.lastnamePrefixes[prefix2] then name, lastname = mw.ustring.match(rest2, "%s*(.-)%s+(%u[%w%p]-)%s*$") end
end
elseif resources.lastnamePrefixes[prefix1] then
lastname = prefix1 .. lastname
elseif resources.lastnamePrefixes[prefix1] == false then
name = name.." "..mw.text.trim(prefix1)
end
end
local function loadAuthorcollectAuthors(frame, params, index) local argAuthor = formatDynamicArgName(params.author.name, indexcheckForAltFormat local result = false local author = frame.args[argAuthor] if not author and (#author > 0) then result = parseAuthor(author) end  if not result then
return
end
function decodeEntity(s) local first result = framenil local hex = string.argsmatch(s, "^&#[argFirstxX]([0-9A-Fa-f]+);$") if first and hex then result = mw.ustring.char(tonumber(hex, 16)) else local dec = string.match(s, "^&#first > ([0-9]+) ;$") if dec then result = mw.ustring.char(tonumber(dec, 10)) elseif resources.htmlEntities[s] then result = mw.ustring.char(resources.htmlEntities[s]) else return string.gsub(s, ";", "\\:") end end if result.name = first= ";" then return "\\:" elseif result== "," then return "\\.nameinitials " elseif result = makeInitials(first)= "\\" then return "\\\\" else return result end
end
local link result = {} local esc1 = string.gsub(author, "\\", "\\\\") local esc2 = framestring.argsgsub(esc1, "&#?[argLinka-zA-Z0-9]+;", decodeEntity) local splitter = string.match(esc2, ";") and ";" or "," local authors = mw.text.split(esc2, splitter.."%s*", false) local alt = false if link (splitter == ",") and checkForAltFormat then local altAuthors = {} alt = true for _, v in ipairs(authors) do local n0 = "" local s, n = mw.ustring.match(v, "^(%u%l+)%s(%u+)%.?$") if not s then s, n = mw.ustring.match(v, "^(%u%l+[%s%-–]%u%l+)%s(%u+)%.?$") end if not s then n0, s, n = mw.ustring.match(v, "^(%l%l%l?)%s(%u%l+)%s(%u+)%.?$") -- de, von, van, der etc. end if not s then alt = false break end local initials, _ = mw.ustring.gsub(n, "(%u)", "%1.") if #link n0 > 0then n0 = " "..n0 end table.insert(altAuthors, s..", "..initials..n0) end if alt then authors = altAuthors splitter = ";" result.link = linkend
end
return result
end
local function collectAuthors(author)
if not author then
return
end
local result = {}
local splitter = string.match(author, ";") and ";" or ","
local authors = mw.text.split(author, splitter, true)
for _, v in ipairs(authors) do
local author = parseAuthor(v)
end
return result, local check = false if alt then check = "alt" elseif (#result == 2) and (separator == ",")then check = true end return result, check
end
local a = author:format(nextgroup)
local r = author.link and ("[["..author.link.."|"..a.."]]") or a
local s = "" if useDecorations and (author:isEditor() and " then for _, v in ipairs(redresources.authorFunc)" or do if checkPatterns(author:isTranslator() and " (tłum, v.)" or (author:isIlustrator() and " (ilustprefixes, v.suffixes)" or (author:isDeveloper() and " (opracthen s = v.)" or "")))) or ""append break end end end
return r..s
end
end
table.insert(result, "<span class=\"cite-more-full\">")
local title = {}
for i = 2, count do
table.insert(result, ", ");
table.insert(result, formatter(authors[i]))
table.insert(title, authors[i]:towiki())
end
table.insert(result, "</span>")
table.insert(result, "<span class=\"cite-at-al\" title=\"")
table.insert(result, table.concat(title, ", "))
local function detectArchive(url)
local y, m, d, link = mw.ustring.match(url, "^https?://web%.archive%.org/web/(%d%d%d%d)(%d%d)(%d%d)%d%d%d%d%d%d/(https?://.*)$")
if y then
return link, y.."-"..m.."-"..d
end
local y, m, d, link = mw.ustring.match(url, "^https?://webarchive%.nationalarchives%.gov%.uk/(%d%d%d%d)(%d%d)(%d%d)%d%d%d%d%d%d/(https?://.*)$")
if y then
return link, y.."-"..m.."-"..d
return false, false
end
 
local function isAutoGeneratedUrl(url)
local address = string.gsub(url, "^https?:", "")
for k, v in pairs(resources.params) do
if v.link then
local links = type(v.link) == "table" and v.link or { v.link }
for _, vlink in ipairs(links) do
local prefix = string.gsub(vlink, "^https?:", "")
if (#address > #prefix) and (string.sub(address, 1, #prefix) == prefix) then
return true
end
end
end
end
 
return false
end
-- translate some parameters
local altAuthorParser = false if result.journal and result.pmid and result.author and not result.chapterauthor and not result.editor and not result.others then altAuthorParser = true end result.chapterauthor, result.chapterComma = collectAuthors(result.chapterauthor, false) result.author, result.authorComma = collectAuthors(result.author, altAuthorParser)
result.lang = collectLanguages(result.lang)
result.editor, result.editorComma = collectAuthors(result.editor, false) result.others, result.othersComma = collectAuthors(result.others, false)
local yearRange = false if result.date and mw.ustring.match(result.date, "[12]%d%d%d[-–—][12]%d%d%d") then yearRange = result.date end result.date, result.patchCitoidDate = parseDate(result.- parse main bibliographic date or "", false, false, true)
if result.date then
local bibDate = false local bibDateHint = false local coinsDate = false local odnDate = false for _, v in ipairs(resources.bibDates) do for _, p in ipairs(v.patterns) do local bib, c = mw.ustring.gsub(result.date, p, v.show) if bib and (c > 0) then bibDate = bib bibDateHint = v.hint if v.coins then local cd, cc = mw.ustring.gsub(result.date, p, v.coins) if cd and (cc > 0) then coinsDate = cd end end  if v.odn then local od, oc = mw.ustring.gsub(result.date, p, v.odn) if od and (oc > 0) then odnDate = od end end break end if bibDate then break end end end  if bibDate then result.year date = { bib = bibDate, hint = bibDateHint, coins = coinsDate, odn = odnDate } else local date, patch = tostringparseDate(result.date or "", false, false, true) if date then date.coins = (patch and date.year) or (date.day and string.format("%04d-%02d-%02d", date.year, date.month, date.day)) or (date.month and string.format("%04d-%02d", date.year, date.month)) or date.year date.odn = date.year end result.date = date result.yearRange patchCitoidDate = yearRangepatch end
end
end
if result.journal then
local journalAbbr, _ = mw.ustring.gsub(result.journal, "[%.%s]+", " ")
if mw.ustring.match(journalAbbr, "^[%a%s]+:?[%a%s]+$") then -- kandydat na skrót powinien mieć tylko litery z opcjonalnymi odstępami i co najwyżej jednym dwukropkiem
local expandedJournal = mw.loadData("Moduł:Cytuj/czasopisma")[mw.text.trim(journalAbbr)]
if expandedJournal then
result.originalJournal = result.journal
result.journal = expandedJournal
end
end
result.journal, result.journallink, result.journalurl = splitWikiLink(result.journal)
end
 
if result.url and isAutoGeneratedUrl(result.url) then
result.rejectedurl = true
result.url = false
end
if result.chapterurl and isAutoGeneratedUrl(result.chapterurl) then
result.rejectedurl = true
result.chapterurl = false
end
if result.journalurl and isAutoGeneratedUrl(result.journalurl) then
result.rejectedurl = true
result.journalurl = false
end
if ad then result.archived = ad end
end
elseif not result.archive and result.chapterurl then local al, ad = detectArchive(result.chapterurl) if al then result.archive = result.chapterurl result.chapterurl = al if ad then result.archived = ad end end elseif result.archive and (not (result.url or result.chapterurl) or not result.archived) then
local al, ad = detectArchive(result.archive)
if al and not (result.url or result.chapterurl) then result.url = al end
if ad and not result.archived then result.archived = ad end
end
end
if result.issue edition and result.journal and not result.volume and not result.issue then local volume, issue = mw.ustring.match(result.issueedition, "^%s*([^%(]+)%s+%((.-)%)%s*$");
if volume then
result.journalvolume volume = volume
result.issue = issue
result.edition = nil
end
end
 
if result.pmc and (#result.pmc > 3) and (mw.ustring.sub(result.pmc, 1, 3) == "PMC") then
result.pmc = mw.ustring.sub(result.pmc, 4, #result.pmc)
end
 
if result.accessKind then
result.accessKind = access.choice[result.accessKind]
result.unknownAccess = not result.accessKind
else
result.accessKind = (result.pmc and "open")
or access.doi[doiPrefix]
or access.journals[result.journal]
end
 
if result.doi then
result.doi = mw.text.split(result.doi, '%s+', false)
for i, v in ipairs(result.doi) do
local doiPrefix
local doiSuffix
doiPrefix, doiSuffix = mw.ustring.match(v, "^10%.([^/]+)/(.+)$")
if (doiPrefix == "2307") and not result.jstor then
result.jstor = doiSuffix
end
if not result.accessKind and not result.unknownAccess then
result.accessKind = access.doi[doiPrefix]
end
end
end
.. (authors[3] and (authors[3].lastname or authors[3].exact) or "")
.. (authors[4] and (authors[4].lastname or authors[4].exact) or "")
.. (data.date and data.date.year odn or "")
.. (data.diferentiator or "")
end
if authors[1].exact then result["rft.au"] = authors[1].exact end
end
if data.date and data.date.coins then result["rft.date"] = data.date.day and string.format("%04d-%02d-%02d", data.date.year, data.date.month, data.date.day) or (data.date.month and string.format("%04d-%02d", data.date.year, data.date.month) or data.date.year)coins
end
if data.issue edition then result["rft.edition"] = data.issue edition end
if data.publisher then result["rft.pub"] = data.publisher end
if data.place then result["rft.place"] = data.place end
if data.oclc then table.insert(params, mw.uri.buildQueryString( {rft_id = "info:oclcnum/"..data.oclc})) end
if data.doi then for _, v in ipairs(data.doi) do table.insert(params, mw.uri.buildQueryString( {rft_id = "info:doi/"..data.doiv})) end end
if data.url then table.insert(params, mw.uri.buildQueryString( {rft_id = data.url})) end
if data.pmid then table.insert(params, mw.uri.buildQueryString( {rft_id = "info:pmid/"..data.pmid})) end
result["rft.jtitle"] = plainText(data.journal)
if data.chapter then result["rft.atitle"] = plainText(data.chapter) end
if data.date and data.date.coins then result["rft.date"] = data.date.day and string.format("%04d-%02d-%02d", data.date.year, data.date.month, data.date.day) or (data.date.month and string.format("%04d-%02d", data.date.year, data.date.month) or data.date.year)coins
end
if data.title and author then
if author[1].exact then result["rft.au"] = author[1].exact end
end
if data.journalvolume volume then result["rft.volume"] = data.journalvolume volume end
if data.issue then result["rft.edition"] = data.issue end
if data.publisher then result["rft.pub"] = data.publisher end
if data.pmid then table.insert(params, mw.uri.buildQueryString( {rft_id = "info:pmid/"..data.pmid})) end
if data.pmc then table.insert(params, mw.uri.buildQueryString( {rft_id = "info:pmc/"..data.pmc})) end
if data.doi then for _, v in ipairs(data.doi) do table.insert(params, mw.uri.buildQueryString( {rft_id = "info:doi/"..data.doiv})) end end
if data.url then table.insert(params, mw.uri.buildQueryString( {rft_id = data.url})) end
if data.title then result["rft.atitle"] = plainText(data.title) end
result["rft.jtitle"] = plainText(data.published)
if data.date and data.date.coins then result["rft.date"] = data.date.day and string.format("%04d-%02d-%02d", data.date.year, data.date.month, data.date.day) or (data.date.month and string.format("%04d-%02d", data.date.year, data.date.month) or data.date.year)coins
end
if data.title and author then
-- debug helper
if p.args[3] then mw.log(p.args[3]) end
local customMode = mode
-- try to determine type basing on passed parameters
:addClass("citation")
:attr("id", prepareOdnIdentifier(data))
:wikitext(access.render[data.accessKind], ' ')
local needDot = false
end
if not mw.ustring.match(plainText(data.chapter), ",$") format then builder:wikitext("&#x5B;", data.format,"&#x5D;")
end
end
builder:wikitext(", ")
end
if customMode and data.authorextra then
builder:wikitext(data.authorextra, ", ")
end
builder:wikitext("''", title, "''")
end
if not data.chapter and data.format then builder:wikitext(" &#x5B;", data.format, "&#x5D;") needDot = true elseif not mw.ustring.match(plainText(title), "%p$") then
needDot = true
end
if data.work then
builder:wikitext(", [w:] ", data.work, (not data.mediatype and data.url) and " [online]" or "")
needDot = true
end
if data.journal and (not data.published or (data.journal ~= data.published)) then
--builder:wikitext((data.title or data.work) and ", [w:] „" or "„")
builder:wikitext((data.title or data.work) and ", „" or "„")
local title = softNoWiki(data.journal)
end
if data.issue edition then if data.journalvolume then builder:wikitext(data.journal and ", " or ", datawyd.journalvolume, " (", data.issue, ")"edition) elseif needDot = true end if data.journal volume then builder:wikitext(data.journal and ", " or ", t. ", data.issuevolume) elseneedDot = true end if data.series or data.issue then builder:wikitext(" (", wyddata.series or "", (data.series and data. issue) and "; " or "", data.issueor "", ")") end
needDot = true
end
if data.description and (#data.description > 0) then
builder:wikitext(", ", data.description)
end
if data.date then
builder:wikitext(place and " " or ", ") local shortDate = data.journal and (data.doi or data.pmid or data.pmc) if data.yearRange date.bib and data.date.hint then builder:tag("span"):attr("title", data.date.hint):wikitext(place data.date.bib) elseif data.date.bib then builder:wikitext(data.date.bib) elseif data.date.day and shortDate then builder:tag(" span" or ):attr("title", tostring(data.date.day).." "..resources.months[data.date.month].d.." "..tostring(data.date.year)):wikitext(data.date.year) elseif data.date.month and shortDate then builder:tag("span"):attr("title", resources.months[data.yearRangedate.month].m.." "..tostring(data.date.year)):wikitext(data.date.year)
elseif data.date.day then
builder:wikitext(place and ", " or "", tostring(data.date.day), " ", resources.months[data.date.month].d, " ", tostring(data.date.year))
elseif data.date.month then
builder:wikitext(place and ", " or "", resources.months[data.date.month].m, " ", tostring(data.date.year))
else
builder:wikitext(place and " " or ", ", data.date.year)
end
builder:wikitext(data.diferentiator or "")
if data.doi then
local separator = "&nbsp;" builder:addClass("doi"):wikitext(", [[DOI (identyfikator cyfrowy)|DOI]]:&nbsp;[http://dx") local doiLink = first(resources.params.doi.org/"link) for _, v in ipairs(data.doi) do builder:wikitext(separator, " [", datadoiLink, mw.uri.doiencode(v), " ", softNoWiki(v), "]") separator = ", " end
needDot = true
end
if data.isbn then
for i,v in ipairs(data.isbn) do
builder:wikitext(", ") require("Moduł:ISBN ").link(builder, v)
end
 
needDot = true
end
if data.lccn then
builder:wikitext(", [[Biblioteka Kongresu Stanów Zjednoczonych|LCCN]] [http://", first(resources.params.lccn.loc.gov/"link), mw.uri.encode(data.lccn), " ", data.lccn, "]")
needDot = true
end
if data.issn then
builder:tag("span"):addClass("issn"):wikitext(", [[International Standard Serial Number|ISSN]] [http://worldcat", first(resources.params.org/issn/".link), data.issn, " ", data.issn, "]")
needDot = true
end
if data.pmid then
builder:addClass("pmid"):wikitext(", [[PMID]]:&nbsp;[http://www", first(resources.ncbiparams.nlmpmid.nih.gov/pubmed/"link), data.pmid, " ", data.pmid, "]")
needDot = true
end
if data.pmc then
builder:addClass("pmc"):wikitext(", [[PMCID]]:&nbsp;[http://www", first(resources.ncbiparams.nlm.nihpmc.gov/pmc/articles/PMC"link), data.pmc, "/ PMC", data.pmc, "]")
needDot = true
end
if data.bibcode then
builder:wikitext(", [[Bibcode]]:&nbsp;[http://adsabs", first(resources.harvardparams.edu/abs/"bibcode.link), data.bibcode, " ", data.bibcode, "]")
needDot = true
end
if data.oclc then
builder:wikitext(", [[Online Computer Library Center|OCLC]]&nbsp;[http://worldcat", first(resources.params.org/oclc/".link), mw.uri.encode(data.oclc), " ", data.oclc, "]")
needDot = true
end
local eprint, class = mw.ustring.match(data.arxiv, "^(%S+)%s+%[([^%[%]]+)%]$")
if eprint then
builder:wikitext("[//", first(resources.params.arxiv.org/abs/"link), eprint, " ", eprint, "] &#x5B;[//arxiv.org/archive/", class, " ", class, "]&#x5D;" )
else
builder:wikitext("[//", first(resources.params.arxiv.org/abs/"link), data.arxiv, " ", data.arxiv, "]" )
end
needDot = true
end
if data.jstor then
builder:tag("span"):addClass("jstor"):wikitext(", [[JSTOR]]:&nbsp;[", first(resources.params.jstor.link), data.jstor, " ", data.jstor, "]")
needDot = true
end
if data.accessdate then
builder:tag("span"):addClass("accessdate"):wikitext(" [dostęp ", string.format("%04d-%02d-%02d", data.accessdate.year, data.accessdate.month, data.accessdate.day), "]")
needDot = true
end
if (data.url or data.chapterurl) and data.archive then builder:wikitext(" [zarchiwizowane z [", escapeUrl(data.urlor data.chapterurl), " adresu]")
if data.archived and data.archived.day then
builder:wikitext(" ", string.format("%04d-%02d-%02d", data.archived.year, data.archived.month, data.archived.day))
local addCategories = mw.title.getCurrentTitle().namespace == 0
local problems = {}
if not customMode and (mode == 1 ) then
builder:wikitext(resources.categories.undetermined)
table.insert(problems, "???")
table.insert(problems, resources.categories.sameJournalAndPublished)
end
end
if not data.url and not data.chapterurl then
builder:addClass("nourl")
end
builder:wikitext(string.format(resources.categories.missingArg, resources.modes[mode]))
end
if data.chapterComma or (data.authorComma == true) or data.editorComma or data.othersComma or data.othersbookvolumeComma then table.insert(problems, "!!!")
if addCategories then
builder:wikitext(resources.categories.suspectedComma)
end
end if data.authorComma == "alt" then table.insert(problems, "a?") if addCategories then builder:wikitext(resources.categories.altAuthor) end end if data.originalJournal then table.insert(problems, "c?") if addCategories then builder:wikitext(resources.categories.altJournal) end end local citewiki = (data.journal and mw.ustring.match(data.journal, "[Ww]ikipedia")) or (data.publisher and mw.ustring.match(data.publisher, "[Ww]ikipedia")) or (data.published and mw.ustring.match(data.published, "[Ww]ikipedia")) or (data.url and mw.ustring.match(data.url, "%.wikipedia%.org")) if citewiki then table.insert(problems, "wiki?") if addCategories then builder:wikitext(resources.categories.wiki) end end if data.unknownAccess then table.insert(problems, "!!!dostęp?") if addCategories then builder:wikitext(resources.categories.unknownAccess) end end if data.rejectedurl then table.insert(problems, "url") if addCategories then builder:wikitext(resources.categories.rejectedUrl) end
end
if data.urlWarning then
table.insert(problems, "Url")
if addCategories then
builder:wikitext(resources.categories.unusedUrl)
end
table.insert(problems, "Url")
end
if data.patchCitoidDate then
end
local module return { auto = {}function(frame) return Cite(frame:getParent(), nil)end,
module.auto custom = function(frame) return Cite(frame:getParent(), nil1)end,
return module}
Anonimowy użytkownik