Module:Grid

local p = {} p.cell = function( f ) local args = f.args or f       if f == mw.getCurrentFrame and args[1] == nil then args = f:getParent.args else f = mw.getCurrentFrame end args = require( Module:ProcessArgs ).norm( args ) local item = args[1] local renamed = require( Module:Grid/Renames )[item] if renamed and ((args.mod or ) == 'V' or (args.mod or ) == '') then args[1] = renamed return [=[]=] .. p.cell(args) end local body = mw.html.create( 'span' ):addClass( 'grid' ):css{ ['vertical-align'] = args.align } if args['no-bg'] then body:addClass( 'grid-plain' ) end if args.class then body:addClass( args.class ) end if args.style then body:cssText( args.style ) end if not item then body:tag( 'br' ) return tostring( body ) end local mod = require(Module:Mods).getData(string.upper(args.mod or '')) or { abbr="", mod="", name="", localized="" } local link = args.link or '' if link:lower == 'none' then link = nil else if link == '' then link = item -- If args.dis is set, we only disambiguate if it equals exactly -- 'true' or '1'. Otherwise, disambiguate by default. local doDisambiguation if args.dis then doDisambiguation = args.dis == 'true' or args.dis == '1' else doDisambiguation = true end if mod.link and doDisambiguation then link = link .. ' (' .. mod.link .. ')' end end link = link .. require( Module:Language ).link{} if not args.animated then body:wikitext( '' ) end return tostring( body ) end return p