Module:Card/Navigation

local navigation = {}

-- Libraries of functions --

-- stands for High Frequency local HF = require('Module:HF') -- Parses invocation and template parameters, trims whitespace, and removes blanks. local getArgs = require('Dev:Arguments').getArgs -- Generates lists local L = require('Dev:List') - -- Internal functions (used in this and other Modules) -- - function navigation.related(args) local list = { _relatedpagelink( 'Card Rulings', args['name'] or args['cardgame'] or '', 'Rulings' ), _relatedpagelink( 'Card Errata', args['name'] or args['cardgame'] or '', 'Errata' ), _relatedpagelink( 'Card Tips', args['name'] or args['cardgame'] or '', 'Tips' ), _relatedpagelink( 'Card Appearances', args['name'] or args['cardgame'] or '', 'Appearances' ), _relatedpagelink( 'Card Trivia', args['name'] or args['cardgame'] or '', 'Trivia' ), _relatedpagelink( 'Card Lores', args['name'] or args['cardgame'] or '', 'Lores' ), _relatedpagelink( 'Card Artworks', args['name'] or args['cardgame'] or '', 'Artworks' ), _relatedpagelink( 'Card Names', args['name'] or args['cardgame'] or '', 'Names' ), }   local hlist = L.makeList( 'horizontal', list ) return tostring(hlist) end

--[==[ -- Infobox interior navigation --]==] --[==[ -- Bottom navigation

--]==]

-- Local functions (only used in this Module) --

function _relatedpagelink( namespace, value, label, section, itype ) local pagename = HF.NP local link local ask = mw.smw.ask{ ..namespace..' '..(itype or 'page')..' for::'..pagename.., link='none' } and mw.smw.ask{ ..namespace..' '..(itype or 'page')..' for::'..pagename.., link='none' }[1][1] or nil if value then link = namespace..':'..value else if not pagename:match('=') and ask then link = ask else link = namespace..':'..value end end if section then link = link .. '#' .. section end return HF.Link( link, label or namespace or '' ) --[==[ #| --]==] end

function _cardnavigation end

function _counters end

function _tokens end

- -- Output (send it back to whatever called it) -- - return navigation