有兽档案馆
搜索
切换搜索
切换菜单
切换个人菜单
查看“Module:Special wikitext/Template”的源代码
来自有兽档案馆
阅读
查看源代码
查看历史
模块
讨论
更多操作
←
Module:Special wikitext/Template
因为以下原因,您没有权限编辑该页面:
您所请求的操作,仅限具有
注册用户
、
自动确认用户
、
管理员
、
界面管理员
、
优质编辑者
、
确认用户
、
巡查员
、
档案理事员
等
权限
的
用户
执行。
若您尚未登录有兽档案馆账号,请您
登录
有兽档案馆账号后操作。
您尚未完成电子邮件确认,因此操作受限,请尽快
完成电子邮件确认
。
若您无法完成前述手续,请通过适当渠道请求管理员或档案理事员协助。
您可以查看和复制此页面的源代码。
若您无权编辑本页面,您可以
提出编辑请求
,提请有权限者代为编辑。
--Author: Xiplus, A2569875 --CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0> local p={} --{{#invoke:Special wikitext/Template|contentModel}} function p.contentModel(frame) local page_name = frame.args[1] or frame.args['1'] or '' local default_namespace = mw.text.trim(frame.args[2] or frame.args['2'] or '') local page_data = (mw.text.trim(page_name)==''and mw.title.getCurrentTitle() or mw.title.new(page_name,default_namespace)) return (page_data or {}).contentModel or 'wikitext' end --{{#invoke:Special wikitext/Template|luaContentFromPage}} function p.luaContentFromPage(frame) local page_name = frame.args[1] or frame.args['1'] or '' local default_namespace = mw.text.trim(frame.args[2] or frame.args['2'] or '') local page_data = (mw.text.trim(page_name)==''and mw.title.getCurrentTitle() or mw.title.new(page_name, default_namespace)) local contentModel = mw.ustring.lower((page_data or {}).contentModel or 'wikitext') if contentModel == 'scribunto' or contentModel == 'lua' then pcall(require, page_data.prefixedText) -- if it fails, we don't care local moduleWikitext = package.loaded["Module:Module wikitext"] if moduleWikitext then return moduleWikitext.main() end end return '' end --{{#invoke:Special wikitext/Template|markinclude}} function p.markinclude(frame) local page_name = frame.args[1] or frame.args['1'] or '' local detail = mw.text.trim(frame.args[2] or frame.args['2'] or '') local page_data = (mw.text.trim(page_name)==''and mw.title.getCurrentTitle() or mw.title.new(page_name)) if page_data:getContent() then -- recorded as a transclusion, and check exist. return '*[[:'..page_name..']]' .. (detail ~= '' and ('('..detail..')') or '') elseif mw.text.trim(page_name) ~= '' then return '*'..page_name.. (detail ~= '' and ('('..detail..')') or '') end return '' end --{{#invoke:Special wikitext/Template|checkPage}} function p.checkPage(frame) local chk_name = frame.args[1] or frame.args['1'] or '' local cur_name = frame.args[2] or frame.args['2'] or '' local default_namespace = mw.text.trim(frame.args[3] or frame.args['3'] or '') if mw.text.trim(chk_name or '')==''then return '' end return p._checkPage(chk_name, cur_name, default_namespace) and '1' or '' end function p._checkPage(page, srcpage, default_namespace) local chk_page, cur_page = mw.title.new(page, default_namespace), (mw.text.trim(srcpage or '')=='' and mw.title.getCurrentTitle() or mw.title.new(srcpage, default_namespace)) local chk_name, cur_name = '##:'..chk_page.fullText, '##:'..cur_page.fullText local chk_reg = mw.ustring.gsub(chk_name,'([%%\\])','%1%1') local chk_regs, cur_names = chk_reg..(mw.ustring.sub(chk_reg,-1,-1)=='/'and''or'/'), cur_name..(mw.ustring.sub(cur_name,-1,-1)=='/'and''or'/') local findpos = mw.ustring.find(cur_name, chk_reg) if (tonumber(findpos) or -1) > 0 then findpos = mw.ustring.find(cur_names, chk_regs)end return (tonumber(findpos) or -1) > 0 end function p.int(frame) local int_name = frame.args[1] or frame.args['1'] or '' local cur_frame = mw.getCurrentFrame() local body = mw.text.decode(cur_frame:preprocess("{{msgnw:int:"..int_name.."}}")) body = mw.ustring.gsub(body,'#%s*invoke%s*:%s*Special%s+wikitext%|','void|') return cur_frame:preprocess(body) end function p.getNotices(frame) local page_name = frame.args[1] or frame.args['1'] or '' local cur_frame = mw.getCurrentFrame() local page_subname = frame.args[2] or frame.args['2'] or '' local title = mw.title.new('Template:Editnotices/Page/' .. page_name) local subtitle = mw.title.new('Template:Editnotices/Page/' .. page_name .. page_subname) if subtitle.exists then return frame:expandTemplate{ title = subtitle.text } elseif title.exists then return frame:expandTemplate{ title = title.text } else return '' end end return p
该页面使用的模板:
Module:Arguments
(
查看源代码
)
Module:Documentation
(
查看源代码
)
Module:Fullurl
(
查看源代码
)
Module:No globals
(
查看源代码
)
Module:Page name
(
查看源代码
)
Module:Special wikitext/Template
(
查看源代码
)
Module:Special wikitext/Template/doc
(
查看源代码
)
Module:Yesno
(
查看源代码
)
返回
Module:Special wikitext/Template
。