跳至內容
主選單
主選單
移至側邊欄
隱藏
導覽
首頁
近期變更
建立新頁面
隨機頁面
五大觀念?
新手使用指南
頁面存廢討論
百科財務報告
微國家百科
搜尋
搜尋
建立帳號
登入
個人工具
建立帳號
登入
暗色模式
檢視 模組:If preview 的原始碼
模組
討論
English
閱讀
檢視原始碼
檢視歷史
工具
工具
移至側邊欄
隱藏
操作
閱讀
檢視原始碼
檢視歷史
一般
連結至此的頁面
相關變更
特殊頁面
頁面資訊
取得短網址
←
模組:If preview
由於以下原因,您無權編輯此頁面:
您請求的操作只有這個群組的使用者能使用:
使用者
您可以檢視並複製此頁面的原始碼。
local p = {} local cfg = mw.loadData('Module:If preview/configuration') --[[ main This function returns either the first argument or second argument passed to this module, depending on whether the page is being previewed. ]] function p.main(frame) if cfg.preview then return frame.args[1] or '' else return frame.args[2] or '' end end --[[ pmain This function returns either the first argument or second argument passed to this module's parent (i.e. template using this module), depending on whether it is being previewed. ]] function p.pmain(frame) return p.main(frame:getParent()) end local function warning_text(warning) return mw.ustring.format( cfg.warning_infrastructure, cfg.templatestyles, warning ) end function p._warning(args) local warning = args[1] and args[1]:match('^%s*(.-)%s*$') or '' if warning == '' then return warning_text(cfg.missing_warning) end if not cfg.preview then return '' end return warning_text(warning) end --[[ warning This function returns a "preview warning", which is the first argument marked up with HTML and some supporting text, depending on whether the page is being previewed. disabled since we'll implement the template version in general ]] --function p.warning(frame) -- return p._warning(frame.args) --end --[[ warning, but for pass-through templates like {{preview warning}} ]] function p.pwarning(frame) return p._warning(frame:getParent().args) end return p
此頁面使用了以下模板:
模組:If preview/doc
(
檢視原始碼
)
返回到「
模組:If preview
」。
切換限制內容寬度