Перайсці да зместу

Модуль:марф/sources

З пляцоўкі Вікіслоўнік

Дакументацыю да гэтага модуля можна стварыць у Модуль:марф/sources/Дакументацыя

local export = {}
local u = require("Module:utils")

function export.process_sources(value, title)
	skip_categories = false
	if value == 'т' then
		reference = '{{Тіханоў}}'
	elseif value == 'т2' or value == 'т-ся' then
		if u.endswith(title, 'ся') then
			reference = '{{Тіханоў|' .. mw.ustring.sub(title, 1, -3) .. '(ся)}}'
		else
			reference = '{{Тіханоў|2=(ся)}}'
		end
	elseif value == 'т-сь' then
		if u.endswith(title, 'сь') then
			reference = '{{Тіханоў|' .. mw.ustring.sub(title, 1, -3) .. '(сь)}}'
		else
			reference = '{{Тіханоў|2=(сь)}}'
		end
	elseif u.startswith(value, 'т:') then
		reference = '{{Тіханоў|' .. mw.ustring.sub(value, 3) .. '}}'
	elseif u.contains({'т3'}, value) then
		reference = '{{Тіханоў-3}}'
	elseif u.contains({'є'}, value) then
		reference = '{{Ефремава}}'
		skip_categories = true
	elseif u.contains({'к', 'кє', 'к,є', 'к, є'}, value) then
		reference = '{{Кузнецова і Ефремава}}'
		skip_categories = true
	elseif u.contains({'п'}, value) then
		reference = '{{Палюга}}'
	elseif u.contains({'БУС'}, value) then
		reference = '{{БУС|сокр=1}}'
	else
		-- reference = wu.span_red('(невідоме джерело)')
		reference = ''
	end
	return reference, skip_categories
end

return export