https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ALorem_ipsum%2Fsandbox Module:Lorem ipsum/sandbox - Revision history 2025-06-08T00:13:11Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.4 https://en.wikipedia.org/w/index.php?title=Module:Lorem_ipsum/sandbox&diff=1263602430&oldid=prev Ahecht: create with joinprefixsuffix 2024-12-17T16:17:07Z <p>create with joinprefixsuffix</p> <p><b>New page</b></p><div>local yn = require(&quot;Module:Yesno&quot;)<br /> return {<br /> main = function(frame)<br /> local args = require(&quot;Module:Arguments&quot;).getArgs(frame)<br /> local data = args[&quot;data&quot;] and mw.loadData(args[&quot;data&quot;]) or mw.loadData(&quot;Module:Lorem_ipsum/data&quot;)<br /> local paragraphs = {}<br /> for k,v in ipairs(data) do<br /> table.insert(paragraphs, v)<br /> end<br /> local out = &#039;&#039;<br /> local link = yn(args[&quot;link&quot;]) or yn(args[4]) or false<br /> local join = yn(args[&quot;join&quot;]) or false<br /> local joinprefixsuffix = yn(args[&quot;joinprefixsuffix&quot;]) or false<br /> local cat = yn(args[&quot;cat&quot;]) or true<br /> local count = tonumber(args[1] or 1)<br /> local i = 1<br /> if join and (not joinprefixsuffix) then<br /> out = out .. (args[&quot;prefix&quot;] or args[2] or &quot;&quot;)<br /> end<br /> while i &lt;= count do<br /> if (not join) or joinprefixsuffix then<br /> out = out .. (args[&quot;prefix&quot;] or args[2] or &quot;\n&quot;)<br /> end<br /> out = out .. mw.ustring.format(paragraphs[math.mod(i - 1, #paragraphs) + 1], (link and &quot;link&quot; or &quot;&quot;))<br /> if not join then<br /> out = out .. (args[&quot;suffix&quot;] or args[3] or &quot;&quot;) .. &quot;\n&quot;<br /> else<br /> if joinprefixsuffix then<br /> out = out .. (args[&quot;suffix&quot;] or args[3] or &quot;&quot;)<br /> end<br /> out = out .. (i == count and &quot;&quot; or &quot; &quot;)<br /> end<br /> link = false<br /> i = i + 1<br /> end<br /> if join and (not joinprefixsuffix) then<br /> out = out .. (args[&quot;suffix&quot;] or args[3] or &quot;&quot;)<br /> end<br /> if cat and mw.title.getCurrentTitle().namespace == 0 and not mw.isSubsting() then<br /> out = out .. &quot;[[Category:Wikipedia articles containing placeholders]]&quot;<br /> end<br /> return frame:preprocess(out)<br /> end,<br /> oneParagraph = function(frame)<br /> local args = require(&quot;Module:Arguments&quot;).getArgs(frame)<br /> local data = args[&quot;data&quot;] and mw.loadData(args[&quot;data&quot;]) or mw.loadData(&quot;Module:Lorem_ipsum/data&quot;)<br /> local paragraphs = {}<br /> for k,v in ipairs(data) do<br /> table.insert(paragraphs, v)<br /> end<br /> local i = tonumber(args[1] or 1)<br /> local link = yn(args[&quot;link&quot;])<br /> local paragraph = paragraphs[math.mod(i - 1, #paragraphs) + 1]<br /> local out = &quot;&quot;<br /> if cat and mw.title.getCurrentTitle().namespace == 0 and not mw.isSubsting() then<br /> out = out .. &quot;[[Category:Wikipedia articles containing placeholders]]&quot;<br /> end<br /> out = out .. mw.ustring.format(paragraph, (link and &quot;link&quot; or &quot;&quot;))<br /> out = frame:preprocess(out)<br /> local maxLen = tonumber(args[&quot;max len&quot;] or mw.ustring.len(out))<br /> return mw.ustring.sub(out, 1, maxLen)<br /> end<br /> }</div> Ahecht