有兽档案馆
搜索
切换搜索
切换菜单
切换个人菜单
查看“Module:Page name”的源代码
来自有兽档案馆
阅读
查看源代码
查看历史
模块
讨论
更多操作
←
Module:Page name
因为以下原因,您没有权限编辑该页面:
您所请求的操作,仅限具有
注册用户
、
自动确认用户
、
管理员
、
界面管理员
、
优质编辑者
、
确认用户
、
巡查员
、
档案理事员
等
权限
的
用户
执行。
若您尚未登录有兽档案馆账号,请您
登录
有兽档案馆账号后操作。
您尚未完成电子邮件确认,因此操作受限,请尽快
完成电子邮件确认
。
若您无法完成前述手续,请通过适当渠道请求管理员或档案理事员协助。
您可以查看和复制此页面的源代码。
若您无权编辑本页面,您可以
提出编辑请求
,提请有权限者代为编辑。
local p = {} local getArgs = require 'Module:Arguments'.getArgs function p.convert(variant, simplified, traditional, taiwan, transfer) -- 0允许繁简转换 -- -1强制简体 -- 1强制繁体 -- 2强制台湾繁体 if not traditional then return simplified elseif variant == 2 then return taiwan or traditional elseif variant == 1 then return traditional elseif variant == -1 then return simplified else -- if variant == 0 if transfer and taiwan then return string.format('-{zh-hans:%s;zh-hant:%s;zh-tw:%s}-', simplified, traditional, taiwan) elseif transfer then return string.format('-{zh-hans:%s;zh-hant:%s}-', simplified, traditional) else return simplified end end end local title local function getConfig(variant) variant = variant or 0 -- 0允许繁简转换 -- -1强制简体 -- 1强制繁体 local t = {} local function convert(simplified, traditional, taiwan, transfer) return p.convert(variant, simplified, traditional, taiwan, transfer) -- 这里只是简化一下p.convert,省略一个参数。 -- 这里的variant是getConfig函数中的,不是p.convert中的。 end t[0] = convert('条目','條目') t.page = convert('页面','頁面') local page = t.page t[1] = convert('讨论页','討論頁') local talk = t[1] t[10] = convert'模板' t[11] = t[10] .. talk t[828] = convert('模块','模組',nil,true) t[829] = t[828] .. talk t[2] = convert('用户页','用戶頁','使用者頁面') t[3] = convert('用户','用戶','使用者',true) .. talk t[4] = convert('项目','專案','計畫',true) .. page t[5] = convert('项目','專案','計劃',true) .. talk t[6] = convert('文件','檔案',nil,true) t[7] = t[6] .. talk t[8] = convert('消息','介面',nil,true) .. page t[9] = convert('消息','介面',nil,true) .. talk t[12] = convert('帮助','幫助') .. page t[13] = convert('帮助','幫助') .. talk t[14] = convert('分类','分類') t[15] = t[14] .. talk t[300] = '同人页面' t[301] = t[300] .. talk t[302] = '草稿' t[303] = t[302] .. talk t[274] = '微件' t[275] = t[274] .. talk t[460] = convert('活动','活動') t[461] = t[460] .. talk t[-1] = convert('特殊页面','特殊頁面') t.doc = convert('文档','文件',nil,true) return t end p.getConfig = getConfig function p.pageName(title, variant) if type(title)=='string' then title = mw.title.new(title) end title = title or mw.title.getCurrentTitle() variant = variant or 0 local id = title.namespace local t = getConfig(variant) local ret = t[id] or t.page if (id==10 or id==828) and title.subpageText=='doc' then ret = ret .. t.doc end return ret end function p.namespacePageName(namespace, variant) local id = (mw.site.namespaces[namespace] or {}).id local t = getConfig(variant) return t[id] or t.page end function p.main(frame) local args = getArgs(frame) local title = args.title local namespace = args.namespace local variant = args.variant return namespace and p.namespacePageName(tonumber(namespace) or namespace, variant) or p.pageName(title and mw.title.new(title), variant) end function p.template(frame) return p.main(frame:getParent()) end return p
该页面使用的模板:
Module:Arguments
(
查看源代码
)
Module:Documentation
(
查看源代码
)
Module:Fullurl
(
查看源代码
)
Module:No globals
(
查看源代码
)
Module:Page name
(
查看源代码
)
Module:Page name/doc
(
查看源代码
)
Module:Yesno
(
查看源代码
)
返回
Module:Page name
。