模組:Cite
外观

![]() | 本模块仅应在条目接近或超过模板展开后长度限制时使用,以缓解引文模板的额外开销造成的压力。除非存在迫切的技术需求,否则应使用常规的CS1系列模板或{{citation}} 模板。 |
![]() | 此模块使用Lua语言: |
{{Cite arXiv}} | arXiv預印本 |
---|---|
{{Cite AV media}} | 影音媒體 |
{{Cite AV media notes}} | 影音媒體內頁說明 |
{{Cite bioRxiv}} | bioRxiv預印本 |
{{Cite book}} | 書籍 |
{{Cite citeseerx}} | CiteSeerX論文 |
{{Cite conference}} | 會議論文 |
{{Cite encyclopedia}} | 引用百科全書的資料 |
{{Cite episode}} | 廣播和電視節目 |
{{Cite interview}} | 訪談 |
{{Cite journal}} | 學術期刊 |
{{Cite magazine}} | 雜誌和期刊 |
{{Cite mailing list}} | 公共郵件列表 |
{{Cite map}} | 地圖 |
{{Cite news}} | 新聞報導 |
{{Cite newsgroup}} | 線上新聞群組 |
{{Cite podcast}} | 播客 |
{{Cite press release}} | 新聞稿 |
{{Cite report}} | 報告 |
{{Cite serial}} | 廣播和電視節目系列 |
{{Cite sign}} | 標誌、匾額、銘牌或徽章 |
{{Cite speech}} | 演講 |
{{Cite ssrn}} | SSRN論文 |
{{Cite techreport}} | 技術報告 |
{{Cite thesis}} | 學位論文 |
{{Cite tweet}} | Twitter推文 |
{{Cite web}} | 上述模板未包含的其他網路資料 |
參見 | |
用法
本模块可用于替换接近或超过模板展开后长度限制的条目中的任何CS1/2系列模板。此类使用应仅用于防止条目超出模板限制。必要时,本模块也可用于封装CS1/2模板的模板中。
示例
本模块不需要特殊参数,但需要指定CS1模板的规范名称(不带cite
前缀):cite book
→ book
,cite web
→ web
。替换{{citation}}
模板时使用citation
。
模块调用规则:
{{#invoke:cite |<模板名称>|<cs1参数>}}
其中:
#invoke:cite
– 调用本模块|<模板名称>
– 不带cite
前缀的模板规范名称(不区分大小写)|<cs1参数>
–{{cite <模板名称>}}
所需的所有参数
例如从{{cite book}}
转换:
{{cite book |author=作者 |date=1915 |title=标题 |publisher=示例出版社}}
- 作者. 标题. 示例出版社. 1915.
可使用:
{{#invoke:cite |book |author=作者 |date=1915 |title=标题 |publisher=示例出版社}}
- 脚本错误:函数“book”不存在。
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