Module:File link/doc

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.

Usage from wikitext
From wikitext, this module should be called from a template, usually file link. Please see the template page for documentation. However, it can also be called using the syntax.

Usage from Lua
First, you need to import the module.

Then you can make file links using the  function.

args is a table of arguments that can have the following keys:
 * - the filename. (required)
 * - the file format, e.g. 'thumb', 'thumbnail', 'frame', 'framed', or 'frameless'.
 * - a filename to specify with the 'thumbnail' format option. The filename specified will be used instead of the automatically generated thumbnail.
 * - set this to true or "yes" (or any other value recognized as true by Module:Yesno) to set a border for the image.
 * - the horizontal alignment of the file, e.g. 'right', 'left', 'center', or 'none'.
 * - the vertical alignment of the file, e.g. 'baseline', 'middle', 'sub', 'super', 'text-top', 'text-bottom', 'top', or 'bottom'.
 * - the size of the image, e.g. '100px', 'x100px' or '100x100px'.
 * - the 'upright' parameter, used for setting the size of tall and thin images.
 * - the page that the file should link to. Use the blank string '' to suppress the default link to the file description page.
 * - the alt text. Use the blank string '' to suppress the default alt text.
 * - a caption for the file.
 * - sets a page number for multi-paged files such as PDFs.
 * - adds a  parameter to image links. The MediaWiki software adds this parameter to the   attribute of the image's   element when the page is rendered into HTML.
 * - adds a language attribute to specify what language to render the file in.
 * - specifies a start time for audio and video files.
 * - specifies an end time for audio and video files.
 * - specifies the time to use to generate the thumbnail image for video files.

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

Examples
With the file only:

With format, size, link and caption options:

With format, size, and border: