Module:Television episode disambiguation description
Appearance
![]() | This module depends on the following other modules: |
Module:Television episode disambiguation creates an entry in a disambiguation page by converting a plain text episode article name into a correctly formatted link and its short description. The style of the links follows the guidelines at WP:NCTV, MOS:DABENTRY, MOS:ITALICTITLE and MOS:QUOTETITLE.
This module implements the {{Television episode disambiguation description}} template.
Usage
Parameter list
Parameter | Explanation | Status |
---|---|---|
name
|
The episode's full article name | required |
not_disambiguated
|
Set if the parentheses is part of the episode name | optional |
link_only
|
Set if you are only interested in getting a formatted article link | optional |
Examples
See also
local p = {}
function p.getFormmatedArticleLink(frame)
local articleName = frame.args[1]
local disambiguation = string.match(articleName, "%s%((.-)%)", 1, false, "false")
local stylizedArticleTitle
if (disambiguation == "false") then
stylizedArticleTitle = "\"" .. articleName .. "\""
return stylizedArticleTitle
else
local articleTitle = string.gsub(articleName, "%s+%b()$", "", 1, false)
stylizedArticleTitle = "\"" .. articleTitle .. "\""
local isDisambiguationExtended = string.find(disambiguation, "episode")
local stylizedDisambiguation
if (isDisambiguationExtended == 0) then -- false
stylizedDisambiguation = "(''" .. disambiguation .. "'')"
else
local tvSeries = string.gsub(disambiguation, "episode", "", 1, true)
stylizedDisambiguation = "(''" .. tvSeries .. "'' episode)"
end
local newTitle = stylizedArticleTitle .. " " .. stylizedDisambiguation
return newTitle
end
end
return p