跳去內容

模組:Sandbox/H78c67c/jp-station

出自維基百科,自由嘅百科全書
模組解[]
local p = {}
local base = "Module:Sandbox/H78c67c/jp-station"
local text = mw.loadData(base .. "/text")
local data = mw.loadData(base .. "/data")

function makeinfobox(frame)
	local title = frame.args[1]
	local qid = data.qid[frame.args[1]]
	local names = data.names[title]
	local name = {names[1] .. "站", names[2] .. "駅", names[3] .. "えき", names[4] .. " eki"}
	local infobox = frame:expandTemplate{ title = "日本車站明細", args = {
		["公司色"] = "green",
		["站名"] = name[1],
		["日文原名"] = names[2],
		["平假名"] = names[3],
		["羅馬拼音"] = names[4],
		["所屬公司"] = "[[" .. text.companies["e"] .. "旅客鐵道]](JR" .. text.companies["e"] .. ")"
	} }
	return infobox
end

function makeintro(frame)
	local title = frame.args[1]
	local qid = data.qid[frame.args[1]]
	local names = data.names[title]
	local name = {names[1] .. "站", names[2] .. "駅", names[3] .. "えき", names[4] .. " eki"}
	local jpn = frame:expandTemplate{ title = 'jpn', args = { j = name[2], hg = name[3], rm = name[4], f = "y" } }
	local company = text.companies["e"]
	local line = "上越線"
	local prefecture = "群馬縣"
	local town = "利根郡]][[水上町"
	return mw.ustring.format(text.intro, name[1], jpn, company, company, line, prefecture, town)
end

function p.main(frame)
	local infobox = makeinfobox(frame)
	local intro = makeintro(frame)
	return infobox .. intro
end
return p