This is a private module sandbox of Justinrleung, for his own experimentation. Items in this module may be added and removed at Justinrleung's discretion; do not rely on this module's stability.


local export = {}

local function refid(id)
	return '<li class="senseid" id="' .. mw.uri.encode(id, "WIKI") .. '">'
end

function export.ref_link(frame)
	local params = {
		[1] = {required = true, default = ""},
	}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local id = args[1]
	id = mw.ustring.gsub(id, ", ", "")
	id = mw.ustring.gsub(id, " %(([0-9][0-9][0-9][0-9])%)", "%1")
	
	return "[[User:Justinrleung/references#" .. id .. "|" .. args[1] .. "]]"
end

function export.refid_t(frame)
	local params = {
		[1] = {required = true, default = ""},
	}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	return refid(args[1])
end

return export