Module:Poetry

--[[ divify

Main entry point for Lua function to wrap individual lines of poetry in passed string in protective .. pairs.

Usage:

]]

Poetry = {};

function Poetry.divify(frame) rhyme = frame.args[1] or ""

-- Noting passed in? Acceptable as response. if rhyme == '' then return rhyme end

return ' ' .. mw.ustring.gsub( rhyme, '\n', ' \n ' ).. ' ' end

--[[ rmuid

Main entry point for Lua function to remove any and all unit-ids (typically "em", "ex" etc.) from quantity presented and return truncated result.

Usage:

would in this case return the string "3". ]]

function Poetry.rmuid(frame) local quantity = frame.args[1] or ""

-- Iterate over remaining arguments, and remove each string found from quantity. key = 2 while ( frame.args[key] ~= nil ) do       quantity = mw.ustring.gsub( quantity, frame.args[key], '' ) key = key + 1 end

return quantity end

return Poetry