跳转到内容

模組:Module wikitext/CGroup

本页使用了标题或全文手工转换
被永久保护的模块
维基百科,自由的百科全书

这是Module:Module wikitext/CGroup当前版本,由Xiplus-abot留言 | 贡献编辑于2023年11月30日 (四) 20:51 (已保护“Module:Module wikitext/CGroup”:​高風險模板:639引用<!-- 機器人3 -->([编辑=仅允许自动确认用户](无限期)[移动=仅允许自动确认用户](无限期)))。这个网址是本页该版本的固定链接。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

--模組用於提供轉換組加上分類的支援
local p = {}
local lib_arg = {}

function p.main(frame)
	local args, working_frame
    if frame == mw.getCurrentFrame() then
        -- We're being called via #invoke. The args are passed through to the module
        -- from the template page, so use the args that were passed into the template.
        if lib_arg.getArgs == nil then lib_arg = require('Module:Arguments') end
        args = lib_arg.getArgs(frame)
        working_frame = frame
    else
        -- We're being called from another module or from the debug console, so assume
        -- the args are passed in directly.
        args = frame
        working_frame = mw.getCurrentFrame()
        if type(args) ~= type({}) then args = {frame} end
    end
    local root = mw.html.create()
    local lib_doc = require('Module:Documentation')
    local env = lib_doc.getEnvironment(args)
    root:wikitext(lib_doc._getModuleWikitext(args, env))
	return tostring(root)
end

return p