Editing
Module:Disambiguation
From Thetacola Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local mRedirect = require('Module:Redirect') local disambigTemplates = { "[Dd][Aa][Bb]", "[Dd]big", "[Dd]is", "[Dd]isambiguation", "[%w_%s]-%f[%w][Dd]isam[%w]-", "[Gg]eodis", "[Hh][Nn][Dd][Ii][Ss]", "[Hh]ndisambig", "[Ll]etter%-[Nn]umber [Cc]ombination [Dd]isambiguation", "[Ll]etter%-NumberCombDisambig", "[Mm]il%-unit%-dis", "[Nn]umberdis", "[Ss]choold[ai][bs]", "[Mm]il-unit-disambig", "[Mm]ilitary unit disambiguation", "[Gg]eo-dis", "[Gg]eodisambig", "[Dd]isambig[Gg]eo", "[Dd]isambig[GN]", "[Dd]isambigNm", "[Dd]isambigName", "[Ss]urname", "[Ss]urnames", "[Ss]pecies Latin name disambiguation", "[Ss]peciesLatinNameDisambig", "[Ll]atinNameDisambig", "[Mm]athematical disambiguation", "[Mm]athematics disambiguation", "[Mm]athdab", "[Mm]ath dab", "[Rr]oad disambiguation", "[Rr]oaddis", } p.isDisambiguation = function(content) -- false if there is no content if content == nil then return false end -- redirects are not disambiguation pages if mRedirect.getTargetFromText(content) ~= nil then return false end -- check for disambiguation templates in the content for _i, v in ipairs(disambigTemplates) do if mw.ustring.find(content, "{{%s*".. v .. "%s*%f[|}]") ~= nil then return true end end -- check for magic word if mw.ustring.find(content, "__DISAMBIG__", 1, true) ~= nil then return true end return false end p._isDisambiguationPage = function(page) -- Look "(disambiguation)" in the title if mw.ustring.find(page, "(disambiguation)",0,true) ~= nil then return true; end -- Look for disamiguation template in page content local title = mw.title.new(page) if not title then return false end local content = title:getContent() return p.isDisambiguation(content) end -- Entry points for templates p.isDisambiguationPage = function(frame) local title = frame.args[1] return p._isDisambiguationPage(title) and "yes" or "" end return p
Summary:
Please note that all contributions to Thetacola Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Debug console
* The module exports are available as the variable "p", including unsaved modifications. * Precede a line with "=" to evaluate it as an expression or use print(). Use mw.logObject() for tables. * Use mw.log() and mw.logObject() in module code to send messages to this console.
New
(
edit
)
Paris
(
edit
)
Template:High-use
(
edit
)
Template:Module other
(
edit
)
Template:Module rating
(
edit
)
Template:Nowrap
(
edit
)
Template:Ombox
(
edit
)
Template:Template link
(
edit
)
Template:Tl
(
edit
)
Module:Arguments
(
edit
)
Module:Disambiguation
(
edit
)
Module:Disambiguation/doc
(
edit
)
Module:Effective protection level
(
edit
)
Module:High-use
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Redirect
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/D
(
edit
)
Module:Yesno
(
edit
)
Navigation menu
Page actions
Module
Discussion
Read
Edit source
History
Page actions
Module
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information