跳转到内容
打开/关闭菜单
  • 505 条目
  • 936 文件
  • 22 用户
  • 1万 编辑
Blockland Wiki
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

那艺娜❤️‍🔥橘枳🍊好栓😝哈哈哈哈哈哈哈哈😆橘枳🍊栓栓😫Blockland正在不活跃期,设定内容正在放缓,676767676767。
内群链接:118793188,外群链接:1016063794。哈基米,咕咕嘎嘎咕咕嘎嘎咕咕嘎嘎,我也不知道啥时候推演awa。Xterfusion很好听,,,,,

KK​(留言 | 贡献)2026年11月15日 (日) 12:20的版本

此模块的文档可以在模块:Note/doc创建


local p = {}

local function trim(s)
    if s == nil then return '' end
    return mw.text.trim(tostring(s))
end

local function link(page)
    page = trim(page)
    if page == '' then return '' end
    return '[[' .. page .. ']]'
end

function p.about(frame)
    local args = frame:getParent().args

    local subject = trim(args[2])
    local section = trim(args.section)
    local pageType = section ~= '' and '章节' or '条目'

    local output = {}

    if subject ~= '' then
        table.insert(
            output,
            '此' .. pageType .. '介绍的是' .. subject .. '。'
        )
    end

    local i = 3

    while i <= 31 do
        local description = trim(args[i])
        local target = trim(args[i + 1])

        if description == '' and target == '' then
            break
        end

        if target ~= '' then
            local prefix = description ~= ''
                and description .. ',请参阅'
                or '其他用法,请参阅'

            table.insert(
                output,
                prefix .. link(target) .. '。'
            )
            i = i + 2
        else
            table.insert(
                output,
                '其他用法,请参阅' .. link(description) .. '。'
            )
            break
        end
    end

    local extra = trim(args.text)
    if extra ~= '' then
        table.insert(output, extra)
    end

    local content = table.concat(output)
    if content == '' then return '' end

    -- 直接生成原模板的 HTML,避免循环
    local html = mw.html.create('div')
        :addClass('hatnote')
        :cssText(
            'display:flex;' ..
            'align-items:flex-start;' ..
            'margin:0.45em 0 0.65em 1.6em;' ..
            'font-size:0.875em;' ..
            'line-height:1.55;'
        )

    html:tag('div')
        :cssText(
            'flex:0 0 25px;' ..
            'width:25px;' ..
            'margin-right:0.45em;' ..
            'padding-top:0.05em;'
        )
        :wikitext(
            '[[File:消歧义.png|23px|link=|alt=]]'
        )

    html:tag('div')
        :cssText('flex:1;min-width:0;')
        :wikitext(content)

    return tostring(html)
end

return p