Module:Sandbox/trappist the monk/make cite iucn explained

require ('strict');

--authorn= parameters from the list of names provided in the raw iucn citation. namesmust have the form: Surname, I. (more than one 'I.' pair allowed but no spaces between I. pairs)

local function author_names_get (raw_iucn_cite) local list = ; -- table that holds name list parts local author_names = raw_iucn_cite:match ('^([^%d]-)%s+%d%d%d%d'); -- extract author name-list from raw iucn citation

local names = author_names:gsub ('%.,?%s+&%s+', '.|'):gsub ('%.,%s+', '.|'); -- replace 'separators' ( and ) with list = mw.text.split (names, '|'); -- split the string on the pipes into entries in list if 0

#list then return table.concat -- no 'names' of the proper form; return the original as a single |author= parameter else for i, name in ipairs (list) do -- spin through the list and list[i] = table.concat ; -- add |authorn= parameter names end return table.concat (list, ' '); -- make a big string and return that endend

--

local function title_get (raw_iucn_cite) local title = raw_iucn_cite:match ('%d%d%d%d%.%s+(.-)%s*%. The IUCN Red List of Threatened Species');

local patterns = for i, v in ipairs (patterns) do -- spin through the patterns if title:match (v[1]) then -- when a match title = title:gsub (v[1], v[2]); -- add italics break; -- and done end end

return table.concat ; -- return the |title= parameterend

----------------------------< M A K E _ C I T E _ I U C N >--------------------------------------------------

parses apart an iucn-format citation copied from their webpage and reformats that into a template for substing

local function make_cite_iucn (frame) local raw_iucn_cite = frame.args[1]; local template = '); -- close the template

return table.concat (template);end

----------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------

return