Content deleted Content added
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 57:
--- @param title string The article's title.
--- @return string | nil
local function
return match(title , "%d+", 1, -1, false, "")
end
Line 132:
name, _ = mw.ustring.gsub(name, "series %d*$", "")
name, _ = mw.ustring.gsub(name, "specials", "")
name, _ = mw.ustring.gsub(name, "story arc %d*$", "")
name = string.match(name, "^%s*(.-)%s*$") -- Trim spaces.
return name
Line 196 ⟶ 197:
local function getArticleTitleAndPipedLink(title, seasonNumberDiff)
local seasonType = getSeasonType(title)
local seasonNumber =
if tonumber(seasonNumber) == nil then
return "", nil
Line 311 ⟶ 312:
end
--- Returns an {{Italic title}} instance if title qualifies or a blank string.
--- @param frame table
--- @return string
function p.getItalicTitle(frame)
local getArgs = require("Module:Arguments").getArgs
local args = getArgs(frame)
-- If italic_title is set then "no" is the only valid value.
-- Don't set an italic title.
if args.italic_title then
end
local title = getTitle(frame)
title = getShowName(getTitleWithoutDisambiguation(title))
-- If the infobox is used on List of articles don't set an italic title.
-- TODO: this can be fixed in the future but current usages use a manual display title.
if string.find(title, "List of") then
return "
▲ return title
end
return frame:expandTemplate{title = "Italic title", args = {string = title}}
end
--- Returns the text used for the |above= field of the infobox.
---
--- @param frame table
--- @return string
function p.getAboveTitle(frame)
local getArgs = require("Module:Arguments").getArgs
Line 333 ⟶ 350:
end
--- Returns the
---
--- The text is returned in the format of "Season #" or "Series #",
Line 356 ⟶ 373:
local title = getTitle(frame)
local titleWithoutDisambiguation = getTitleWithoutDisambiguation(title)
seasonNumber =
seasonType = getSeasonType(titleWithoutDisambiguation)
-- For pages like "Doctor Who specials (2008–2010)".
if seasonType == "specials" then
return disambiguation .. " " .. seasonType
end
seasonType = seasonType:sub(1, 1):upper() .. seasonType:sub(2)
Line 397 ⟶ 415:
local title = getTitle(frame)
local showName = getShowName(getTitleWithoutDisambiguation(title))
if showName then
local disambiguation = getDisambiguation(title)
if disambiguation then
disambiguation = " (" .. disambiguation .. ")"
end
|