创建页面,内容为“local p = {} -- Load modules (language wikis exclusive) -- ... -- Customizable strings local i18n = { -- default settings, change when necessary defaultDocPage = 'doc', -- documentation page suffix defaultSandboxPage = 'sandbox', -- sandbox page suffix defaultTestCasePage = 'testcases', -- testcases page suffix defaultPreload = 'Template:Documentation/preload', -- page that stores qualified documentation page contents defaultStyles = 'Module:Documentati…”
 
སྒྲིག་ཆུང་། 机器人:搬运模板
ཐིག་ཕྲེང་2: ཐིག་ཕྲེང་2:


-- Load modules (language wikis exclusive)
-- Load modules (language wikis exclusive)
-- ...
local lan = require( 'Module:Lan' ).call


-- Customizable strings
-- Customizable strings
local i18n = {
local i18n = {
-- default settings, change when necessary
-- 默认设置,有必要时修改
defaultDocPage = 'doc', -- documentation page suffix
defaultDocPage = 'doc', -- 文档页后缀
defaultSandboxPage = 'sandbox', -- sandbox page suffix
defaultSandboxPage = 'sandbox', -- 沙盒页后缀
defaultTestCasePage = 'testcases', -- testcases page suffix
defaultTestCasePage = 'testcases', -- 测试用例页后缀
defaultPreload = 'Template:Documentation/preload', -- page that stores qualified documentation page contents
defaultPreload = 'Template:Documentation/preload', -- 存储文档页标准内容的页面
defaultStyles = 'Module:Documentation/styles.css', -- stylesheet for this module when using TemplateStyles, remove or set to nil if your wiki not use this
defaultStyles = 'Module:Documentation/styles.css', -- 此模块使用TemplateStyles时的样式表,如您的wiki不使用,则移除或设为nil


-- format strings, should not be translated
-- 格式字符串,不应当翻译
commonInternalLink = '[[%s]]',
commonInternalLink = '[[%s]]',
commonInternalLinkPipe = '[[%s|%s]]',
commonInternalLinkPipe = '[[%s|%s]]',
ཐིག་ཕྲེང་21: ཐིག་ཕྲེང་21:
commonNamespacedPageWithSub = '%s:%s/%s',
commonNamespacedPageWithSub = '%s:%s/%s',


-- namespace names, translate if your language prefers localized namespace name, although remain it untouched most likely not affect anything
-- 命名空间名称,若您的语言偏爱本地化名称,请翻译,虽然翻译与否基本上不会影响实际效果
namespaceCategory = 'Category',
namespaceCategory = 'Category',
namespaceSpecial = 'Special',
namespaceSpecial = 'Special',
namespaceUser = 'User',
namespaceUser = 'User',


-- names of special pages, translate if your language prefers localized namespace name, although remain it untouched will still correctly linked to target page
-- 特殊页面名称,若您的语言偏爱本地化名称,请翻译,虽然保持原文仍会链接到正确的页面
specialPurge = 'Purge',
specialPurge = 'Purge',
specialEdit = 'EditPage',
specialEdit = 'EditPage',
specialHistory = 'PageHistory',
specialHistory = 'PageHistory',


-- translate following types if your language displays differ
-- 如果在您的语言中,类型名称在显示上有区别,请翻译
pageType_page = 'page',
pageType_page = lan{
pageType_template = 'template',
[ 'zh-hans' ] = '页面',
pageType_module = 'module',
[ 'zh-hant' ] = '頁面'
pageType_stylesheet = 'stylesheet',
},
pageType_script = 'script',
pageType_template = '模板',
pageType_module = lan{
[ 'zh-hans' ] = '模块',
[ 'zh-hant' ] = '模組'
},
pageType_stylesheet = lan{
[ 'zh-hans' ] = '样式表',
[ 'zh-hant' ] = '樣式表'
},
pageType_script = lan{
[ 'zh-hans' ] = '脚本',
[ 'zh-hant' ] = '腳本'
},
pageType_json = 'JSON',
pageType_json = 'JSON',
pageType_message = 'message',
pageType_message = lan{
[ 'zh-hans' ] = '界面信息',
[ 'zh-hant' ] = '介面訊息'
},


-- modify them if your wiki use different style to displaying links
-- 如果您的wiki使用不一样的链接显示方式,请修改下列内容
linkBar = '%s', -- format used for whole link bar
linkBar = mw.text.nowiki( '[ ' ) .. '%s' .. mw.text.nowiki( ' ]' ), -- 整个链接条使用的整体样式
linkFormat = mw.text.nowiki( '[' ) .. '%s' .. mw.text.nowiki( ']' ), -- format used for each individual links
linkFormat = '%s', -- 单个链接使用的样式
linkSeparator = ' ', -- separator between links
linkSeparator = mw.text.nowiki( mw.getCurrentFrame():callParserFunction( 'int:pipe-separator' ) ), -- 不同链接间的分隔符


-- name of different type of links, change them if necessary
-- 不同类型链接的显示名称,有必要时修改
linkTextPurge = mw.message.new( 'purge' ):plain():lower(),
linkTextPurge = mw.getCurrentFrame():callParserFunction( 'int:purge' ),
linkTextView = mw.message.new( 'view' ):plain():lower(),
linkTextView = mw.getCurrentFrame():callParserFunction( 'int:view' ),
linkTextEdit = mw.message.new( 'edit' ):plain():lower(),
linkTextEdit = mw.getCurrentFrame():callParserFunction( 'int:edit' ),
linkTextHistory = mw.message.new( 'history_short' ):plain():lower(),
linkTextHistory = mw.getCurrentFrame():callParserFunction( 'int:history_short' ),
linkTextCreate = mw.message.new( 'create' ):plain():lower(),
linkTextCreate = mw.getCurrentFrame():callParserFunction( 'int:create' ),


-- strings used in p.create(): contents shown when using {{docc}} or {{subst:docc}}
-- p.create()中使用的字符串:使用{{doc}}或{{subst:doc}}时显示的内容
createOutputFormat = '%s%s', -- overall format
createOutputFormat = '<noinclude>%s%s</noinclude>', -- 整体格式
createSplitDocPagePrompt = '\n<!-- Put categories/interwikis on the documentation page -->', -- this string is shown when a separate documentation page is created
createSplitDocPagePrompt = '\n<!-- 请将分类/语言链接放在文档页面 -->', -- 要创建的文档页面为独立页面时显示的字符串
createNoSubstCategory = 'Pages with templates requiring substitution', -- tracking category for using {{docc}} without substitution
createNoSubstCategory = '需要替换模板的页面', -- 使用{{doc}}时未使用替代语法所添加的追踪分类


-- strings used in p.docPage(): contents shown in documentation page
-- p.docPage()中使用的字符串:文档页显示的内容
docPagePrompt = 'This is the documentation page. It %s transcluded into %s. See [[Template:Documentation]] for more information.', -- message shown as documentation header in documentation pages. Params: word used when page is a module or not; code page's type
docPagePrompt = lan{ -- 文档页{{documentation header}}中显示的消息。参数:代码页是或不是模块时显示的词语;代码页的链接
docPagePromptWill = 'is', -- word used when code page is a module page
[ 'zh-hans' ] = '这是文档页面,它%s被放置到%s。查看[[Template:Documentation]]以获取更多信息。',
docPagePromptShould = 'should be', -- word used when code is not a module page
[ 'zh-hant' ] = '這是說明文件頁面,它%s被放置到%s。查看[[Template:Documentation]]以取得更多資訊。'
docPageBadDocPrompt = "<br>'''This %s's documentation needs improving or additional information.'''", -- additional message if a documentation page marked as baddoc
},
docPageCategory = 'Documentation pages', -- tracking category for documentation pages
docPagePromptWill = lan{ -- 代码页为模块时使用的词语
[ 'zh-hans' ] = '将',
[ 'zh-hant' ] = '將'
},
docPagePromptShould = lan{ -- 代码页不为模块时使用的词语
[ 'zh-hans' ] = '应该',
[ 'zh-hant' ] = '應該'
},
docPageBadDocPrompt = lan{ -- 被标记为baddoc时显示的附加消息
[ 'zh-hans' ] = "<br>'''此%s的文档页面需要改进或添加附加信息。'''",
[ 'zh-hant' ] = "<br>'''此%s的說明文件頁面需要改進或加上附加資訊。'''"
},
docPageCategory = '文档页面', -- 文档页的追踪分类


-- strings used in p.page(): contents shown in code page
-- p.page()中使用的字符串:代码页显示的内容
pageNoDocPrompt = "'''This %s has no documentation. If you know how to use this %s, please create it.'''", -- message shown when a separate documentation page is not exist, both parameters refers to page type
pageNoDocPrompt = lan{ -- 独立文档页不存在时显示的消息,所有参数均为页面类型
pageNoDocCategory = '%ss with no documentation', -- tracking category for pages without documentation, parameters refers to page type
[ 'zh-hans' ] = "'''此%s没有文档页面。如果你知道此%s的使用方法,请帮助为其创建文档页面。'''",
pageNoDocCategoryDefault = 'Pages with no documentation', -- fallback tracking category for pages without documentation
[ 'zh-hant' ] = "'''此%s没有說明文件頁面。如果你知道此%s的使用方法,請幫助為其建立說明文件頁面。'''"
pageBadDocPrompt = "'''This %s's documentation needs improving or additional information.'''\n", -- message shown when a documentation page marked as baddoc, both parameters refers to page type
},
pageBadDocCategory = '%ss with bad documentation', -- tracking category for pages marked as baddoc, parameters refers to page type
pageNoDocCategory = '没有文档的%s', -- 没有文档页的代码页追踪分类,参数为页面类型
pageBadDocCategoryDefault = 'Pages with bad documentation', -- fallback tracking category for pages marked as baddoc
pageNoDocCategoryDefault = '没有文档的页面', -- 没有文档页的代码页追踪分类(fallback)
pageDocHeaderTitle = 'Documentation', -- message shown as the title of the documentation header
pageBadDocPrompt = lan{ -- 文档页被标记为baddoc时显示的消息,参数为页面类型
pageDocJumpToCode = 'Jump to code ↴', -- text of the link to jump to the code
[ 'zh-hans' ] = "'''此%s的文档页面需要改进或添加附加信息。'''\n",
pageDocHeaderBottom = 'The above documentation is transcluded from %s.', -- message shown as the bottom line of the documentation header
[ 'zh-hant' ] = "'''此%s的說明文件頁面需要改進或加上附加資訊。'''\n"
},
pageBadDocCategory = '文档质量较低的%s', -- 文档页被标记为baddoc时的代码页追踪分类,参数为页面类型
pageBadDocCategoryDefault = '文档质量较低的页面', -- 文档页被标记为baddoc时的代码页追踪分类(fallback)
pageDocHeaderTitle = lan{ -- 文档页页首的标题
[ 'zh-hans' ] = '文档页面',
[ 'zh-hant' ] = '說明文件頁面'
},
pageDocJumpToCode = lan{ -- 跳转至代码链接的显示文本
[ 'zh-hans' ] = '跳转至代码 ↴',
[ 'zh-hant' ] = '跳轉至程式碼 ↴'
},
pageDocHeaderBottom = lan{ -- 文档页页首下部显示的消息
[ 'zh-hans' ] = '上述文档引用自%s。',
[ 'zh-hant' ] = '上述說明文件嵌入自%s。'
},
}
}


-- Customizable functions
-- Customizable functions
local function pageCategoryHandler( category )
local function pageCategoryHandler( category )
return mw.getCurrentFrame():expandTemplate{ title = 'translation category', args = { category, project = '0' } }
return i18n.commonInternalLink:format( i18n.commonNamespacedPage:format( i18n.namespaceCategory, category ) )
end
end


ཐིག་ཕྲེང་108: ཐིག་ཕྲེང་150:


-- Exported functions
-- Exported functions
function p.create( f ) -- Creating a documentation page or transclusion through {{subst:docc}}
function p.create( f ) -- Creating a documentation page or transclusion through {{subst:doc}}
local args = require( 'Module:ProcessArgs' ).norm()
local args = require( 'Module:ProcessArgs' ).norm()
local page = mw.title.getCurrentTitle()
local page = mw.title.getCurrentTitle()
ཐིག་ཕྲེང་271: ཐིག་ཕྲེང་313:


header
header
:node( links )
:tag( 'span' )
:tag( 'span' )
:addClass( 'documentation-header-title' )
:addClass( 'documentation-header-title' )
:wikitext( i18n.pageDocHeaderTitle )
:wikitext( i18n.pageDocHeaderTitle )
header
        :node( links )


local codePages = {
local codePages = {
"https://bo-mcwiki-dev.dhbaka.top/wiki/Module:Documentation"ལས་སླར་རྙེད་སོང།