Module:Text

local p = {}

local w_frame = require( 'module:frame' ) local w_title = require( 'module:title' )

-- DEPRECATED p.pageName    = w_title.main p.rootPageName = w_title.root p.subPageName = w_title.subpage

function p.toNumber( f ) local args = w_frame.args( f ) return tonumber( args[1], args.base or 10 ) end

-- DEPRECATED : Use "template:font" instead function p.font( f ) local args = w_frame.args( f ) return '' .. args[ 2 ] .. ' ' end

function p.title( f ) local args = w_frame.args( f ) local scale = tonumber( args[ 3 ] or 1 ) local space = ' ' .. ( scale > 1.5 and ' ' or '' ) .. ' '   local width = mw.loadData( 'module:text/' .. args[ 1 ] ) local intro = '' local text = ' ' local specialCharacters = mw.loadData( 'module:text/special' ) for c in mw.text.gsplit( args[ 2 ], '' ) do       text = text .. ( c == ' ' and space or intro .. ( specialCharacters[ c ] or c ) .. '.png|alt=' .. c .. '|' .. math.floor( width[ c ] * scale ) .. outro ) end return text .. ' ' end

return p