| 👁 Image | This module is rated as alpha. It is ready for limited use and third-party feedback. It may be used on a small number of pages, but should be monitored closely. Suggestions for new features or adjustments to input and output are welcome. |
| 👁 Page semi-protected | Editing of this module by new or unregistered users is currently disabled. See the protection policy and protection log for more details. If you cannot edit this module and you wish to make a change, you can submit an edit request, discuss changes on the talk page, request unprotection, log in, or create an account. |
| 👁 Image | This module depends on the following other modules: |
Implements {{Lorem ipsum}}, {{Lorem ipsum span}}, and {{Dolorem ipsum}}.
Parameters:
- "data": Data page containing a list of paragraphs to use for generating filler text. Defaults to Module:Lorem ipsum/data.
Usage
{{#invoke:Lorem ipsum|function_name}}
localyn=require("Module:Yesno") localp={} functionp._main(args) localparagraphs={} localoutTbl=setmetatable({},{__call=function(t,v)t[#t+1]=vend}) locallink=yn(args["link"])oryn(args[4])orfalse localjoin=yn(args["join"])orfalse localjoinprefixsuffix=yn(args["joinprefixsuffix"])orfalse localcat=yn(args["cat"])ortrue localcount=tonumber(args[1])or1 locali=tonumber(args["start"])or1 localdata=mw.loadData(args["data"]or"Module:Lorem_ipsum/data") localmaxLen=tonumber(args["max len"]) fork,vinipairs(data)do table.insert(paragraphs,v) end ifjoinand(notjoinprefixsuffix)then outTbl(args["prefix"]orargs[2]or"") end whilei>0andi<=countdo if(notjoin)orjoinprefixsuffixthen outTbl(args["prefix"]orargs[2]or"\n") end mw.log(count,i,data) outTbl(mw.ustring.format(paragraphs[math.mod(i-1,#paragraphs)+1],(linkand"link"or""))) ifnotjointhen outTbl((args["suffix"]orargs[3]or"").."\n") else ifjoinprefixsuffixthen outTbl(args["suffix"]orargs[3]or"") end outTbl(i==countand""or" ") end link=false i=i+1 end ifjoinand(notjoinprefixsuffix)then outTbl(args["suffix"]orargs[3]or"") end ifcatandmw.title.getCurrentTitle().namespace==0andnotmw.isSubsting()then outTbl("[[Category:Wikipedia articles containing placeholders]]") end localoutStr=mw.getCurrentFrame():preprocess(table.concat(outTbl)) returnmaxLenandmw.ustring.sub(outStr,1,maxLen)oroutStr end functionp.main(frame) localargs=require("Module:Arguments").getArgs(frame) returnp._main(args,false) end functionp.oneParagraph(frame) localargs=require("Module:Arguments").getArgs(frame) args["join"]=true args["start"]=tonumber(args[1])or1 returnp._main(args) end returnp
Hidden category:
