https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AFixmeModule:Fixme - Revision history2025-06-03T08:21:23ZRevision history for this page on the wikiMediaWiki 1.45.0-wmf.3https://en.wikipedia.org/w/index.php?title=Module:Fixme&diff=569383573&oldid=prevMr. Stradivarius: fix copy and paste fail2013-08-20T12:04:51Z<p>fix copy and paste fail</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:04, 20 August 2013</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 66:</td>
<td colspan="2" class="diff-lineno">Line 66:</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;"><br /></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;"><br /></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 p.main( frame )</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 p.main( frame )</div></td>
</tr>
<tr>
<td class="diff-marker" data-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> -- If we are being called from #invoke, then the <del style="font-weight: bold; text-decoration: none;">number</del> is the first positional</div></td>
<td class="diff-marker" data-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> -- If we are being called from #invoke, then the <ins style="font-weight: bold; text-decoration: none;">page name</ins> is the first positional</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> -- argument. If not, it is the frame parameter.</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> -- argument. If not, it is the frame parameter.</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> local page</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> local page</div></td>
</tr>
</table>Mr. Stradivariushttps://en.wikipedia.org/w/index.php?title=Module:Fixme&diff=569380152&oldid=prevMr. Stradivarius: create2013-08-20T11:42:42Z<p>create</p>
<p><b>New page</b></p><div>-- This module searches through the specified Lua module, and if it finds the text "FIXME" it adds it to a tracking category.<br />
<br />
local trackingCategory = 'Lua modules with fixme tags'<br />
<br />
local p = {}<br />
<br />
-- Gets a title object for the specified page, and defaults to the<br />
-- title object for the current page if it is not specified or if<br />
-- there are any errors.<br />
local function getTitleObject( page )<br />
local currentTitle = mw.title.getCurrentTitle()<br />
if page then<br />
-- Get the title object, passing the function through pcall <br />
-- in case we are over the expensive function count limit.<br />
local noError, titleObject = pcall( mw.title.new, page )<br />
if not noError or not titleObject then<br />
return currentTitle<br />
else<br />
return titleObject<br />
end<br />
else<br />
return currentTitle<br />
end <br />
end<br />
<br />
local function _main( page )<br />
page = getTitleObject( page )<br />
-- This module should only be used to search for other modules.<br />
if page.nsText ~= 'Module' then<br />
return<br />
end<br />
-- Match the base page if we are being called from a sandbox or a /doc page.<br />
local subpage = page.subpageText<br />
if page.isSubpage and ( subpage == 'doc' or subpage == 'sandbox' ) then<br />
page = getTitleObject( page.baseText )<br />
end<br />
-- The module shouldn't match itself.<br />
if page.prefixedText == 'Module:Fixme' then<br />
return<br />
end<br />
-- Get the page content.<br />
local content = page:getContent()<br />
if not content then<br />
return<br />
end<br />
-- Find any "FIXME" text.<br />
local fixmeExists = false<br />
local fixmePattern = '%WFIXME%W'<br />
for singleLineComment in mw.ustring.gmatch( content, '%-%-([^\n]*)' ) do<br />
if mw.ustring.find( singleLineComment, fixmePattern ) then<br />
fixmeExists = true<br />
end<br />
end<br />
if not fixmeExists then<br />
for multiLineComment in mw.ustring.gmatch( content, '(%-%-%[(=*)%[.-%]%2%])' ) do<br />
if mw.ustring.find( multiLineComment, fixmePattern ) then<br />
fixmeExists = true<br />
end<br />
end<br />
end<br />
-- If any FIXMEs were found, return the tracking category.<br />
if fixmeExists then<br />
return mw.ustring.format( '[[Category:%s|%s]]', trackingCategory, page.text )<br />
end<br />
end<br />
<br />
function p.main( frame )<br />
-- If we are being called from #invoke, then the number is the first positional<br />
-- argument. If not, it is the frame parameter.<br />
local page<br />
if frame == mw.getCurrentFrame() then<br />
page = frame:getParent().args[ 1 ]<br />
local framePage = frame.args[ 1 ]<br />
if framePage then<br />
page = framePage<br />
end<br />
else<br />
page = frame<br />
end<br />
return _main( page )<br />
end<br />
<br />
return p</div>Mr. Stradivarius