5,078
edits
mNo edit summary |
No edit summary |
||
Line 283: | Line 283: | ||
local content = { | local content = { | ||
game, what, | game, what, | ||
[ 'subheading' ] = part or args.part, | |||
[ 'detail' ] = args.detail, | |||
[ 'quote' ] = args.quote, | |||
[ 'quotee' ] = args.quotee, | |||
[ 'quoteetext' ] = args.quoteetext or args.quotee, | |||
[ 'suffix' ] = args.suffix | |||
} | |||
return out .. makeStandardRef( frame, args.id, nil, content) | |||
end | |||
--[[[ | |||
Invocation entry point for Template:Ref/File. | |||
@param frame - object - The current parser frame | |||
@return wikitext - the constructed reference | |||
]] | |||
function ref.file( frame ) | |||
local args, out = arguments.preprocess( frame, { | |||
[ 'required' ] = { 'game', 'file' }, | |||
[ 'valid' ] = { 'gametext', 'id', 'part', 'parttext', 'detail', 'quote', | |||
'quotee', 'quoteetext', 'suffix' }, | |||
[ 'deprecated' ] = { 'gamelinktext' }, | |||
[ 'aliases' ] = { [ 1 ] = 'game', [ 'gamelink' ] = 'game', | |||
[ 'gamelinktext' ] = 'gametext', [ 'partlink' ] = 'part', | |||
[ 'expansion' ] = 'part', | |||
[ 'dlc' ] = 'part', [ 'edition' ] = 'part', [ 'partlink' ] = 'part', | |||
[ 'expansionlink' ] = 'part', [ 'dlclink' ] = 'part', | |||
[ 'editionlink' ] = 'part', | |||
[ 'partlinktext' ] = 'parttext', [ 'expansiontext' ] = 'parttext', | |||
[ 'dlctext' ] = 'parttext', [ 'editiontext' ] = 'parttext', | |||
[ 'quoteelinktext' ] = 'quoteetext' } | |||
} ) | |||
local game = uniqueLinkIfExists( | |||
acronym( 'game', args.game, 'page', args.game ), | |||
args.gameLinkText or acronym( 'game', args.game, 'title', args.game ), | |||
'ref' | |||
) | |||
local part | |||
if not utils.empty( args.part ) then | |||
part = uniqueLinkIfExists( | |||
args.part, | |||
args.parttext or args.part, | |||
'ref' | |||
) | |||
end | |||
local file = args.file or 'unspecified file' | |||
local content = { | |||
game, file, | |||
[ 'subheading' ] = part or args.part, | [ 'subheading' ] = part or args.part, | ||
[ 'detail' ] = args.detail, | [ 'detail' ] = args.detail, |