Module:Transcript

local p = {}

local utilsArg = require("Module:UtilsArg") local utilsLayout = require("Module:UtilsLayout")

-- Despite the simplicity, a module invocation is needed to preserve the whitespace function p.Main(frame) local args, err = utilsArg.parse(frame:getParent.args, p.Templates.Transcript) if err then return err.categoryText else text = frame:extensionTag("poem", args.text) return ''..text.." " end end

function p.Pages(frame) local args, err = utilsArg.parse(frame:getParent.args, p.Templates["Transcript Pages"]) local categories = err and err.categoryText or "" local tabData = {} for i, page in ipairs(args.pages or {}) do		local pageTranscript = frame:expandTemplate({			title = "Transcript",			args = {page.page}		}) table.insert(tabData, {			label = args.entry.." "..i,			content = pageTranscript		}) end return utilsLayout.tabs(tabData) end

p.Templates = { Transcript = { format = "block", purpose = "This template is for displaying transcripts of in-game Books as well as song lyrics. For multi-page books, use Template:Transcript Pages.", categories = {"Formatting Templates"}, params = { [1] = {				inline = true, name = "text", required = true, type = "content", desc = "In-game text with original formatting—line breaks, paragraphs, indentation, etc.", },		}	},	["Transcript Pages"] = { format = "block", purpose = "This template is a variation of Template:Transcript that displays transcripts of in-game Books with multiple pages.", categories = {"Formatting Templates"}, repeatedGroup = { name = "pages", params = {"page"}, },		params = { entry = { type = "content", desc = "The word to use in the numbered tab labels.", default = "Page", },			page = { required = true, type = "content", desc = "The in-game text of a book page with original formatting—line breaks, paragraphs, indentation, etc.", },		},	}, }

return p