模块:词典
来自卡厄思梦境WIKI
此模块的文档可以在模块:词典/doc创建
local p = {}
local data = require('模块:词典/data')
function p.main(frame)
local args = frame:getParent().args
local category = args[1] or ""
local term = args[2] or ""
local color = args["颜色"] or "black"
local description = ""
if category == "卡牌机制" then
description = data.cardMechanics[term] or "未找到说明"
end
-- 构建HTML
local html = string.format([[
<span class="dictionary-term" style="position: relative; display: inline-block;">
<span style="color: %s; text-decoration: underline; cursor: help;">%s</span>
<span class="dictionary-tooltip">
<span class="dictionary-tooltip-bar"></span>
<span class="dictionary-tooltip-content">
<span class="dictionary-tooltip-title">%s</span><br/>
%s
</span>
</span>
</span>]], color, term, term, description)
return html
end
return p