Module:File link/doc: Difference between revisions
From Mariopedia, a wiki on Mario, Yoshi, Wario, Donkey Kong, Super Smash Bros., and more!
Jump to navigationJump to search
Content deleted Content added
fix |
m change source to syntaxhighlight |
||
Line 10: | Line 10: | ||
First, you need to import the module. |
First, you need to import the module. |
||
< |
<syntaxhighlight lang="lua"> |
||
local mFileLink = require('Module:File link') |
local mFileLink = require('Module:File link') |
||
</syntaxhighlight> |
|||
</source> |
|||
Then you can make file links using the <code>_main</code> function. |
Then you can make file links using the <code>_main</code> function. |
||
< |
<syntaxhighlight lang="lua"> |
||
mFileLink._main(args) |
mFileLink._main(args) |
||
</syntaxhighlight> |
|||
</source> |
|||
<var>args</var> is a table of arguments that can have the following keys: |
<var>args</var> is a table of arguments that can have the following keys: |
||
Line 44: | Line 44: | ||
With the file only: |
With the file only: |
||
< |
<syntaxhighlight lang="lua"> |
||
mFileLink.main{file = 'Example.png'} |
mFileLink.main{file = 'Example.png'} |
||
-- Renders as [[File:Example.png]] |
-- Renders as [[File:Example.png]] |
||
</syntaxhighlight> |
|||
</source> |
|||
With format, size, link and caption options: |
With format, size, link and caption options: |
||
< |
<syntaxhighlight lang="lua"> |
||
mFileLink.main{ |
mFileLink.main{ |
||
file = 'Example.png', |
file = 'Example.png', |
||
Line 59: | Line 59: | ||
} |
} |
||
-- Renders as [[File:Example.png|thumb|220px|link=Wikipedia:Sandbox|An example.]] |
-- Renders as [[File:Example.png|thumb|220px|link=Wikipedia:Sandbox|An example.]] |
||
</syntaxhighlight> |
|||
</source> |
|||
With format, size, and border: |
With format, size, and border: |
||
< |
<syntaxhighlight lang="lua"> |
||
mFileLink.main{ |
mFileLink.main{ |
||
file = 'Example.png', |
file = 'Example.png', |
||
Line 70: | Line 70: | ||
} |
} |
||
-- Renders as [[File:Example.png|frameless|border|220px]] |
-- Renders as [[File:Example.png|frameless|border|220px]] |
||
</syntaxhighlight> |
|||
</source> |
|||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| |
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| |