Munurin millum rættingarnar hjá "Module:File link/doc"

90 bytes løgd afturat ,  7 mánaðir síðan
s
Bot: Erstatt forældet <source> -tag og parameteren "enclose" [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html]
(Stovnaði síðu við "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...")
 
s (Bot: Erstatt forældet <source> -tag og parameteren "enclose" [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html])
 
First, you need to import the module.
 
<sourcesyntaxhighlight lang="lua">
local mFileLink = require('Module:File link')
</syntaxhighlight>
</source>
 
Then you can make file links using the <code>_main</code> function.
 
<sourcesyntaxhighlight lang="lua">
mFileLink._main(args)
</syntaxhighlight>
</source>
 
<var>args</var> is a table of arguments that can have the following keys:
 
With the file only:
<sourcesyntaxhighlight lang="lua">
mFileLink.main{file = 'Example.png'}
-- Renders as [[File:Example.png]]
</syntaxhighlight>
</source>
 
With format, size, link and caption options:
<sourcesyntaxhighlight lang="lua">
mFileLink.main{
file = 'Example.png',
}
-- Renders as [[File:Example.png|thumb|220px|link=Wikipedia:Sandbox|An example.]]
</syntaxhighlight>
</source>
 
With format, size, and border:
<sourcesyntaxhighlight lang="lua">
mFileLink.main{
file = 'Example.png',
}
-- Renders as [[File:Example.png|frameless|border|220px]]
</syntaxhighlight>
</source>
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
14.816

rættingar