https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AFixme Module:Fixme - Revision history 2025-06-03T08:21:23Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.3 https://en.wikipedia.org/w/index.php?title=Module:Fixme&diff=569383573&oldid=prev Mr. Stradivarius: fix copy and paste fail 2013-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. Stradivarius https://en.wikipedia.org/w/index.php?title=Module:Fixme&diff=569380152&oldid=prev Mr. Stradivarius: create 2013-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 &quot;FIXME&quot; it adds it to a tracking category.<br /> <br /> local trackingCategory = &#039;Lua modules with fixme tags&#039;<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 ~= &#039;Module&#039; 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 == &#039;doc&#039; or subpage == &#039;sandbox&#039; ) then<br /> page = getTitleObject( page.baseText )<br /> end<br /> -- The module shouldn&#039;t match itself.<br /> if page.prefixedText == &#039;Module:Fixme&#039; 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 &quot;FIXME&quot; text.<br /> local fixmeExists = false<br /> local fixmePattern = &#039;%WFIXME%W&#039;<br /> for singleLineComment in mw.ustring.gmatch( content, &#039;%-%-([^\n]*)&#039; ) 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, &#039;(%-%-%[(=*)%[.-%]%2%])&#039; ) 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( &#039;[[Category:%s|%s]]&#039;, 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