Module:Infobox ship explained

require('strict');

local utilities = require ('Module:WPSHIPS_utilities');local infobox_ship_flag = utilities._infobox_ship_flag;local ship_name_format = utilities._ship_name_format;local synonym_check = utilities._synonym_check;local unbulleted_list = utilities._unbulleted_list;

local get_args = require ('Module:Arguments').getArgs;

local data = mw.loadData ('Module:Infobox_ship/data');

local namespace = mw.title.getCurrentTitle.namespace;local has_unknown_params = false;

----------------------------< L I N E _ I T E M S >-----------------------------------------------------------------------------

spin through sequence. Get parameter name and matching infobox label. Look in for parameter name. When parametername has a value, add infobox label and parameter value to the infobox table . identifies where label and dataenumerators begin.

local function line_items (args_t, params_t, infobox_ship_t, i, frame) for _, v in ipairs (params_t) do -- v is a sequence table with parameter name and associated infobox label if args_t[v[1]] then -- if parameter has a value infobox_ship_t['label' .. i] = v[2]; -- add the label infobox_ship_t['data' .. i] = unbulleted_list (args_t[v[1]]); -- and add the parameter value as data i = i + 1; -- bump the enumerator end endend

----------------------------< U N K N O W N _ P A R A M S _C H E C K >---------------------------------------

check parameters supplyed in