Jump to content

Module:Documentation: Difference between revisions

try and keep the line length down a bit
m>Mr. Stradivarius
(use a makeToolbar function instead of writing out the toolbars by hand)
m>Mr. Stradivarius
(try and keep the line length down a bit)
Line 67: Line 67:
.wikitext(p.protectionTemplate())
.wikitext(p.protectionTemplate())
.wikitext(p.sandboxNotice(args))
.wikitext(p.sandboxNotice(args))
-- This div tag is from {{documentation/start box}}, but moving it here so that we don't have to worry about unclosed tags.
-- This div tag is from {{documentation/start box}}, but moving it here
-- so that we don't have to worry about unclosed tags.
.tag('div')
.tag('div')
.attr('id', 'template-documentation')
.attr('id', 'template-documentation')
Line 283: Line 284:
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, 'edit')
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, 'edit')
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, 'history')
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, 'history')
text = text .. 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from ' .. docLink .. '. '
text = text .. 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from '
.. makeToolbar(editLink, historyLink) .. '<br />'
.. docLink .. '. ' .. makeToolbar(editLink, historyLink) .. '<br />'
elseif subjectSpace == 828 then
elseif subjectSpace == 828 then
-- /doc does not exist; ask to create it.
-- /doc does not exist; ask to create it.
Line 336: Line 337:
local printTitle = mw.title.new(printPage)
local printTitle = mw.title.new(printPage)
if printTitle.exists then
if printTitle.exists then
text = text .. '<br />A [[Help:Books/for experts#Improving the book layout|print version]] of this template exists at ' .. makeWikilink(printPage, '/Print') .. '.'
text = text .. '<br />A [[Help:Books/for experts#Improving the book layout|print version]] of this template exists at '
.. 'If you make a change to this template, please update the print version as well.[[Category:Templates with print versions]]'
.. makeWikilink(printPage, '/Print') .. '. If you make a change to this template, please update the print version as well.'
.. '[[Category:Templates with print versions]]'
end
end
end
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.