编辑“
Module:Category main
”
跳转到导航
跳转到搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
-- This module implements {{category main}}. local mHatnote = require('Module:Hatnote') local yesno = require('Module:Yesno') local mTableTools -- lazily initialise local mArguments -- lazily initialise local p = {} function p.categoryMain(frame) mTableTools = require('Module:TableTools') mArguments = require('Module:Arguments') local args = mArguments.getArgs(frame, {wrappers = 'Template:Category main'}) local pages = mTableTools.compressSparseArray(args) local options = { article = args.article, selfref = args.selfref } return p._categoryMain(options, unpack(pages)) end function p._categoryMain(options, ...) options = options or {} -- Get the links table. local links = mHatnote.formatPages(...) if not links[1] then local page = mw.title.getCurrentTitle().text links[1] = mHatnote._formatLink(page) end for i, link in ipairs(links) do links[i] = string.format("'''%s'''", link) end -- Get the pagetype. local pagetype if yesno(options.article) ~= false then pagetype = '条目' else pagetype = '页面' end -- Work out whether we need to be singular or plural. -- 不需要,没有复数。 local stringToFormat = '本[[Wikipedia:頁面分類|分类页面]]的主%s是「%s」。' -- Get the text. local text = string.format( stringToFormat, pagetype, mw.text.listToText(links) ) -- Pass it through to Module:Hatnote. local hnOptions = {} hnOptions.selfref = options.selfref hnOptions.extraclasses = 'relarticle mainarticle' return mHatnote._hatnote(text, hnOptions) end return p
摘要:
请注意,您对Positive WiKi的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Positive WiKi:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
Module:Category main/doc
(
编辑
)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模块
讨论
English
查看
阅读
编辑源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息