跳转到内容

模块:地点通用

来自Wymbot 共创站
NotBot​(留言 | 贡献)2026年10月24日 (六) 13:43的版本 (建立模块化旅行介绍与地点收集度描述,条件可编辑,概况读取地点基础字段)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

此模块的文档可以在模块:地点通用/doc创建

local C = require('模块:物品通用')
local p = {}

function p.context(frame)
    local c = C.context(frame)
    local explicit = c.option('地点名', '')
    c.name = (explicit ~= '' and explicit or c.title.text):gsub('旅行$', '')
    return c
end

function p.finish(c, class, body)
    if not c.enabled or not body or body == '' then return '' end
    return '<div class="wum-item-block wum-place-' .. class .. '">\n' .. body .. '\n</div>' ..
        (c.categorize and '[[分类:地点]]' or '') .. '\n'
end

function p.heading(c, text)
    return C.heading(c, text, 3)
end

return p