跳转到内容

模块:Cite

本页使用了标题或全文手工转换
维基百科,自由的百科全书

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

setmetatable(p, {
	__index = function(t, k)
		return function(frame)
			local citationClass = mw.ustring.lower(k)

			local newFrame = {
				getParent = function(self)
					return frame
				end,
				getTitle = function(self)
					return 'Module:Citation/CS1'
				end,
				args = {CitationClass=citationClass}
			}

			setmetatable(newFrame, {
				__index = function(t2, k2)
					if type(frame[k2]) == 'function' then
						return function(...)
							return frame[k2](frame, select(2, ...))
						end
					else
						return frame[k2]
					end
				end
			})

			return CS1.citation(newFrame)
		end
	end
})

return p