Modul:taxlink

Üdvözlöm, Ön a Modul:taxlink szó jelentését keresi. A DICTIOUS-ban nem csak a Modul:taxlink szó összes szótári jelentését megtalálod, hanem megismerheted az etimológiáját, a jellemzőit és azt is, hogyan kell a Modul:taxlink szót egyes és többes számban mondani. Minden, amit a Modul:taxlink szóról tudni kell, itt található. A Modul:taxlink szó meghatározása segít abban, hogy pontosabban és helyesebben fogalmazz, amikor beszélsz vagy írsz. AModul:taxlink és más szavak definíciójának ismerete gazdagítja a szókincsedet, és több és jobb nyelvi forráshoz juttat.

A modult a Modul:taxlink/doc lapon tudod dokumentálni

local m_links = require('Module:links')

local export = {}

local italicized_ranks = {
	 = true,
	 = true,
	 = true,
	 = true,
	 = true,
	 = true,
	 = true,
	 = true,
	 = true,
	 = true,
	 = true,
	 = true,
	 = true
}

function page_exists(title)
	local link_object = mw.title.new(title) or nil
	if link_object then
		local link_id = link_object.id
		return link_object.id ~= 0 
	end
	return false			

end

function wikispecies_link(title, alt)
	local result = "[[Wikispecies:" .. title
	if alt then
		result = result .. "|" .. alt
	else
		result = result .. "|" .. title
	end
	return result .. "]]"
	
end

function export.main(frame)
	local params = {
		 = {required = true},
		 = {required = true},
		 = {},
		 = {type = "boolean"}
	}
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local lang = require('Module:languages').getByCode('mul')
	local taxon = args
	local rank = args
	local alt = args
	
	local result = ""
	
	local exists = page_exists(taxon)
	
	if not exists then
		result = wikispecies_link(taxon, alt)
	else
		result = m_links.full_link({lang = lang, term = taxon, alt=alt})
	end
	
	if italicized_ranks or args then
		result = require("Module:italics").i(result)
	end
	
	if exists then
		result = result .. "<sup>" .. wikispecies_link(taxon, "ws") .. "</sup>"
	else
		result = result .. "]"
	end
	
	return result
	
end


return export