打开/关闭搜索
搜索
打开/关闭菜单
24
14
16
899
高中笔记
导航
首页
最近更改
随机页面
特殊页面
上传文件
分类
语文
数学
英语
物理
化学
生物学
地理
高中笔记
隐私政策
免责声明
资助高中笔记
著作权
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“模块:Page”的源代码
来自高中笔记
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
模块:Page
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local callAssert = require('Module:CallAssert') local function main(frame, field) local args, pargs = frame.args, ( frame:getParent() or {} ).args or {} local makeTitle=args.makeTitle or pargs.makeTitle local namespace=args.namespace or pargs.namespace or "" local fragment=args.fragment or pargs.fragment or "" local interwiki=args.interwiki or pargs.interwiki or "" local page=args.page or args[1] or pargs.page or pargs[1] or "" local id= tonumber( args.id or pargs.id ) local pn = {} local title -- holds the result of the mw.title.xxx call for i = 1,9 do pn[i] = args['p'..i] or pargs['p'..i] end if not id and not mw.ustring.match( page, '%S' ) then page = nil end if id then title = callAssert(mw.title.new, 'mw.title.new', id) elseif not page then title = callAssert(mw.title.getCurrentTitle, 'getCurrentTitle') elseif makeTitle then title = callAssert(mw.title.makeTitle, 'makeTitle', namespace, page, fragment, interwiki) else title = callAssert(mw.title.new, 'mw.title.new', page, namespace) end local result = title[field] if type(result) == "function" then result = result(title, unpack(pn)) end return tostring(result or "") end -- handle all errors in main main = require('Module:Protect')(main) local p = {} -- main function does all the work local meta = {} function meta.__index(self, key) return function(frame) return main(frame, key) end end setmetatable(p, meta) function p.getContent(frame) local args, pargs = frame.args, ( frame:getParent() or {} ).args or {} local fmt = args.as or pargs.as or "pre" local text = main(frame, "getContent") fmt = mw.text.split( fmt, ", ?" ) for _, how in ipairs( fmt ) do if how == "pre" then text = table.concat{ "<pre>", text, "</pre>" } elseif how == "expand" then text = frame:preprocess(text) elseif how == "nowiki" then text = mw.text.nowiki(text) end end return text end return p
返回
模块:Page
。