https://wiki.swarma.org/index.php?title=%E6%A8%A1%E5%9D%97:For&feed=atom&action=history
模块:For - 版本历史
2024-03-28T11:46:46Z
本wiki的该页面的版本历史
MediaWiki 1.35.0
https://wiki.swarma.org/index.php?title=%E6%A8%A1%E5%9D%97:For&diff=31898&oldid=prev
Swarma:导入1个版本
2022-06-10T09:02:17Z
<p>导入1个版本</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<tr class="diff-title" lang="zh-Hans-CN">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">←上一版本</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">2022年6月10日 (五) 09:02的版本</td>
</tr><tr><td colspan="2" class="diff-notice" lang="zh-Hans-CN"><div class="mw-diff-empty">(没有差异)</div>
</td></tr></table>
Swarma
https://wiki.swarma.org/index.php?title=%E6%A8%A1%E5%9D%97:For&diff=31897&oldid=prev
排队论>Andrybak:don't add talk pages and pages in the user namespace to :Category:Hatnote templates with errors – this is similar to Module:Other uses of and Module:Hatnote
2020-11-02T22:29:56Z
<p>don't add talk pages and pages in the user namespace to <a href="/index.php?title=%E5%88%86%E7%B1%BB:Hatnote_templates_with_errors&action=edit&redlink=1" class="new" title="分类:Hatnote templates with errors(页面不存在)">Category:Hatnote templates with errors</a> – this is similar to <a href="/index.php/%E7%89%B9%E6%AE%8A:%E7%BC%96%E8%BE%91%E5%B7%AE%E5%BC%82/953627233/986768317" title="特殊:编辑差异/953627233/986768317">Module:Other uses of</a> and <a href="/index.php/%E7%89%B9%E6%AE%8A:%E7%BC%96%E8%BE%91%E5%B7%AE%E5%BC%82/967664662" title="特殊:编辑差异/967664662">Module:Hatnote</a></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="zh-Hans-CN">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">←上一版本</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">2020年11月2日 (一) 22:29的版本</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l17" >第17行:</td>
<td colspan="2" class="diff-lineno">第17行:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if (not use) then</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if (not use) then</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return mHatnote.makeWikitextError(</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return mHatnote.makeWikitextError(</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> '<del class="diffchange diffchange-inline">context参数缺失。请使用</del>{{other uses}}<del class="diffchange diffchange-inline">作为「其他情况」的顶注。</del>',</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> '<ins class="diffchange diffchange-inline">no context parameter provided. Use </ins>{{other uses}} <ins class="diffchange diffchange-inline">for "other uses" hatnotes.</ins>',</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> 'Template:For#<del class="diffchange diffchange-inline">错误</del>',</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> 'Template:For#<ins class="diffchange diffchange-inline">Errors</ins>',</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> args.category</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> args.category</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> )</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> )</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l25" >第25行:</td>
<td colspan="2" class="diff-lineno">第25行:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> function two (a, b) return a, b, 1 end --lets us run ipairs from 2</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> function two (a, b) return a, b, 1 end --lets us run ipairs from 2</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> for k, v in two(ipairs(args)) do table.insert(pages, v) end</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> for k, v in two(ipairs(args)) do table.insert(pages, v) end</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> local <del class="diffchange diffchange-inline">image </del>= '[[<del class="diffchange diffchange-inline">File:Disambig_gray.svg|25px|link=Wikipedia</del>:<del class="diffchange diffchange-inline">消歧义</del>]]'</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> local <ins class="diffchange diffchange-inline">title </ins>= <ins class="diffchange diffchange-inline">mw.title.getCurrentTitle()</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> local skipCat = title.isTalkPage or title.namespace == 2 --don't categorise talk pages and userspace</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> local oddCat = skipCat and '' or </ins>'[[<ins class="diffchange diffchange-inline">Category</ins>:<ins class="diffchange diffchange-inline">Hatnote templates using unusual parameters</ins>]]'</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> local category = yesNo(args.category)</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return mHatnote._hatnote(</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return mHatnote._hatnote(</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del class="diffchange diffchange-inline">image .. '&nbsp;&nbsp;' .. </del>mHatlist.forSeeTableToString({{use = use, pages = pages}}),</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> mHatlist.forSeeTableToString({{use = use, pages = pages}}),</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> {selfref = args.selfref}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> {selfref = args.selfref}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ) .. (</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ) .. (</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> (use == 'other uses') and <del class="diffchange diffchange-inline">yesNo</del>(<del class="diffchange diffchange-inline">args.</del>category) and</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> (use == 'other uses') and (<ins class="diffchange diffchange-inline">(</ins>category <ins class="diffchange diffchange-inline">== true) or (category == nil)</ins>) and</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del class="diffchange diffchange-inline">'[[Category:使用不寻常参数的顶注模板]]' </del>or ''</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins class="diffchange diffchange-inline">oddCat </ins>or ''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> )</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> )</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>return p</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>return p</div></td></tr>
</table>
排队论>Andrybak
https://wiki.swarma.org/index.php?title=%E6%A8%A1%E5%9D%97:For&diff=2160&oldid=prev
Swarma:创建页面,内容为“local mArguments --initialize lazily local mHatlist = require('Module:Hatnote list') local mHatnote = require('Module:Hatnote') local yesNo = require('Module:Yesno')…”
2020-04-08T03:19:43Z
<p>创建页面,内容为“local mArguments --initialize lazily local mHatlist = require('Module:Hatnote list') local mHatnote = require('Module:Hatnote') local yesNo = require('Module:Yesno')…”</p>
<p><b>新页面</b></p><div>local mArguments --initialize lazily<br />
local mHatlist = require('Module:Hatnote list')<br />
local mHatnote = require('Module:Hatnote')<br />
local yesNo = require('Module:Yesno')<br />
local p = {}<br />
<br />
--Implements {{For}} from the frame<br />
--uses capitalized "For" to avoid collision with Lua reserved word "for"<br />
function p.For (frame)<br />
mArguments = require('Module:Arguments')<br />
return p._For(mArguments.getArgs(frame))<br />
end<br />
<br />
--Implements {{For}} but takes a manual arguments table<br />
function p._For (args)<br />
local use = args[1]<br />
if (not use) then<br />
return mHatnote.makeWikitextError(<br />
'context参数缺失。请使用{{other uses}}作为「其他情况」的顶注。',<br />
'Template:For#错误',<br />
args.category<br />
)<br />
end<br />
local pages = {}<br />
function two (a, b) return a, b, 1 end --lets us run ipairs from 2<br />
for k, v in two(ipairs(args)) do table.insert(pages, v) end<br />
local image = '[[File:Disambig_gray.svg|25px|link=Wikipedia:消歧义]]'<br />
return mHatnote._hatnote(<br />
image .. '&nbsp;&nbsp;' .. mHatlist.forSeeTableToString({{use = use, pages = pages}}),<br />
{selfref = args.selfref}<br />
) .. (<br />
(use == 'other uses') and yesNo(args.category) and<br />
'[[Category:使用不寻常参数的顶注模板]]' or ''<br />
)<br />
end<br />
<br />
return p</div>
Swarma