Editing Module:Handbook
Appearance
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 13: | Line 13: | ||
if args[1] and type(args[1]) == 'string' then | if args[1] and type(args[1]) == 'string' then | ||
for page in lib.gsplit(args[1], ';', { removeEmpty = true }) do | for page in lib.gsplit(args[1], ';', { removeEmpty = true }) do | ||
local handbookArgs = getTemplateArgs('Handbook/' .. page, { only = 'Handbook Entry' }) | local handbookArgs = getTemplateArgs('Handbook Entry/' .. page, { only = 'Handbook Entry' }) | ||
if lib.isEmpty(handbookArgs) then | if lib.isEmpty(handbookArgs) then | ||
html:tag('strong'):addClass('error'):wikitext('The page [[Handbook/', page, ']] is not a valid Handbook Entry.') | html:tag('strong'):addClass('error'):wikitext('The page [[Handbook Entry/', page, ']] is not a valid Handbook Entry.') | ||
else | else | ||
html | html | ||
:tag('div'):addClass(' | :tag('div'):addClass('Handbook Entry') | ||
:tag('dl') | :tag('dl') | ||
:tag('dt'):wikitext(handbookArgs.title or page) | :tag('dt'):wikitext(handbookArgs.title or page) | ||
| Line 27: | Line 27: | ||
html | html | ||
:tag('div'):addClass('Handbook Entry') | :tag('div'):addClass('Handbook Entry') | ||
:node(p. | :node(p._HhandbookFormat(args)) | ||
end | end | ||
return frame:preprocess(tostring(html)) | return frame:preprocess(tostring(html)) | ||
| Line 37: | Line 37: | ||
if args.about then | if args.about then | ||
args.about = lib.split(args.about, ';') | args.about = lib.split(args.about, ';') | ||
if title.rootText == 'Handbook' then | if title.rootText == 'Handbook Entry' then | ||
out:tag('i'):wikitext(require('Module:Hatnote').main(args.about)) | out:tag('i'):wikitext(require('Module:Hatnote').main(args.about)) | ||
end | end | ||
| Line 43: | Line 43: | ||
local size = args.size or '200px' | local size = args.size or '200px' | ||
if (title.rootText == 'Handbook') then | if (title.rootText == 'Handbook Entry') then | ||
size = '400px' | size = '400px' | ||
end | end | ||
| Line 65: | Line 65: | ||
-- add categories if correct page | -- add categories if correct page | ||
local subpage = args.title or title.subpageText | local subpage = args.title or title.subpageText | ||
if (not args['table'] and title.baseText == 'Handbook' and (subpage ~= nil and not lib.inArray({ ' | if (not args['table'] and title.baseText == 'Handbook Entry' and (subpage ~= nil and not lib.inArray({ 'Elements', 'Enemies', 'System', 'Adventure', 'Event', 'Quest', 'Uncategorized' }, subpage))) then | ||
local cat = mw.html.create() | local cat = mw.html.create() | ||
cat:wikitext('[[Category:Handbook Entries|', subpage, ']]') | cat:wikitext('[[Category:Handbook Entries|', subpage, ']]') | ||
| Line 75: | Line 75: | ||
end | end | ||
if lib.inArray({ ' | if lib.inArray({ 'Elements', 'Enemies', 'System', 'Adventure' }, args['type']) then | ||
cat:wikitext('[[Category:', args['type'], ' Handbook Entries|', subpage, ']]') | cat:wikitext('[[Category:', args['type'], ' Handbook Entries|', subpage, ']]') | ||
if not args['sort'] then | if not args['sort'] then | ||
| Line 140: | Line 140: | ||
count, | count, | ||
"'''", | "'''", | ||
(count == 1 and ' [[Handbook Entry]] ' or ' [[Handbook Entries]] '), | (count == 1 and '[[Handbook Entry]] ' or '[[Handbook Entries]] '), | ||
(args[1] and ('that match' .. (count == 1 and 'es' or '') .. ' the category selection:') or ' are in ' .. title) | (args[1] and ('that match' .. (count == 1 and 'es' or '') .. ' the category selection:') or ' are in ' .. title) | ||
) | ) | ||