Módulo:About
A documentação para este módulo pode ser criada na página Módulo:About/doc
local mArguments -- Inicializa lentamente
local mHatnote = require('Módulo:Hatnote')
local mHatList = require('Módulo:Hatnote list')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.about (frame)
-- Uma passagem que obtém argumentos do quadro e tudo
mArguments = require('Módulo:Arguments')
args = mArguments.getArgs(frame)
return p._about(args)
end
function p._about (args, options)
-- Produz a nota "sobre".
-- Verificações de tipo (ou digitação) e padrões
checkType('_about', 1, args, 'table', true)
args = args or {}
checkType('_about', 2, options, 'table', true)
options = options or {}
local defaultOptions = {
aboutForm = 'Esta página de %s é sobre %s. ',
PageType = require('Módulo:Pagetype').main(),
otherText = nil, -- Incluído para lista completa (ou completar a lista)
sectionString = 'seção'
}
for k, v in pairs(defaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Define a string inicial "sobre"
local pageType = (args.section and options.sectionString) or options.PageType
local about = ''
if args[1] then
about = string.format(options.aboutForm, pageType, args[1])
end
-- Permite passar por certas opções
local fsOptions = {
otherText = options.otherText,
extratext = args.text
}
local hnOptions = {
selfref = args.selfref
}
-- Define a lista de consulta
local forSee = mHatList._forSee(args, 2, fsOptions)
-- Concatena e retorna
return mHatnote._hatnote(about .. forSee, hnOptions)
end
return p