<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="az">
	<id>https://wiki.anas.az/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Modul%3ASources</id>
	<title>Modul:Sources - Redaktə tarixçəsi</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.anas.az/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Modul%3ASources"/>
	<link rel="alternate" type="text/html" href="https://wiki.anas.az/mediawiki/index.php?title=Modul:Sources&amp;action=history"/>
	<updated>2026-05-09T21:49:07Z</updated>
	<subtitle>Vikidə bu səhifənin dəyişikliklər tarixçəsi</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.anas.az/mediawiki/index.php?title=Modul:Sources&amp;diff=95&amp;oldid=prev</id>
		<title>imported&gt;Toghrul R 08:05, 5 iyul 2024-də</title>
		<link rel="alternate" type="text/html" href="https://wiki.anas.az/mediawiki/index.php?title=Modul:Sources&amp;diff=95&amp;oldid=prev"/>
		<updated>2024-07-05T08:05:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Yeni səhifə&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
local utils = require(&amp;#039;Modul:Sources/utils&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local i18nDefaultLanguage = &amp;#039;az&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local i18nEtAlDefault = &amp;#039; et al.&amp;#039;&lt;br /&gt;
local i18nEtAl = {&lt;br /&gt;
	az	= &amp;#039; və b.&amp;#039;,&lt;br /&gt;
	ru	= &amp;#039; и др.&amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local i18nEditors = {&lt;br /&gt;
	fr	= &amp;#039;&amp;#039;,&lt;br /&gt;
	de	= &amp;#039;Hrsg.: &amp;#039;,&lt;br /&gt;
	es	= &amp;#039;&amp;#039;,&lt;br /&gt;
	en	= &amp;#039;&amp;#039;,&lt;br /&gt;
	it	= &amp;#039;&amp;#039;,&lt;br /&gt;
	az	= &amp;#039;red. &amp;#039;,&lt;br /&gt;
	ru	= &amp;#039;под ред. &amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local i18nTranslators = {&lt;br /&gt;
	fr	= &amp;#039;&amp;#039;,&lt;br /&gt;
	de	= &amp;#039;&amp;#039;,&lt;br /&gt;
	es	= &amp;#039;&amp;#039;,&lt;br /&gt;
	en	= &amp;#039;&amp;#039;,&lt;br /&gt;
	it	= &amp;#039;&amp;#039;,&lt;br /&gt;
	ru	= &amp;#039;пер. &amp;#039;,&lt;br /&gt;
	az	= &amp;#039;tər. &amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local i18nVolume = {&lt;br /&gt;
    de  = &amp;#039;Vol.&amp;#039;,&lt;br /&gt;
	fr	= &amp;#039;Vol.&amp;#039;,&lt;br /&gt;
	es	= &amp;#039;Vol.&amp;#039;,&lt;br /&gt;
	en	= &amp;#039;Vol.&amp;#039;,&lt;br /&gt;
	it	= &amp;#039;Vol.&amp;#039;,&lt;br /&gt;
	az	= &amp;#039;C.&amp;#039;,&lt;br /&gt;
	ru	= &amp;#039;Т.&amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local i18nIssue = {&lt;br /&gt;
	en	= &amp;#039;Iss.&amp;#039;,&lt;br /&gt;
	az	= &amp;#039;burax.&amp;#039;,&lt;br /&gt;
	ru	= &amp;#039;вып.&amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local i18nPages = {&lt;br /&gt;
	fr = &amp;#039;P.&amp;#039;,&lt;br /&gt;
	de = &amp;#039;S.&amp;#039;,&lt;br /&gt;
	es = &amp;#039;P.&amp;#039;,&lt;br /&gt;
	en = &amp;#039;P.&amp;#039;,&lt;br /&gt;
	it = &amp;#039;P.&amp;#039;,&lt;br /&gt;
	az = &amp;#039;S.&amp;#039;,&lt;br /&gt;
	ru = &amp;#039;С.&amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local i18nNumberOfPages = {&lt;br /&gt;
	en = &amp;#039;p.&amp;#039;,&lt;br /&gt;
	az = &amp;#039;s.&amp;#039;,&lt;br /&gt;
	ru = &amp;#039;с.&amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local i18nTirage = {&lt;br /&gt;
	en	= &amp;#039;ed. size: %d&amp;#039;,&lt;br /&gt;
	az	= &amp;#039;%d nüs.&amp;#039;,&lt;br /&gt;
	ru	= &amp;#039;%d экз.&amp;#039;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local monthg = {&amp;#039;yanvar&amp;#039;, &amp;#039;fevral&amp;#039;, &amp;#039;mart&amp;#039;, &amp;#039;aprel&amp;#039;, &amp;#039;may&amp;#039;, &amp;#039;iyun&amp;#039;, &amp;#039;iyul&amp;#039;, &amp;#039;avqust&amp;#039;, &amp;quot;sentyabr&amp;quot;, &amp;quot;oktyabr&amp;quot;, &amp;quot;noyabr&amp;quot;, &amp;quot;dekabr&amp;quot;};&lt;br /&gt;
&lt;br /&gt;
local PREFIX_CITEREF = &amp;quot;CITEREF_&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
-- Returns formatted pair {Family name(s), First name(s)}&lt;br /&gt;
local function tokenizeName( fullName )&lt;br /&gt;
	local start = &amp;#039;^%s*&amp;#039; -- matches beginning of the string + arbitrary number of spaces&lt;br /&gt;
	local finish = &amp;#039;%s*$&amp;#039; -- matches end of the string + arbitrary number of spaces&lt;br /&gt;
	local comma = &amp;#039;\,%s+&amp;#039; -- matches comma + single or more spacing character&lt;br /&gt;
	local space = &amp;#039;%s+&amp;#039; -- matches single or more spacing character&lt;br /&gt;
	local name = &amp;#039;(%a[%a\-\&amp;#039;]*)\.?&amp;#039; -- matches single name, have to start with letter, can contain apostrophe and hyphen, may end with dot&lt;br /&gt;
	local surname = &amp;#039;(%a[%a\-\&amp;#039;]*)&amp;#039; -- same as name, but can&amp;#039;t end with dot&lt;br /&gt;
	&lt;br /&gt;
	local f, i = mw.ustring.match(fullName, start .. surname .. comma .. name .. finish)&lt;br /&gt;
	if f then&lt;br /&gt;
		mw.log(&amp;#039;tokenizeName: &amp;quot;&amp;#039; .. fullName .. &amp;#039;&amp;quot;: have &amp;quot;Fa, Im&amp;quot; match&amp;#039;)&lt;br /&gt;
		return {f, mw.ustring.sub( i, 1, 1 ) .. &amp;#039;.&amp;#039;}&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local f, i, o = mw.ustring.match(fullName, start .. surname .. comma .. name .. space .. name .. finish)&lt;br /&gt;
	if f then&lt;br /&gt;
		mw.log( &amp;#039;tokenizeName: &amp;quot;&amp;#039; .. fullName .. &amp;#039;&amp;quot;: have &amp;quot;Fa, Im Ot&amp;quot; match&amp;#039;)&lt;br /&gt;
		return {f, mw.ustring.sub( i, 1, 1 ) .. &amp;#039;.&amp;amp;nbsp;&amp;#039;&lt;br /&gt;
				.. mw.ustring.sub( o, 1, 1 ) .. &amp;#039;.&amp;#039;}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local f1, f2, i = mw.ustring.match(fullName, start .. surname .. space .. surname .. comma .. name .. finish)&lt;br /&gt;
	if f1 then&lt;br /&gt;
		mw.log(&amp;#039;tokenizeName: &amp;quot;&amp;#039; .. fullName .. &amp;#039;&amp;quot;: have &amp;quot;Fa Fa, Im&amp;quot; match&amp;#039;)&lt;br /&gt;
		return {f1 .. &amp;#039;&amp;amp;nbsp;&amp;#039; .. f2, mw.ustring.sub( i, 1, 1 ) .. &amp;#039;.&amp;#039;}&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local i, o, f = mw.ustring.match(fullName, start .. name .. space .. name .. space .. &amp;#039;оглы&amp;#039; .. space .. surname .. finish)&lt;br /&gt;
	if f then&lt;br /&gt;
		mw.log(&amp;#039;tokenizeName: &amp;quot;&amp;#039; .. fullName .. &amp;#039;&amp;quot;: have &amp;quot;Im Ot оглы Fa&amp;quot; match&amp;#039;)&lt;br /&gt;
		return {f, mw.ustring.sub(i, 1, 1) .. &amp;#039;.&amp;amp;nbsp;&amp;#039; .. mw.ustring.sub(o, 1, 1) .. &amp;#039;.&amp;#039;}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local i1, i2, f = mw.ustring.match(fullName, start .. name .. space .. name .. space .. &amp;#039;de&amp;#039; .. space .. surname .. finish)&lt;br /&gt;
	if f then&lt;br /&gt;
		mw.log(&amp;#039;tokenizeName: &amp;quot;&amp;#039; .. fullName .. &amp;#039;&amp;quot;: have &amp;quot;Im Im de Fa&amp;quot; match&amp;#039;)&lt;br /&gt;
		return {f, mw.ustring.sub( i1, 1, 1 ) .. &amp;#039;.&amp;amp;nbsp;&amp;#039; .. mw.ustring.sub( i2, 1, 1 ) .. &amp;#039;.&amp;#039;}&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Try matching k names + surname&lt;br /&gt;
	for k = 1, 4 do&lt;br /&gt;
		pattern = start .. string.rep(name .. space, k) .. surname .. finish&lt;br /&gt;
		matched = {mw.ustring.match(fullName, pattern)}&lt;br /&gt;
		if #matched ~= 0 then&lt;br /&gt;
			mw.log(&amp;#039;tokenizeName: &amp;quot;&amp;#039; .. fullName .. &amp;#039;&amp;quot;: have &amp;quot;Im (x&amp;#039; .. k .. &amp;#039;) Fa&amp;quot; match&amp;#039;)&lt;br /&gt;
			for i = 1, k do&lt;br /&gt;
				matched[i] = mw.ustring.sub(matched[i], 1, 1)&lt;br /&gt;
			end&lt;br /&gt;
			return {matched[k + 1], table.concat(matched, &amp;#039;.&amp;amp;nbsp;&amp;#039;, 1, k) .. &amp;#039;.&amp;#039;}&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	mw.log(&amp;#039;Unmatched any pattern: &amp;quot;&amp;#039; .. fullName .. &amp;#039;&amp;quot;&amp;#039;)&lt;br /&gt;
	return {fullName}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function personNameToAuthorName( fullName )&lt;br /&gt;
	if not fullName then return fullName end&lt;br /&gt;
	local tokenized = tokenizeName(fullName)&lt;br /&gt;
	if #tokenized == 1 then&lt;br /&gt;
		return tokenized[1]&lt;br /&gt;
	else&lt;br /&gt;
		return tokenized[1] .. &amp;#039;&amp;amp;nbsp;&amp;#039; .. tokenized[2]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function personNameToResponsibleName( fullName )&lt;br /&gt;
	if not fullName then return fullName end&lt;br /&gt;
	local tokenized = tokenizeName(fullName)&lt;br /&gt;
	if #tokenized == 1 then&lt;br /&gt;
		return tokenized[1]&lt;br /&gt;
	else&lt;br /&gt;
		return tokenized[2] .. &amp;#039;&amp;amp;nbsp;&amp;#039; .. tokenized[1]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local options_commas = { separator = &amp;#039;, &amp;#039;, conjunction = &amp;#039;, &amp;#039;, format = function( src ) return src end, nolinks = false, preferids = false };&lt;br /&gt;
local options_commas_short = { separator = &amp;#039;, &amp;#039;, conjunction = &amp;#039;, &amp;#039;, format = function( src ) return src end, nolinks = false, preferids = false, short = true };&lt;br /&gt;
local options_commas_nolinks = { separator = &amp;#039;, &amp;#039;, conjunction = &amp;#039;, &amp;#039;, format = function( src ) return src end, nolinks = true, preferids = false };&lt;br /&gt;
local options_commas_it = { separator = &amp;#039;, &amp;#039;, conjunction = &amp;#039;, &amp;#039;, format = function( src ) return &amp;quot;&amp;#039;&amp;#039;&amp;quot; .. src .. &amp;quot;&amp;#039;&amp;#039;&amp;quot; end, nolinks = false, preferids = false };&lt;br /&gt;
local options_commas_it_short = { separator = &amp;#039;, &amp;#039;, conjunction = &amp;#039;, &amp;#039;, format = function( src ) return &amp;quot;&amp;#039;&amp;#039;&amp;quot; .. src .. &amp;quot;&amp;#039;&amp;#039;&amp;quot; end, nolinks = false, preferids = false, short = true };&lt;br /&gt;
local options_commas_it_nolinks = { separator = &amp;#039;, &amp;#039;, conjunction = &amp;#039;, &amp;#039;, format = function( src ) return &amp;quot;&amp;#039;&amp;#039;&amp;quot; .. src .. &amp;quot;&amp;#039;&amp;#039;&amp;quot; end, nolinks = true , preferids = false };&lt;br /&gt;
local options_citetypes = { separator = &amp;#039; &amp;#039;, conjunction = &amp;#039; &amp;#039;, format = function( src ) return &amp;#039;citetype_&amp;#039; .. src end, nolinks = true , preferids = true };&lt;br /&gt;
&lt;br /&gt;
local options_commas_authors = { separator = &amp;#039;, &amp;#039;, conjunction = &amp;#039;, &amp;#039;, format = personNameToAuthorName, nolinks = false, preferids = false };&lt;br /&gt;
local options_commas_responsible = { separator = &amp;#039;, &amp;#039;, conjunction = &amp;#039;, &amp;#039;, format = personNameToResponsibleName, nolinks = false, preferids = false };&lt;br /&gt;
&lt;br /&gt;
local options_arxiv = { separator = &amp;#039;; &amp;#039;, conjunction = &amp;#039;; &amp;#039;, format = function( id ) return &amp;#039;[http://arxiv.org/abs/&amp;#039; .. id .. &amp;#039; arXiv:&amp;#039; .. id .. &amp;#039;]&amp;#039; end, nolinks = true, preferids = false };&lt;br /&gt;
local options_doi = { separator = &amp;#039;; &amp;#039;, conjunction = &amp;#039;; &amp;#039;, format = function( doi ) return &amp;#039;[http://dx.doi.org/&amp;#039; .. doi .. &amp;#039; doi:&amp;#039; .. doi .. &amp;#039;]&amp;#039; end, nolinks = true, preferids = false };&lt;br /&gt;
local options_issn = { separator = &amp;#039;; &amp;#039;, conjunction = &amp;#039;; &amp;#039;, format = function( issn ) return &amp;#039;[https://www.worldcat.org/issn/&amp;#039; .. issn .. &amp;#039; &amp;#039; .. issn .. &amp;#039;]&amp;#039; end, nolinks = true, preferids = false };&lt;br /&gt;
local options_pmid = { separator = &amp;#039;; &amp;#039;, conjunction = &amp;#039;; &amp;#039;, format = function( pmid ) return &amp;#039;[https://www.ncbi.nlm.nih.gov/pubmed/?term=&amp;#039; .. pmid .. &amp;#039; PMID:&amp;#039; .. pmid .. &amp;#039;]&amp;#039; end, nolinks = true, preferids = false };&lt;br /&gt;
&lt;br /&gt;
local function getPersonNameAsLabel( context, entityId, providedLabel, options )&lt;br /&gt;
	-- would custom label provided we don&amp;#039;t need to check entity at all&lt;br /&gt;
	if ( not utils.isEmpty( providedLabel ) ) then&lt;br /&gt;
		mw.log( &amp;#039;Custom label provided for &amp;#039; .. entityId );&lt;br /&gt;
		return options.format( providedLabel );&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local entity = utils.getEntity( context, entityId );&lt;br /&gt;
	if ( not entity ) then return &amp;#039;\&amp;#039;\&amp;#039;(entity &amp;#039; .. entityId .. &amp;#039; is missing)\&amp;#039;\&amp;#039;&amp;#039; end;&lt;br /&gt;
&lt;br /&gt;
	local personName = nil;&lt;br /&gt;
	-- support only labels so far&lt;br /&gt;
	if ( entity.labels[ context.lang ] ) then&lt;br /&gt;
		personName = entity.labels[ context.lang ].value;&lt;br /&gt;
		mw.log(&amp;#039;Got person name of &amp;#039; .. entityId .. &amp;#039; from label: &amp;quot;&amp;#039; .. personName .. &amp;#039;&amp;quot;&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if ( not utils.isInstanceOf( entity, &amp;#039;Q5&amp;#039; ) ) then&lt;br /&gt;
		mw.log( &amp;#039;Entity &amp;#039; .. entityId .. &amp;#039; is not a person&amp;#039; );&lt;br /&gt;
		return personName;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if ( utils.isEmpty( personName ) ) then&lt;br /&gt;
		return &amp;#039;\&amp;#039;\&amp;#039;(not translated to &amp;#039; .. context.lang .. &amp;#039;)\&amp;#039;\&amp;#039;&amp;#039;;&lt;br /&gt;
	else&lt;br /&gt;
		return options.format( personName );&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getPersonNameAsWikitext( context, entityId, customLabel, options )&lt;br /&gt;
	local personName = getPersonNameAsLabel( context, entityId, customLabel, options);&lt;br /&gt;
	if ( personName == nil ) then&lt;br /&gt;
		return nil;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local link = utils.getElementLink( context, entityId, nil );&lt;br /&gt;
	return utils.wrapInUrl( link, personName );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getPeopleAsWikitext( context, value, options )&lt;br /&gt;
	if type( value ) == &amp;#039;string&amp;#039; then&lt;br /&gt;
		return options.format( value )&lt;br /&gt;
	elseif type( value ) == &amp;#039;table&amp;#039; then&lt;br /&gt;
		if value.id then&lt;br /&gt;
			-- this is link&lt;br /&gt;
			if options.preferids then&lt;br /&gt;
				return value.id&lt;br /&gt;
			else&lt;br /&gt;
				if options.nolinks then&lt;br /&gt;
					return getPersonNameAsLabel( context, value.id, value.label, options )&lt;br /&gt;
				else&lt;br /&gt;
					return getPersonNameAsWikitext( context, value.id, value.label, options )&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		local maxAuthors = 10 -- need some restrictions, as some publications have enormous amount of authors (e.g. 115 authors of Q68951544)&lt;br /&gt;
		local resultList = {}&lt;br /&gt;
		for i, tableValue in pairs( value ) do&lt;br /&gt;
			local nextWikitext = getPeopleAsWikitext( context, tableValue, options )&lt;br /&gt;
			if not utils.isEmpty( nextWikitext ) then&lt;br /&gt;
				table.insert( resultList, nextWikitext )&lt;br /&gt;
				if #resultList == maxAuthors + 1 then&lt;br /&gt;
					-- keep one more to indicate that there are too many&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local resultWikitext = &amp;#039;&amp;#039;&lt;br /&gt;
		for i, wikitext in pairs( resultList ) do&lt;br /&gt;
			if i == maxAuthors + 1 then&lt;br /&gt;
				resultWikitext = resultWikitext .. ( i18nEtAl[ context.lang ] or i18nEtAlDefault )&lt;br /&gt;
				break;&lt;br /&gt;
			end&lt;br /&gt;
			if i ~= 1 then&lt;br /&gt;
				resultWikitext = resultWikitext .. &amp;#039;, &amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
			resultWikitext = resultWikitext .. wikitext&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		return resultWikitext&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return options.format( &amp;#039;(unknown type)&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function generateAuthorLinks(context, src)&lt;br /&gt;
	local result = &amp;#039;&amp;#039;&lt;br /&gt;
	if src.author then&lt;br /&gt;
		result = getPeopleAsWikitext( context, src.author, options_commas_authors )&lt;br /&gt;
		result = &amp;#039;&amp;lt;i class=&amp;quot;wef_low_priority_links&amp;quot;&amp;gt;&amp;#039; .. result .. &amp;#039;&amp;lt;/i&amp;gt; &amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendProperty(result, context, src, conjunctor, property, url)&lt;br /&gt;
	if src[property] then&lt;br /&gt;
		if url and src[url] then&lt;br /&gt;
			result = result .. conjunctor .. utils.wrapInUrl( src[url], utils.toString( context, src[property], options_commas_nolinks ) )&lt;br /&gt;
		else&lt;br /&gt;
			result = result .. conjunctor .. utils.toString( context, src[property], options_commas )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendTitle(result, context, src)&lt;br /&gt;
	conjunctor = &amp;#039;&amp;#039;&lt;br /&gt;
 	if src.part then&lt;br /&gt;
 		result = appendProperty(result, context, src, &amp;#039;&amp;#039;, &amp;#039;part&amp;#039;, &amp;#039;parturl&amp;#039;)&lt;br /&gt;
 		conjunctor = &amp;#039; // &amp;#039;&lt;br /&gt;
 	end&lt;br /&gt;
 	result = appendProperty(result, context, src, conjunctor, &amp;#039;title&amp;#039;, &amp;#039;url&amp;#039;)&lt;br /&gt;
 	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendLanguage(result, context, src)&lt;br /&gt;
	if context.lang ~= i18nDefaultLanguage then&lt;br /&gt;
		local langs = require(&amp;#039;Module:Languages&amp;#039;)&lt;br /&gt;
		result = result .. langs.list_ref(p.currentFrame:newChild{ args = {context.lang} })&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendSubtitle(result, context, src)&lt;br /&gt;
	return appendProperty(result, context, src, &amp;#039;: &amp;#039;, &amp;#039;subtitle&amp;#039;) .. &amp;#039;.&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendOriginalTitle(result, context, src)&lt;br /&gt;
	return appendProperty(result, context, src, &amp;#039; = &amp;#039;, &amp;#039;originaltitle&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendPublication(result, context, src)&lt;br /&gt;
	if src.publication then&lt;br /&gt;
		if type( src.publication.title or &amp;#039;&amp;#039;) ~= &amp;#039;string&amp;#039; then&lt;br /&gt;
			error(&amp;#039;type of src.publication.title is not string but &amp;#039; .. type( src.publication.title ) )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		result = result .. &amp;#039; // &amp;#039; .. utils.toString( context, src.publication, options_commas_it_short )&lt;br /&gt;
		if src.publication.subtitle then&lt;br /&gt;
			result = result .. &amp;#039;: &amp;#039; .. utils.toString( context, src.publication.subtitle, options_commas_it_short )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendEditor(result, context, src)&lt;br /&gt;
	if src.editor or src.translator then&lt;br /&gt;
		result = result .. &amp;#039; / &amp;#039;&lt;br /&gt;
		if src.editor then&lt;br /&gt;
			local prefix = i18nEditors[ context.lang ] or i18nEditors[ i18nDefaultLanguage ]&lt;br /&gt;
			result = result .. prefix .. getPeopleAsWikitext( context, src.editor, options_commas_responsible )&lt;br /&gt;
			if src.translator then&lt;br /&gt;
				result = result .. &amp;#039;, &amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if src.translator then&lt;br /&gt;
			local prefix = i18nTranslators[ context.lang ] or i18nTranslators[ i18nDefaultLanguage ]&lt;br /&gt;
			result = result .. prefix .. getPeopleAsWikitext( context, src.translator, options_commas_responsible )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendEdition(result, context, src)&lt;br /&gt;
	return appendProperty(result, context, src, &amp;#039; &amp;#039;, &amp;#039;edition&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendPublicationData(result, context, src)&lt;br /&gt;
	if src.place or src.publisher or src.year then&lt;br /&gt;
		result = result .. &amp;#039; &amp;#039;&lt;br /&gt;
		if src.place then&lt;br /&gt;
			result = result .. utils.toString( context, src.place, options_commas_short )&lt;br /&gt;
			if src.publisher or src.year then&lt;br /&gt;
				result = result .. &amp;#039;: &amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if src.publisher then&lt;br /&gt;
			result = result .. utils.toString( context, src.publisher, options_commas_short )&lt;br /&gt;
			if src.year then&lt;br /&gt;
				result = result .. &amp;#039;, &amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if src.year then&lt;br /&gt;
			result = result .. utils.toString( context, src.year, options_commas )&lt;br /&gt;
		end&lt;br /&gt;
		result = result .. &amp;#039;.&amp;#039;;&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendVolumeAndIssue(result, context, src)&lt;br /&gt;
 	if src.volume or src.issue then&lt;br /&gt;
 		result = result .. &amp;#039; &amp;#039;&lt;br /&gt;
		local letter_vol = i18nVolume[ context.lang ] or i18nVolume[ i18nDefaultLanguage ]&lt;br /&gt;
		local letter_iss = i18nIssue[ context.lang ] or i18nIssue[ i18nDefaultLanguage ]&lt;br /&gt;
		if src.volume then&lt;br /&gt;
			result = appendProperty(result, context, src, letter_vol .. &amp;#039;&amp;amp;nbsp;&amp;#039;, &amp;#039;volume&amp;#039;)&lt;br /&gt;
			result = appendProperty(result, context, src, &amp;#039;, &amp;#039; .. letter_iss .. &amp;#039;&amp;amp;nbsp;&amp;#039;, &amp;#039;issue&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			result = appendProperty(result, context, src, letter_iss .. &amp;#039;&amp;amp;nbsp;&amp;#039;, &amp;#039;issue&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		result = result .. &amp;#039;.&amp;#039;&lt;br /&gt;
 	end&lt;br /&gt;
 	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendPages(result, context, src)&lt;br /&gt;
	if src.pages then&lt;br /&gt;
		local letter = i18nPages[ context.lang ] or i18nPages[ i18nDefaultLanguage ]&lt;br /&gt;
		local strPages = utils.toString( context, src.pages, options_commas )&lt;br /&gt;
		strPages = mw.ustring.gsub( strPages, &amp;#039;[-—]&amp;#039;, &amp;#039;–&amp;#039; );&lt;br /&gt;
		result = result .. &amp;#039; &amp;#039; .. letter .. &amp;#039;&amp;amp;nbsp;&amp;#039; .. strPages .. &amp;#039;.&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendNumberOfPages(result, context, src)&lt;br /&gt;
	if src.numberOfPages then&lt;br /&gt;
		local letter = i18nNumberOfPages[ context.lang ] or i18nNumberOfPages[ i18nDefaultLanguage ]&lt;br /&gt;
		result = appendProperty(result, context, src, &amp;#039; &amp;#039;, &amp;#039;numberOfPages&amp;#039;) .. &amp;#039;&amp;amp;nbsp;&amp;#039; .. letter&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendBookSeries(result, context, src)&lt;br /&gt;
	if src.bookSeries then&lt;br /&gt;
		result = appendProperty(result, context, src, &amp;#039; — (&amp;#039;, &amp;#039;bookSeries&amp;#039;)&lt;br /&gt;
	 	if src.bookSeriesVolume or src.bookSeriesIssue then&lt;br /&gt;
	 		result = result .. &amp;#039;; &amp;#039;&lt;br /&gt;
	 		local letter_vol = i18nVolume[ context.lang ] or i18nVolume[ i18nDefaultLanguage ]&lt;br /&gt;
	 		local letter_iss = i18nIssue[ context.lang ] or i18nIssue[ i18nDefaultLanguage ]&lt;br /&gt;
			if ( src.bookSeriesVolume ) then&lt;br /&gt;
				result = appendProperty(result, context, src, letter_vol .. &amp;#039;&amp;amp;nbsp;&amp;#039;, &amp;#039;bookSeriesVolume&amp;#039;)&lt;br /&gt;
				result = appendProperty(result, context, src, &amp;#039;, &amp;#039; .. letter_iss .. &amp;#039;&amp;amp;nbsp;&amp;#039;, &amp;#039;bookSeriesIssue&amp;#039;)&lt;br /&gt;
			else&lt;br /&gt;
				result = appendProperty(result, context, src, letter_iss .. &amp;#039;&amp;amp;nbsp;&amp;#039;, &amp;#039;bookSeriesIssue&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
	 	end&lt;br /&gt;
		result = result .. &amp;#039;)&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendTirage(result, context, src)&lt;br /&gt;
	if src.tirage then&lt;br /&gt;
		local tirageTemplate = i18nTirage[ context.lang ] or i18nTirage[ i18nDefaultLanguage ]&lt;br /&gt;
		result = result .. &amp;#039; &amp;#039; .. utils.toString( context, src.tirage, { separator = &amp;#039;; &amp;#039;, conjunction = &amp;#039;; &amp;#039;, format = function( data ) return mw.ustring.format(tirageTemplate, data) end } )&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendIdentifiers(result, context, src)&lt;br /&gt;
	if src.isbn  then result = result .. &amp;#039; ISBN &amp;#039; .. utils.toString( context, src.isbn, options_commas )	end&lt;br /&gt;
	if src.issn  then result = result .. &amp;#039; ISSN &amp;#039; .. utils.toString( context, src.issn, options_issn )	end&lt;br /&gt;
	if src.doi   then result = result .. &amp;#039; &amp;#039; .. utils.toString( context, src.doi, options_doi )			end&lt;br /&gt;
	if src.pmid  then result = result .. &amp;#039; &amp;#039; .. utils.toString( context, src.pmid, options_pmid )			end&lt;br /&gt;
	if src.arxiv then result = result .. &amp;#039; &amp;#039; .. utils.toString( context, src.arxiv, options_arxiv )		end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendSourceId(result, context, src)&lt;br /&gt;
	if src.sourceId then&lt;br /&gt;
		local citetype = src.type and utils.toString(context, src.type, options_citetypes) or &amp;#039;citetype_unknown&amp;#039;&lt;br /&gt;
		result = &amp;#039;&amp;lt;span class=&amp;quot;wikidata_cite &amp;#039; .. citetype .. &amp;#039;&amp;quot; data-entity-id=&amp;quot;&amp;#039; .. utils.getSingle(src.sourceId) .. &amp;#039;&amp;quot;&amp;gt;&amp;#039; .. result .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function appendAccessDate(result, context, src)&lt;br /&gt;
	if src.accessdate then&lt;br /&gt;
			local date = utils.getSingle(src.accessdate)&lt;br /&gt;
			local pattern = &amp;quot;(%-?%d+)%-(%d+)%-(%d+)T&amp;quot;;&lt;br /&gt;
			local y, m, d = mw.ustring.match(date, pattern)&lt;br /&gt;
			y, m, d = tonumber(y), tonumber(m), tonumber(d)&lt;br /&gt;
			local date_str = (d &amp;gt; 0 and &amp;#039; &amp;#039; .. tostring(d) or &amp;#039;&amp;#039;) &lt;br /&gt;
						  .. (m &amp;gt; 0 and &amp;#039; &amp;#039; .. monthg[m] or &amp;#039;&amp;#039;)&lt;br /&gt;
						  .. (y &amp;gt; 0 and &amp;#039; &amp;#039; .. tostring(y) or &amp;#039;&amp;#039;)&lt;br /&gt;
			result = result .. &amp;quot; &amp;lt;small&amp;gt;İstifadə tarixi&amp;quot; .. date_str .. &amp;quot;.&amp;lt;/small&amp;gt;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function populateUrl(context, src)&lt;br /&gt;
	if src.sourceId and not src.url then&lt;br /&gt;
		local entity = utils.getEntity(context, src.sourceId)&lt;br /&gt;
		if entity.sitelinks and entity.sitelinks[context.lang .. &amp;#039;wikisource&amp;#039;] then&lt;br /&gt;
			src.url = &amp;#039;:&amp;#039; .. context.lang .. &amp;#039;:s:&amp;#039; .. entity.sitelinks[context.lang .. &amp;#039;wikisource&amp;#039;].title&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function populateYear(src)&lt;br /&gt;
	if not src.year and src.dateOfPublication then&lt;br /&gt;
		local date = utils.getSingle(src.dateOfPublication)&lt;br /&gt;
		src.year = mw.ustring.sub(date, 2, 5)&lt;br /&gt;
	end&lt;br /&gt;
	if not src.year and src.dateOfCreation then&lt;br /&gt;
		local date = utils.getSingle(src.dateOfCreation)&lt;br /&gt;
		src.year = mw.ustring.sub(date, 2, 5)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function populateTitle(src)&lt;br /&gt;
	src.title = src.title or utils.getSingle(src.url) or &amp;#039;\&amp;#039;\&amp;#039;(unspecified title)\&amp;#039;\&amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function renderSource(context, src)&lt;br /&gt;
	options_commas_authors.format = personNameToAuthorName&lt;br /&gt;
	options_commas_responsible.format = personNameToResponsibleName&lt;br /&gt;
&lt;br /&gt;
	context.lang = utils.getLangCode(utils.getSingle(src.lang)) or i18nDefaultLanguage&lt;br /&gt;
&lt;br /&gt;
	utils.preprocessPlaces(src, context.lang)&lt;br /&gt;
&lt;br /&gt;
	populateUrl(context, src)&lt;br /&gt;
	populateTitle(src)&lt;br /&gt;
	populateYear(src)&lt;br /&gt;
&lt;br /&gt;
	local result = generateAuthorLinks(context, src)&lt;br /&gt;
	result = appendTitle(result, context, src)&lt;br /&gt;
	result = appendLanguage(result, context, src)&lt;br /&gt;
	result = appendSubtitle(result, context, src)&lt;br /&gt;
	result = appendOriginalTitle(result, context, src)&lt;br /&gt;
	result = appendPublication(result, context, src)&lt;br /&gt;
	&lt;br /&gt;
	result = result .. &amp;#039;&amp;lt;span class=&amp;quot;wef_low_priority_links&amp;quot;&amp;gt;&amp;#039;&lt;br /&gt;
	result = appendEditor(result, context, src) -- Might take current editor instead of actual. Use with caution&lt;br /&gt;
	result = appendEdition(result, context, src)&lt;br /&gt;
	result = appendPublicationData(result, context, src)&lt;br /&gt;
	result = appendVolumeAndIssue(result, context, src)&lt;br /&gt;
	result = appendPages(result, context, src)&lt;br /&gt;
	result = appendNumberOfPages(result, context, src)&lt;br /&gt;
	result = appendBookSeries(result, context, src)&lt;br /&gt;
	result = appendTirage(result, context, src)&lt;br /&gt;
	result = appendIdentifiers(result, context, src)&lt;br /&gt;
	result = appendSourceId(result, context, src)&lt;br /&gt;
	result = appendAccessDate(result, context, src)&lt;br /&gt;
	result = result .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function renderReferenceImpl(currentEntity, reference, refAnchor, refAnchorYear)&lt;br /&gt;
	if not reference.snaks then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- контекст, содержит также кеш элементов&lt;br /&gt;
	local context = {&lt;br /&gt;
		cache = {}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	-- данные в простом формате, согласованном с модулями формирования библиографического описания&lt;br /&gt;
	local data = {}&lt;br /&gt;
&lt;br /&gt;
    -- забрать данные из reference&lt;br /&gt;
    utils.populateDataFromClaims(context, nil, reference.snaks, data)&lt;br /&gt;
&lt;br /&gt;
	utils.expandSpecials(context, currentEntity, reference, data)&lt;br /&gt;
&lt;br /&gt;
	local sourceEntity = nil&lt;br /&gt;
	if data.sourceId then&lt;br /&gt;
		sourceEntity = utils.getEntity(context, data.sourceId)&lt;br /&gt;
		if sourceEntity then&lt;br /&gt;
			utils.populateSourceDataImpl(context, sourceEntity, data)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if data.publication then&lt;br /&gt;
		utils.expandPublication(context, sourceEntity, data)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	utils.expandBookSeries(context, data)&lt;br /&gt;
&lt;br /&gt;
	if next(data) == nil then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local rendered = renderSource(context, data)&lt;br /&gt;
	if mw.ustring.len(rendered) == 0 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if refAnchor then&lt;br /&gt;
		local anchorValue = &amp;#039;CITEREF&amp;#039; .. refAnchor .. (utils.coalesce(refAnchorYear, data.year) or &amp;#039;&amp;#039;)&lt;br /&gt;
		rendered = &amp;#039;&amp;lt;span class=&amp;quot;citation&amp;quot; id=&amp;quot;&amp;#039; .. mw.uri.anchorEncode(anchorValue) .. &amp;#039;&amp;quot;&amp;gt;&amp;#039; .. rendered .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return rendered&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function artificialSnaks(args)&lt;br /&gt;
	local snaks = {}&lt;br /&gt;
	if args[1] then&lt;br /&gt;
		entityId = mw.text.trim(args[1])&lt;br /&gt;
		snaks.P248 = {utils.toWikibaseEntityIdSnak(&amp;quot;P248&amp;quot;, entityId)}&lt;br /&gt;
		snaks.P805 = {utils.toWikibaseEntityIdSnak(&amp;quot;P805&amp;quot;, entityId)}&lt;br /&gt;
	end&lt;br /&gt;
	utils.copyArgsToSnaks(args, snaks)&lt;br /&gt;
	return mw.wikibase.getEntity(), {snaks = snaks}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderReference(frame, currentEntity, reference)&lt;br /&gt;
	p.currentFrame = frame&lt;br /&gt;
&lt;br /&gt;
	-- template call&lt;br /&gt;
	if frame and not currentEntity and not reference then&lt;br /&gt;
		currentEntity, reference = artificialSnaks(frame.args)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local rendered = renderReferenceImpl(currentEntity, reference)&lt;br /&gt;
	if not rendered then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	-- Про выбор алгоритма хеширования см. [[Модуль:Hash]]. Знак подчёркивания в начале позволяет&lt;br /&gt;
	-- исключить ошибку, когда имя сноски — чисто числовое значение, каковыми иногда бывают хеши.&lt;br /&gt;
	return frame:extensionTag(&amp;#039;ref&amp;#039;, rendered, {name = &amp;#039;_&amp;#039; .. mw.hash.hashValue(&amp;#039;fnv164&amp;#039;, rendered)}) .. &amp;#039;[[Category:Vikipediya:Vikidatada mənbələri olan məqalələr]]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderSource(frame)&lt;br /&gt;
	p.currentFrame = frame&lt;br /&gt;
	currentEntity, reference = artificialSnaks(frame.args)&lt;br /&gt;
	return renderReferenceImpl(currentEntity, reference, frame.args[&amp;#039;ref&amp;#039;], frame.args[&amp;#039;ref-year&amp;#039;])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p;&lt;/div&gt;</summary>
		<author><name>imported&gt;Toghrul R</name></author>
	</entry>
</feed>