Module:User:Victar/collapse-quote

  • c. 1700 BCE – 1200 BCE, Ṛgveda 01.068.10:
    ví rā́yaḥ aurṇot dúraḥ purukṣúḥ
    Carrying him themselves, they [=priests] open wide the doors.
  •  
    • Ṛgveda 01.068.10: ví rā́yaḥ aurṇot dúraḥ purukṣúḥ (Carrying him themselves, they [=priests] open wide the doors.)
    • Ṛgveda 01.120.02: vidvā́ṃsāv íd dúraḥ pṛched ávidvān itthā́paro acetā́ḥ (He should ask just the two [=the Aśvins] who know about the doors—he, the man who does not know properly, who later (would be) without insight.)
    • Ṛgveda 03.031.21: prá sūnṛ́tā dišámāna ṛténa dúraš ca víšvā avṛṇod ápa svā́ḥ (And allotting the liberalities [=gifts] in accord with truth, he opened up all the doors that are his own.)
    • Ṛgveda 06.017.06: áurṇoḥ dúraḥ usríyābhyaḥ ví dṛḷhā́ (You opened the doors, opened up the strongholds for the dawn-red ones.)
    • Ṛgveda 07.009.02: sá sukrátur yó ví dúraḥ paṇīnā́m punānó arkám purubhójasaṃ naḥ hótā mandró višā́ṃ dámūnās tirás támo dadṛše rāmyā́ṇām (He of strong resolve, who (opens) up the doors of the Paṇis as he purifies the chant that brings much sustenance for us, he, the delighting Hotar and the housemaster of the clans, has become visible, across the darkness of the nights.)
    • Ṛgveda 7.046.02: ávan ávantīḥ úpa naḥ dúraḥ cara (Providing help, proceed toward our doors that provide help (in return).)

local export = {}
local m_link = require('Module:links')
local m_quotations = require('Module:Quotations')
local m_languages = require("Module:languages")


function export.show(frame)

	local list_with_holes = { list = true, allow_holes = true }
	local params = {
		[1] = { required = true },
		[2] = { required = true, list = true, allow_holes = true },
		["tr"] = list_with_holes,
		["ts"] = list_with_holes,
		["t"] = list_with_holes,
		["pos"] = list_with_holes,
		["gloss"] = { alias_of = "t" },
		["year"] = list_with_holes,
		["author"] = list_with_holes,
		["work"] = list_with_holes,
		["chap"] = list_with_holes,
	}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	local lang = args[1] and m_languages.getByCode(args[1])
	
	local quotes = {}
	local reference = {}
	
	local maxindex = math.max(args[2].maxindex, args.tr.maxindex, args.ts.maxindex)

	for i = 1, maxindex do
		term = m_link.full_link{
			lang = lang,
			sc = sc,
			alt = args[2][i],
			tr = args.tr[i],
			ts = args.ts[i],
			gloss = args.t[i],
			pos = args.pos[i],
		}
		work = m_quotations.Create{
			args[1], nil, args.work[i], args.chap[i],
			form = "work",
		}
		if (args.work[i] or args.chap[i]) then
			table.insert(quotes, work .. ": " .. term)
		else
			table.insert(quotes, term);
		end
	end
	
	local output = { table.concat(quotes, '</li><li>') }
	
	return '<span class="vsSwitcher vsToggleCategory-quotations" data-vs-showtext="quotations ▼" data-vs-hidetext="quotations ▲">'
			..'<span class="vsToggleElement vsButtonText-quotations" style="display:inline-block;">&nbsp;</span>'
			..'<ul class="vsHide"><li>' .. table.concat(output) .. '</li></ul>'
		..'</span>'
end

return export