Module:Documentation ཐོན་རིམ་རེ་རེའི་ཁྱད་པར།
创建页面,内容为“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…” |
No edit summary |
||
| (བར་མའི་བསྐྱར་བཅོས་ 1 དང་། སྤྱོད་མཁན་ 1 གྱིས་བྱས་པ་རྣམས་བསྟན་མེད།) | |||
| ཐིག་ཕྲེང་6: | ཐིག་ཕྲེང་6: | ||
-- Customizable strings | -- Customizable strings | ||
local i18n = { | local i18n = { | ||
-- | -- 默认设置,有必要时修改 | ||
defaultDocPage = 'doc', -- | defaultDocPage = 'doc', -- 文档页后缀 | ||
defaultSandboxPage = 'sandbox', -- | defaultSandboxPage = 'sandbox', -- 沙盒页后缀 | ||
defaultTestCasePage = 'testcases', -- | defaultTestCasePage = 'testcases', -- 测试用例页后缀 | ||
defaultPreload = 'Template:Documentation/preload', -- | defaultPreload = 'Template:Documentation/preload', -- 存储文档页标准内容的页面 | ||
defaultStyles = 'Module:Documentation/styles.css', -- | defaultStyles = 'Module:Documentation/styles.css', -- 此模块使用TemplateStyles时的样式表,如您的wiki不使用,则移除或设为nil | ||
-- | -- 格式字符串,不应当翻译 | ||
commonInternalLink = '[[%s]]', | commonInternalLink = '[[%s]]', | ||
commonInternalLinkPipe = '[[%s|%s]]', | commonInternalLinkPipe = '[[%s|%s]]', | ||
| ཐིག་ཕྲེང་21: | ཐིག་ཕྲེང་21: | ||
commonNamespacedPageWithSub = '%s:%s/%s', | commonNamespacedPageWithSub = '%s:%s/%s', | ||
-- | -- 命名空间名称,若您的语言偏爱本地化名称,请翻译,虽然翻译与否基本上不会影响实际效果 | ||
namespaceCategory = 'Category', | namespaceCategory = 'Category', | ||
namespaceSpecial = 'Special', | namespaceSpecial = 'Special', | ||
namespaceUser = 'User', | namespaceUser = 'User', | ||
-- | -- 特殊页面名称,若您的语言偏爱本地化名称,请翻译,虽然保持原文仍会链接到正确的页面 | ||
specialPurge = 'Purge', | specialPurge = 'Purge', | ||
specialEdit = 'EditPage', | specialEdit = 'EditPage', | ||
specialHistory = 'PageHistory', | specialHistory = 'PageHistory', | ||
-- | -- 如果在您的语言中,类型名称在显示上有区别,请翻译 | ||
pageType_page = ' | pageType_page = '页面', | ||
pageType_template = ' | pageType_template = '模板', | ||
pageType_module = ' | pageType_module = '模块', | ||
pageType_stylesheet = ' | pageType_stylesheet = '样式表', | ||
pageType_script = ' | pageType_script = '脚本', | ||
pageType_json = 'JSON', | pageType_json = 'JSON', | ||
pageType_message = ' | pageType_message = '界面信息', | ||
-- | -- 如果您的wiki使用不一样的链接显示方式,请修改下列内容 | ||
linkBar | linkBar = mw.text.nowiki( '[ ' ) .. '%s' .. mw.text.nowiki( ' ]' ), -- 整个链接条使用的整体样式 | ||
linkFormat = '%s', -- 单个链接使用的样式 | |||
linkSeparator = ' ', -- | linkSeparator = mw.text.nowiki( mw.getCurrentFrame():callParserFunction( 'int:pipe-separator' ) ), -- 不同链接间的分隔符 | ||
-- | -- 不同类型链接的显示名称,有必要时修改 | ||
linkTextPurge = mw. | linkTextPurge = mw.getCurrentFrame():callParserFunction( 'int:purge' ), | ||
linkTextView = mw. | linkTextView = mw.getCurrentFrame():callParserFunction( 'int:view' ), | ||
linkTextEdit = mw. | linkTextEdit = mw.getCurrentFrame():callParserFunction( 'int:edit' ), | ||
linkTextHistory = mw. | linkTextHistory = mw.getCurrentFrame():callParserFunction( 'int:history_short' ), | ||
linkTextCreate = mw. | linkTextCreate = mw.getCurrentFrame():callParserFunction( 'int:create' ), | ||
-- | -- p.create()中使用的字符串:使用{{doc}}或{{subst:doc}}时显示的内容 | ||
createOutputFormat = '%s%s', -- | createOutputFormat = '<noinclude>%s%s</noinclude>', -- 整体格式 | ||
createSplitDocPagePrompt = '\n<!-- | createSplitDocPagePrompt = '\n<!-- 请将分类/语言链接放在文档页面 -->', -- 要创建的文档页面为独立页面时显示的字符串 | ||
createNoSubstCategory = ' | createNoSubstCategory = '需要替换模板的页面', -- 使用{{doc}}时未使用替代语法所添加的追踪分类 | ||
-- | -- p.docPage()中使用的字符串:文档页显示的内容 | ||
docPagePrompt = ' | docPagePrompt = '这是文档页面,它%s被放置到%s。查看[[Template:Documentation]]以获取更多信息。', -- 文档页{{documentation header}}中显示的消息。参数:代码页是或不是模块时显示的词语;代码页的链接 | ||
docPagePromptWill = ' | docPagePromptWill = '将', -- 代码页为模块时使用的词语 | ||
docPagePromptShould = ' | docPagePromptShould = '应该', -- 代码页不为模块时使用的词语 | ||
docPageBadDocPrompt = "<br>''' | docPageBadDocPrompt = "<br>'''此%s的文档页面需要改进或添加附加信息。'''", -- 被标记为baddoc时显示的附加消息 | ||
docPageCategory = ' | docPageCategory = '文档页面', -- 文档页的追踪分类 | ||
-- | -- p.page()中使用的字符串:代码页显示的内容 | ||
pageNoDocPrompt = "''' | pageNoDocPrompt = "'''此%s没有文档页面。如果你知道此%s的使用方法,请帮助为其创建文档页面。'''", -- 独立文档页不存在时显示的消息,所有参数均为页面类型 | ||
pageNoDocCategory = '% | pageNoDocCategory = '没有文档的%s', -- 没有文档页的代码页追踪分类,参数为页面类型 | ||
pageNoDocCategoryDefault = ' | pageNoDocCategoryDefault = '没有文档的页面', -- 没有文档页的代码页追踪分类(fallback) | ||
pageBadDocPrompt = "''' | pageBadDocPrompt = "'''此%s的文档页面需要改进或添加附加信息。'''\n", -- 文档页被标记为baddoc时显示的消息,参数为页面类型 | ||
pageBadDocCategory = '% | pageBadDocCategory = '文档质量较低的%s', -- 文档页被标记为baddoc时的代码页追踪分类,参数为页面类型 | ||
pageBadDocCategoryDefault = ' | pageBadDocCategoryDefault = '文档质量较低的页面', -- 文档页被标记为baddoc时的代码页追踪分类(fallback) | ||
pageDocHeaderTitle = ' | pageDocHeaderTitle = '文档页面', -- 文档页页首的标题 | ||
pageDocJumpToCode = ' | pageDocJumpToCode = '跳转至代码 ↴', -- 跳转至代码链接的显示文本 | ||
pageDocHeaderBottom = ' | pageDocHeaderBottom = '上述文档引用自%s。', -- 文档页页首下部显示的消息 | ||
} | } | ||
-- Customizable functions | -- Customizable functions | ||
local function pageCategoryHandler( category ) | local function pageCategoryHandler( category ) | ||
return | return i18n.commonInternalLink:format( i18n.commonNamespacedPage:format( i18n.namespaceCategory, category ) ) | ||
end | end | ||
| ཐིག་ཕྲེང་108: | ཐིག་ཕྲེང་108: | ||
-- Exported functions | -- Exported functions | ||
function p.create( f ) -- Creating a documentation page or transclusion through {{subst: | 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: | ཐིག་ཕྲེང་271: | ||
header | header | ||
:node( links ) | |||
:tag( 'span' ) | :tag( 'span' ) | ||
:addClass( 'documentation-header-title' ) | :addClass( 'documentation-header-title' ) | ||
:wikitext( i18n.pageDocHeaderTitle ) | :wikitext( i18n.pageDocHeaderTitle ) | ||
local codePages = { | local codePages = { | ||