Content deleted Content added
fix |
Added the page to Category:Module documentation pages |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1:
{{high-use}}
{{Module rating|protected}}
{{Lua|Module:Yesno|Module:Arguments}}
This module is used to construct wikitext links to files. It is primarily useful for templates and modules that use complicated logic to make file links. Simple file links should be made with wikitext markup directly, as it uses less resources than calling this module. For help with wikitext file markup please refer to the [[mw:Help:Images|documentation at mediawiki.org]].
Line 10 ⟶ 12:
First, you need to import the module.
<
local mFileLink = require('Module:File link')
</syntaxhighlight>
Then you can make file links using the <code>_main</code> function.
<
mFileLink._main(args)
</syntaxhighlight>
<var>args</var> is a table of arguments that can have the following keys:
Line 44 ⟶ 46:
With the file only:
<
mFileLink.main{file = 'Example.png'}
-- Renders as [[File:Example.png]]
</syntaxhighlight>
With format, size, link and caption options:
<
mFileLink.main{
file = 'Example.png',
Line 59 ⟶ 61:
}
-- Renders as [[File:Example.png|thumb|220px|link=Wikipedia:Sandbox|An example.]]
</syntaxhighlight>
With format, size, and border:
<
mFileLink.main{
file = 'Example.png',
Line 70 ⟶ 72:
}
-- Renders as [[File:Example.png|frameless|border|220px]]
</syntaxhighlight>
<includeonly>{{
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Link modules]]
}}</includeonly><noinclude>
[[Category:Module documentation pages]]
</noinclude>
|