跳至內容

模組:Cite

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書

local p = {}
local CS1 = require('Module:Citation/CS1')

p[''] = function(frame)
    local templateName = frame.args[1] or ''
    local newFrame = {
        getParent = function(self)
            return frame
        end,
        getTitle = function(self)
            return 'Module:Citation/CS1'
        end,
        args = {CitationClass = templateName:lower()}
    }
    setmetatable(newFrame, {
        __index = function(t, k)
            if type(frame[k]) == 'function' then
                return function(...)
                    return frame[k](frame, select(2, ...))
                end
            else
                return frame[k]
            end
        end
    })
    return CS1.citation(newFrame)
end

return p