模組: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