Home
Random
Log in
Settings
About the Honkai: Nexus Anima Wiki
Disclaimers
Search
Editing
Module
:
Handbook
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
local p = {} local lib = require('Module:Feature') local checkExists = require('Module:Exists').checkExists local getTemplateArgs = require('Module:Parser').getTemplateArgs -- [[Template:Handbook Entry]] function p.handbook(frame, args) if args == nil then args = require('Module:Arguments').getArgs(frame, { parentFirst = true }) end local html = mw.html.create() if args[1] and type(args[1]) == 'string' then for page in lib.gsplit(args[1], ';', { removeEmpty = true }) do local handbookArgs = getTemplateArgs('Handbook/' .. page, { only = 'Handbook Entry' }) if lib.isEmpty(handbookArgs) then html:tag('strong'):addClass('error'):wikitext('The page [[Handbook/', page, ']] is not a valid Handbook Entry.') else html :tag('div'):addClass('handbook') :tag('dl') :tag('dt'):wikitext(handbookArgs.title or page) :tag('dd'):node(p._handbookFormat(handbookArgs)) end end else html :tag('div'):addClass('Handbook Entry') :node(p._handbookFormat(args)) end return frame:preprocess(tostring(html)) end function p._handbookFormat(args) local out = mw.html.create('') local title = mw.title.getCurrentTitle() if args.about then args.about = lib.split(args.about, ';') if title.rootText == 'Handbook' then out:tag('i'):wikitext(require('Module:Hatnote').main(args.about)) end end local size = args.size or '200px' if (title.rootText == 'Handbook') then size = '400px' end -- create format local I = 1 while (args['image' .. tostring(I)] or args['text' .. tostring(I)]) do local image = args['image' .. tostring(I)] local text = args['text' .. tostring(I)] if (image or text) then local row = out:tag('div'):addClass('handbook-detail') row:wikitext('[[File:', (image or 'Empty.png'), '|', size, ']]') row:tag('div'):wikitext((text or '<wbr>')) if (args['image' .. tostring(I+1)] or args['text' .. tostring(I+1)]) then row:tag('hr'):addClass('mobile-only') end end I = I + 1 end -- add categories if correct page local subpage = args.title or title.subpageText if (not args['table'] and title.baseText == 'Handbook' and (subpage ~= nil and not lib.inArray({ 'Planar Travel', 'Nexus Battle', 'Uncategorized' }, subpage))) then local cat = mw.html.create() cat:wikitext('[[Category:Handbook Entries|', subpage, ']]') if args['sort'] then cat:wikitext('[[Category:Handbook Entry|', string.format('%05d', args['sort']), ']]') else cat:wikitext('[[Category:Handbook Entry]]') end if lib.inArray({ 'Planar Travel', 'Nexus Battle' }, args['type']) then cat:wikitext('[[Category:', args['type'], ' Handbook Entries|', subpage, ']]') if not args['sort'] then cat:wikitext('[[Category:Handbook Entry Missing Sort]]') end elseif args['type'] == 'Event' or args['type'] == 'Quest' then cat:wikitext('[[Category:', args['type'], ' Handbook Entries|', subpage, ']]') else cat:wikitext('[[Category:Uncategorized Handbook Entries|', subpage, ']]') end if args.about then for _, v in pairs(args.about) do cat:wikitext('[[Category:', v, ' Handbook Entries]]') end end local I = 1 local exists = true while (args['image' .. tostring(I)] and exists) do if not checkExists('File:' .. args['image' .. tostring(I)]) then cat:wikitext('[[Category:Handbook Entry Missing Image]]') exists = false; end I = I + 1 end if not args.nocat then out:node(require('Module:Namespace detect')._main{main=cat, module=cat}) end end return out end -- [[Template:Handbook Entries by Category Table]] function p.Table(frame) local args = require('Module:Arguments').getArgs(frame, { parentFirst = true }) local result = mw.html.create('div'):addClass('handbook-table') local title = mw.title.getCurrentTitle().text if lib.isEmpty(args.pages) then result:tag('span'):wikitext('No [[Handbook Entries]] ', (args[1] and 'that match the category selection' or 'are in ' .. title), '.') else local resultTable = mw.html.create('table'):addClass('article-table') local count = 0 for handbookPage in lib.gsplit(args.pages, ';;;', { noTrim = true, removeEmpty = true }) do local handbookArgs = getTemplateArgs(handbookPage, { only = 'Handbook Entry' }) for key, value in pairs(handbookArgs) do if value == '' then handbookArgs[key] = nil end end handbookArgs.PAGENAME = handbookPage resultTable:node(p._TableRow(frame, handbookArgs)) count = count + 1 end local header = result:tag('div'):addClass('handbook-header') if lib.isNotEmpty(args.header) then header:wikitext(tostring(tostring(args.header):gsub('%%PAGES%%', count))) else header:wikitext( 'There ', (count == 1 and 'is ' or 'are '), "'''", count, "'''", (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) ) end result:node(resultTable) end return frame:preprocess(tostring(result)) end function p._TableRow(frame, args) local out = mw.html.create('') if args.title then local header = out:tag('tr'):tag('th') header:wikitext('[[', args.PAGENAME, '|', args.title, ']]') if args.subtitle then header:wikitext(' - ', args.subtitle) end if args.icon then header:wikitext(' [[File:', args.icon, '|25px|link=]]') end local row = out:tag('tr'):tag('td') args['table'] = true row:node(p.handbook(frame, args)) end return out end return p
Summary:
Please note that all contributions to Honkai: Nexus Anima Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Honkai Nexus Anima Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Below are commonly used wikitext from
MediaWiki:Edittools
. Click on any to insert them in the edit box.
Dynamic Page List
:
¦
²
«
»
²{¦}²
«»
«/»
«!----»
Array in DPL
:
¹
^2{
}^2
^2{¹}^2
Parser Functions
:
{{#if:||}}
{{#if:<condition>|<result if true>|<result if false>}}
{{#ifeq:|||}}
{{#ifeq:<text1>|<text2>|<result if text1=text2>|<result if text1≠text2>}}
{{#expr:}}
{{#expr:<mathematical expression>}}
{{#switch:||#default=}}
{{#switch:<text1>|<text2>=<result if text1=text2>|<text3>=<result if text1=text3>|#default=<result if no valid match>}}
{{#replace:||}}
{{#replace:<text1>|<plain text to find in text1>|<plain text to insert in place of the text found>}}
{{#titleparts:}}
{{#replace:<page name>}}
{{#tag:|}}
{{#tag:<name of html tag>|<content inside html tag>}}
Markup:
{{}}
|
[]
[[]]
[[Category:]]
#REDIRECT [[]] [[Category:Redirect Pages]]
<code></code>
<includeonly></includeonly>
<noinclude></noinclude>
<nowiki></nowiki>
<!---->
<br>
§
Notices:
{{Stub|}}
{{Stub Dialogue}}
{{Upcoming}}
{{Under Construction}}
{{Placeholder Image|}}
Magic Words
:
{{!}}
{{formatnum:}}
{{lc:}}
{{uc:}}
{{PAGENAME}}
{{FULLPAGENAME}}
{{ROOTPAGENAME}}
{{BASEPAGENAME}}
{{SUBPAGENAME}}
{{DISPLAYTITLE:|noreplace}}
__TOC__
__NOTOC__
__EXPECTUNUSEDCATEGORY__
__HIDDENCAT__
References:
<ref></ref>
{{Reflist}}
{{Ref/Arti|}}
{{Ref/ArtiSet|}}
{{Ref/BB|}}
{{Ref/Book|}}
{{Ref/CS|}}
{{Ref/Companion|}}
{{Ref/Domain|}}
{{Ref/Enemy|}}
{{Ref/Food|}}
{{Ref/Furnishing|}}
{{Ref/HEO|}}
{{Ref/Item|}}
{{Ref/Loading|}}
{{Ref/Location|}}
{{Ref/Manga|}}
{{Ref/NPC|}}
{{Ref/Outfit|}}
{{Ref/Quest|}}
{{Ref/Talent|}}
{{Ref/VO|}}
{{Ref/VP|}}
{{Ref/Weapon|}}
{{Ref/Wildlife|}}
HTML Entities:
—
,
­
Pages included on this page:
Template:T
(
view source
) (fully protected)
Module:Arguments
(
view source
) (fully protected)
Module:Arguments/i18n
(
view source
) (fully protected)
Module:Entrypoint
(
view source
) (fully protected)
Module:Fallbacklist
(
view source
) (fully protected)
Module:Feature
(
view source
) (fully protected)
Module:Formatting
(
view source
) (fully protected)
Module:Handbook/doc
(
edit
)
Module:I18n
(
view source
) (fully protected)