Module:File link/doc explained

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 documentation at mediawiki.org.

Usage from wikitext

From wikitext, this module should be called from a template, usually . Please see the template page for documentation. However, it can also be called using the syntax <nowiki>{{#invoke:File link|main|</nowiki>''arguments''<nowiki>}}</nowiki>.

Usage from Lua

First, you need to import the module.

local mFileLink = require('Module:File link')

Then you can make file links using the _main function.

mFileLink._main(args)

args is a table of arguments that can have the following keys:

To see the effect of each of these parameters, see the images help page on mediawiki.org.

Examples

With the file only:mFileLink.main-- Renders as

With format, size, link and caption options:mFileLink.main-- Renders as

With format, size, and border:mFileLink.main-- Renders as