Module:Documentation: Difference between revisions

bring in usage of Module:Module wikitext from sandbox
templatewiki>MrJaroslavik
m (1 revision imported)
(bring in usage of Module:Module wikitext from sandbox)
Line 4: Line 4:
local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
local messageBox = require('Module:Message box')
local messageBox = require('Module:Message box')
local moduleWikitext = require('Module:Module wikitext').main


-- Get the config table.
-- Get the config table.
Line 129: Line 130:
local root = mw.html.create()
local root = mw.html.create()
root
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:wikitext(p.sandboxNotice(args, env))
Line 323: Line 325:
-- Auxiliary templates
-- 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
return moduleWikitext()
end


function p.sandboxNotice(args, env)
function p.sandboxNotice(args, env)
Anonymous user