Difference between pages "Module:Card image name" and "File:FiendKraken-TF04-JP-VG.jpg"

From Yugipedia
(Difference between pages)
Jump to: navigation, search
(Default to PAGENAME if the input is empty or none.)
 
m
 
Line 1: Line 1:
-- <pre>
+
{{Delete|Replaced by [[File:FiendKraken-TF05-JP-VG-artwork.png]]}}
-- @name Card image name
 
-- @description Converts a card name to be used in the file name.
 
-- @see {{Card image name}}
 
-- @author [[User:Becasita]]
 
-- @contact [[User talk:Becasita]]
 
  
-------------------
+
{{OCG-TCG card image
-- Export variable:
+
| name = Fiend Kraken
-------------------
+
}}
local CardImageName = {};
+
{{Fair use rationale
 
+
| Description      = "[[Fiend Kraken]]"
----------------
+
| Source            = ''[[Yu-Gi-Oh! 5D's Tag Force 4]]''
-- Load modules:
+
| Portion          = Portion of a screenshot.
----------------
+
| Purpose          = To visualize the card art.
local getArgs = require( 'Module:Arguments' ).getArgs;
+
| Resolution        = High.
local DATA    = require( 'Module:Data' );
+
| Replaceability    = No free alternative available.
local UTIL    = require( 'Module:Util' );
+
}}
 
 
--------------------
 
-- Module functions:
 
--------------------
 
-- @name getPageName
 
-- @description
 
local function getPageName( card )
 
if not card then
 
return '';
 
end
 
 
 
local smwName;
 
local query = mw.smw.ask( {
 
('[[%s]]'):format( card:gsub( '#', '' ) ),
 
'?Page name=',
 
limit    = 1,
 
mainlabel = '-'
 
} );
 
 
 
if not query or UTIL.count( query ) == 0 or UTIL.count( query[1] ) == 0 then
 
return card;
 
end
 
 
 
return query[ 1 ][ 1 ];
 
end
 
 
 
local function normalize( pagename )
 
if not pagename then
 
return '';
 
end
 
 
 
return (mw.text.split( pagename, '%s*%(' )[ 1 ])
 
:gsub( ' ' , '')
 
:gsub( '%-', ''):gsub( '–' , '')
 
:gsub( ',' , ''):gsub( '%.', ''):gsub( ':' , '')
 
:gsub( '\'', ''):gsub( '"' , ''):gsub( '&' , '')
 
:gsub( '%?', ''):gsub( '!' , '')
 
:gsub( '%%', ''):gsub( '=' , '')
 
:gsub( '/' , ''):gsub( '\\', '')
 
:gsub( '☆' , ''):gsub( '・' , '')
 
;
 
end
 
 
 
-- @name processArgs
 
-- @description Handles args (template call vs. module call).
 
local function processArgs( v )
 
if UTIL.isString( v ) then
 
-- If used through other modules.
 
return { UTIL.trim( v ) };
 
end
 
 
 
return getArgs( v, {
 
trim        = true,
 
removeBlanks = true,
 
parentOnly  = true
 
} );
 
end
 
 
 
-- @name main
 
-- @description Main function to be invoked. Handles args and execution.
 
function CardImageName.main( frame )
 
local PAGENAME  = mw.title.getCurrentTitle().text;
 
local args      = processArgs( frame );
 
local pagename  = getPageName( args[ 1 ] or PAGENAME );
 
local imageName = normalize( pagename );
 
return imageName;
 
end
 
 
 
----------
 
-- Return:
 
----------
 
return CardImageName;
 
-- </pre>
 

Latest revision as of 16:56, 21 February 2024

Licensing

Non-free media information and use rationale
Description

"Fiend Kraken"

Source

Yu-Gi-Oh! 5D's Tag Force 4

Portion used

Portion of a screenshot.

Low resolution?

High.

Purpose of use

To visualize the card art.

Replaceable?

No free alternative available.

Fair useFair use of copyrighted materialhttps://yugipedia.com/wiki/File:FiendKraken-TF04-JP-VG.jpg