Jump to content

Module:Documentation: Difference between revisions

add comments for the rest of the functions
m>Mr. Stradivarius
(convert makeCategoriesBlurb comment)
m>Mr. Stradivarius
(add comments for the rest of the functions)
Line 854: Line 854:


function p.makeSubpagesBlurb(args, env)
function p.makeSubpagesBlurb(args, env)
-- Get the template title object
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local templateTitle = env.templateTitle
Line 860: Line 870:
return nil
return nil
end
end
-- Make the subpages blurb.
local pagetype
local pagetype
if subjectSpace == 10 then
if subjectSpace == 10 then
Line 876: Line 885:


function p.makePrintBlurb(args, env)
function p.makePrintBlurb(args, env)
-- Get the /Print title object
--[=[
-- Generates the blurb displayed when there is a print version of the template available.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- 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.'
-- 'display-print-category' --> true
-- 'print-category' --> 'Templates with print versions'
--]=]
local printTitle = env.printTitle
local printTitle = env.printTitle
if not printTitle then
if not printTitle then
return nil
return nil
end
end
-- Make the print blurb.
local ret
local ret
if printTitle.exists then
if printTitle.exists then
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.