Module:About: रिवीजन सभ के बीचा में अंतर
Content deleted Content added
छो Case-sensitivity fail. |
Switched _forSee to new Module:Hatnote list, added some options (migrated most strings from hard-coded to default options), and added comments |
||
लाइन 1:
local mArguments --initialize lazily
local mHatnote = require('Module:Hatnote
local mHatList = require('Module:Hatnote list')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--A passthrough that gets args from the frame and all▼
function p.about (frame)
▲ -- A passthrough that gets args from the frame and all
mArguments = require('Module:Arguments')
args = mArguments.getArgs(frame)
Line 12 ⟶ 14:
end
function p._about (args, options)
-- Produces "about" hatnote.
-- Type checks and defaults
checkType('_about', 1, args, 'table', true)
args = args or {}
Line 19 ⟶ 24:
options = options or {}
local defaultOptions = {
aboutForm = 'This %s is about %s. ',
defaultPageType = 'page',
[0] = 'article',▼
[14] = 'category'▼
},
sectionString = 'section'
}
for k, v in pairs(defaultOptions) do
Line 25 ⟶ 36:
end
-- Set initial "about" string
▲ local pageTypeStrings = {
▲ [0] = 'article',
options.pageTypeStrings[mw.title.getCurrentTitle().namespace] or▼
▲ [14] = 'category'
options.defaultPageType
▲ local pageType = (args.section and 'section') or
▲ pageTypeStrings[mw.title.getCurrentTitle().namespace] or
local about = ''
if args[1] then
about = string.format(
end
-- Set for-see list
local forSee =
-- Concatenate and return
return mHatnote._hatnote(about .. forSee)
end
|