Module:Annotated link: Difference between revisions

Content deleted Content added
require( 'Module:Lang' )
able to pass all args to Module:GetShortDescription; language handling is gonna be a lot of fun
Line 1:
local p = {}
 
local getShortDescgetShortDescription = require( 'Module:GetShortDescription' ).main
local mLang = require( 'Module:Lang' )
 
Line 26:
end
return case_altered_short_description
end
 
local function getShortDescription( name, case )
local short_description = getShortDesc( { args = { name = name } } )
return handleFirstLetterCase( short_description, case )
end
 
Line 46 ⟶ 41:
local case = args.case
local aka = args.aka
local GSDargs = {
args = {
lang_italic = args.desc_lang_italic,
lang_nocat = args.desc_lang_nocat,
lang_size = args.desc_lang_size,
lang_cat = args.desc_lang_cat,
lang_rtl = args.desc_lang_rtl,
lang_no = args.desc_lang_no,
fallback = args.fallback,
prefer = args.prefer,
only = args.only,
name = name
}
}
local result = safePipedLink( name, display )
Line 65 ⟶ 75:
end
local short_description = handleFirstLetterCase( getShortDescription( nameGSDargs ), case )
if short_description and short_description ~= '' then
result = result .. dash .. ' ' .. short_description
Line 84 ⟶ 94:
 
--[[
 
{{#invoke:AnnotatedLink|main
Module:GetShortDescription |name= |only= |prefer= |fallback= |lang_italic= |lang_nocat= |lang_size= |lang_cat= |lang_rtl= |lang_no=
 
{{#invoke:AnnotatedLink|main |name= |display= |wedge= |quote= |dash= |abbr= |case= |aka= }}|name= |only= |prefer= |fallback=
|desc_lang_italic= |desc_lang_nocat= |desc_lang_size= |desc_lang_cat= |desc_lang_rtl= |desc_lang_no=
}}
p.main { args = { name = "", display = "", wedge = "", quote = "", dash = "", abbr = "", case = "", aka = "" } }
Line 93 ⟶ 107:
p.main { args = { name = "The Partisan" } }
p.main { args = { name = "The Partisan", quote = "yes" } }
p.main { args = { name = "The Partisan", quote = "yes", only = "wikidata", case = "upper" } }
p.main { args = { name = "Author, Author (Star Trek: Voyager)" } }