Module:Symbol

local p = {} local data = mw.loadData('Module:Symbol/data') local getArgs = require('Module:Arguments').getArgs local mFileLink = require('Module:File link')._main

local i18n = { error = { no_data = 'Found no data', no_file = 'Found no file', no_input = 'No input given' } }

function p.main(frame) local args = getArgs(frame, {   wrappers = {      'Template:Symbol'    }  }) return p._main(args) end

function p._main(args) assert(args[1], i18n.error.no_input) local symbol_data = data[args[1]:lower] assert(symbol_data, i18n.error.no_data)

-- If there is not file key, throw error assert(symbol_data.file, i18n.error.no_file)

-- Create a copy of the symbol table to make it editable. local symbol = {} for k,v in pairs(symbol_data) do   symbol[k] = v  end symbol.size = (args.size or symbol.size or '22px') symbol.alt = args.alt

return mFileLink(symbol) end

return p