Anonymous user
Module:Infobox: Difference between revisions
From The Kodiak Republic Wiki
Added more options to Italic Title per discussion at Template talk:Infobox#Italics part deux
(fix for spurious <p> tag per talk page) |
(Added more options to Italic Title per discussion at Template talk:Infobox#Italics part deux) |
||
Line 260:
end
--[[
Function handles the page's title italicization.
-- If the value of "italic title" is set to "force" or "yes", titles with no parentheses () are fully italicised,
and titles which contain parentheses are italicised before the first opening parenthesis.
-- If the value of "italic title" is set to "all", the complete title, including the text in parentheses is italicized.
-- If the value of "italic_string" is entered, instead of italicizing the whole title, it will italicize only some specific text.
-- Note that if the specific text is in the disambiguation then both |italic title=all and |italic_string=<text> will need to be used.
--
-- Optionale combinations:
--- No italics.
--- Italicized page name without disambiguation.
--- Italicized complete page name, including parentheses.
--- Italicized part of the text, not including disambiguation.
--- Italicized part of the text, including parentheses.
--]]
local function renderItalicTitle()
local italicTitleModule = require("Module:Italic title")._main
local italicTitleOption = args['italic title']
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then▼
local italicTitleString = args['italic_string']
end▼
local italicTitleArg = {}
if (italicTitleOption) then
local italicLowercase = mw.ustring.lower(italicTitleOption)
if (italicLowercase == "no") then
-- If set to "no" or any other disabling parameter, do nothing.
return
▲ elseif
root:wikitext(italicTitleModule({}))
return
elseif (italicLowercase == 'all') then
italicTitleArg.all = "yes"
else
-- Do nothing.
return
end
if (italicTitleString) then
italicTitleArg.string = italicTitleString
end
root:wikitext(italicTitleModule(italicTitleArg))
end
Line 447 ⟶ 486:
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
preprocessSingleArg('decat')
return _infobox()
|