Module:R:Cunliffe

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Generates the entry link for {{R:Cunliffe}}.


local export = {}

function load_data(w)
    --return mw.loadData("Module:R:Cunliffe/data")[w]
	return require("Module:data tables").index_table("grc_RCunliffe_lemma_to_index", w)
end

function export.index(frame)
	local args = frame:getParent().args
	local title = args['w'] or args[1] or mw.title.getCurrentTitle().text
	local title_span = '<span class="Polyt" lang="grc">' .. title .. '</span>'
	
	local eid = args.eid
	if not eid then
		local n = load_data(title)
		eid = n and n[1]
	end
	
	if eid then
		return ("[http://stephanus.tlg.uci.edu/cunliffe/#eid="..eid.."&context=lsj " .. title_span .. "] in ")
	else
		-- [[Special:WhatLinksHere/Wiktionary:Tracking/R:Cunliffe/no-entry]]
		require("Module:debug").track("R:Cunliffe/no-entry")
		return '<span class="previewonly" style="font-size: 75%;">(no entry for the specified headword)</span> '
	end
end

return export