لفرق بين الجوج ڤيرسيونات ديال: "مودول:Documentation"

تم حذف المحتوى تمت إضافة المحتوى
ص 4 مراجعات
لا ملخص تعديل
 
سطر 112:
 
----------------------------------------------------------------------------
-- MainEntry functionpoints
----------------------------------------------------------------------------
 
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
 
p.main = makeInvokeFunc('_main')
السطر 129 ⟵ 137:
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
السطر 303 ⟵ 312:
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[خاصSpecial:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
السطر 323 ⟵ 332:
-- Auxiliary templates
----------------------------------------------------------------------------
 
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
 
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
 
function p.sandboxNotice(args, env)
السطر 331 ⟵ 352:
--
-- Messages:
-- 'sandbox-notice-image' --> '[[ملفImage:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
السطر 353 ⟵ 374:
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[قالبTemplate:Foo]] (diff)."
local text = ''
local pagetype
السطر 373 ⟵ 394:
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[قالبTemplate:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
السطر 445 ⟵ 466:
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
السطر 553 ⟵ 574:
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[ملفFile:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
السطر 684 ⟵ 705:
-- 'fmbox-textstyle' --> 'font-style: italic'
--
-- The HTML is generated by the {{fmbox}} template, courtesy of [[وحدةModule:Message box]].
--]=]
السطر 749 ⟵ 770:
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[قالبTemplate:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
السطر 958 ⟵ 979:
-- Messages:
-- 'print-link-display' --> '/Print'
-- 'print-blurb' --> 'A [[مساعدةHelp:Books/for experts#Improving the book layout|print version]]'
-- .. ' of this template exists at $1.'
-- .. ' If you make a change to this template, please update the print version as well.'