模块

模块:词典

来自卡厄思梦境WIKI

律Rhyme留言 | 贡献2025年10月2日 (四) 15:34的版本 (创建页面,内容为“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-te…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

此模块的文档可以在模块:词典/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