Jump to content

Module:Lorem ipsum

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Awesome Aasim (talk | contribs) at 17:01, 23 April 2024 (Created page with 'return { main = function(frame) local args = require("Module:Arguments").getArgs(frame) local paragraphs = args["paragraphs"] and mw.loadData(args["paragraphs"]) or mw.loadData("Module:Lorem_ipsum/data") local out = '' local link = require("Module:Yesno")(args["link"]) local join = require("Module:Yesno")(args["join"]) local count = tonumber(args[1]) local i = 1 while i <= count do if join then out = out .. (args["prefix"] or args[2]...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

return {
	main = function(frame)
		local args = require("Module:Arguments").getArgs(frame)
		local paragraphs = args["paragraphs"] and mw.loadData(args["paragraphs"]) or mw.loadData("Module:Lorem_ipsum/data")
		local out = ''
		local link = require("Module:Yesno")(args["link"])
		local join = require("Module:Yesno")(args["join"])
		local count = tonumber(args[1])
		local i = 1
		while i <= count do
			if join then
				out = out .. (args["prefix"] or args[2] or "")
			else
				out = out .. (args["prefix"] or args[2] or "\n")
			end
			out = out .. mw.ustring.format(paragraphs[math.mod(i, #paragraphs) + 1], (link and "link" or ""))
			if join then
				out = out .. (args["suffix"] or args[3] or "")
			else
				out = out .. (args["suffix"] or args[3] or "\n")
			end
			link = false
		end
		return frame:preprocess(out)
	end
}