Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Documentation: Difference between revisions

From WikiOasis Meta
mediawiki>Uzume
cherry pick Module wikitext support from w:en:Module:Documentation
m 26 revisions imported
 
(29 intermediate revisions by 14 users not shown)
Line 82: Line 82:
ret[#ret + 1] = select(i, ...)
ret[#ret + 1] = select(i, ...)
end
end
return '<small style="font-style: normal;">(' .. table.concat(ret, ' &#124; ') .. ')</small>'
return '<small>(' .. table.concat(ret, ' &#124; ') .. ')</small>'
end
end


Line 331: Line 331:


function p._getModuleWikitext(args, env)
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
if currentTitle.contentModel ~= 'Scribunto' then return end
Line 410: Line 411:
omargs.text = text
omargs.text = text
omargs.class = message('sandbox-class')
omargs.class = message('sandbox-class')
local ret = '<div style="clear: both;"></div>'
return messageBox.main('ombox', omargs)
ret = ret .. messageBox.main('ombox', omargs)
return ret
end
end


Line 538: Line 537:
local function escapeBrackets(s)
local function escapeBrackets(s)
-- Escapes square brackets with HTML entities.
-- Escapes square brackets with HTML entities.
s = s:gsub('%[', '&#91;') -- Replace square brackets with HTML entities.
s = s:gsub('%]', '&#93;')
return s
return s
    :gsub('%[', '&#91;') -- Replace square brackets with HTML entities.
    :gsub('%]', '&#93;')
end
end


Line 855: Line 854:
local mirrorDisplay = message('mirror-link-display')
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
end
Cookies help us deliver our services. By using our services, you agree to our use of cookies.