Butun axtardiqlarinizi tapmaq ucun buraya: DAXIL OLUN
  Mp4 Mp3 Axtar Yukle
  Video Axtar Yukle
  Shekil Axtar Yukle
  Informasiya Melumat Axtar
  Hazir Inshalar Toplusu
  AZERI CHAT + Tanishliq
  1-11 Sinif Derslikler Yukle
  Saglamliq Tibbi Melumat
  Whatsapp Plus Yukle(Yeni)

  • Ana səhifə
  • Təsadüfi
  • Yaxınlıqdakılar
  • Daxil ol
  • Nizamlamalar
İndi ianə et Əgər Vikipediya sizin üçün faydalıdırsa, bu gün ianə edin.

Modul:ParseVauthors

  • Modul
  • Müzakirə
Sənədləşdirmə
[bax | | tarixçə | yenilə]

İstifadə

{{#invoke:ParseVauthors|parse}}

Səhifə xətalarının olmaması üçün bu şablon üzərində təcrübələri öz şəxsi səhifənizdə aparmağınız məsləhət görülür.

local p = {}

function p.parse(frame)
	local args = frame:getParent().args -- This gets the arguments passed to the template that called #invoke, so we don't need to pass them all through to the module. See also [[Module:Arguments]].
	local vauthors = args[1] or args.vauthors
	local authorTable
	local lastfirstTable
	local nauthors
	if vauthors then
		if string.find(vauthors, ';') or string.find(vauthors, '%.') then
			verror = true -- Vancouver author format should not contain semicolons or periods
		else
			verror = false
		end
		authorTable = mw.text.split(vauthors, "%s*,%s*")
	else
		authorTable = {}
	end
	local citeArgs = {}
	for k, v in pairs(args) do
		citeArgs[k] = v
	end
	citeArgs[1] = nil -- Erase vauthors from the citation arguments.
	citeArgs.vauthors = nil -- Erase vauthors from the citation arguments.
	nauthors = 0
	for i, author in ipairs(authorTable) do
		if string.find(author, "%s") then
		    lastfirstTable = {}
		    lastfirstTable = mw.text.split(author, "%s")
		    first = table.remove(lastfirstTable)
		    last  = table.concat(lastfirstTable, " ")
		    citeArgs['first' .. i] = first
		    citeArgs['last' .. i]  = last
		    nauthors = nauthors + 1
		else
			citeArgs['first' .. i] = ""
			citeArgs['last' .. i]  = author
		    nauthors = nauthors + 1
		end
	end

	if citeArgs['name-list-format'] == nil then
	    citeArgs['name-list-format'] = "vanc" -- change default settings of authorformat, etc. parameters so that Vancouver style author format is used
	end
	if citeArgs['display-authors'] == nil and citeArgs['displayauthors'] == nil and nauthors > 6 then
		citeArgs['display-authors'] = '6'
    end

	if verror then
        errorArgs = {}
        errorArgs['1']='vauthors format'
		return frame:expandTemplate{title = 'cite journal', args = citeArgs}, frame:expandTemplate{title = 'citation error', args = errorArgs}
	else
		return frame:expandTemplate{title = 'cite journal', args = citeArgs}
	end
end

return p
Mənbə — "https://az.wikipedia.org/w/index.php?title=Modul:ParseVauthors&oldid=3235705"
Informasiya Melumat Axtar