Módulo:Link de arquivo/doc
Esta é a página de documentação para Módulo:Link de arquivo
This module is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure. |
Índice
Descrição
Este módulo é usado para construir ligações wikitext para arquivos. É útil principalmente para predefinições e módulos que utilizam a lógica complicada para fazer links de arquivos. Links de arquivos simples deve ser feita com marcação wikitext diretamente, pois usa menos recursos do que chamar este módulo. Para obter ajuda com arquivo de marcação wikitext consulte o documentation at mediawiki.org.
Uso de 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 {{#invoke:File link|main|arguments}}
.
Uso de 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:
file
- the filename. (required)format
- the file format, e.g. 'thumb', 'thumbnail', 'frame', 'framed', or 'frameless'.formatfile
- a filename to specify with the 'thumbnail' format option. The filename specified will be used instead of the automatically generated thumbnail.border
- set this to true or "yes" (or any other value recognized as true by Module:Yesno) to set a border for the image.location
- the horizontal alignment of the file, e.g. 'right', 'left', 'center', or 'none'.alignment
- the vertical alignment of the file, e.g. 'baseline', 'middle', 'sub', 'super', 'text-top', 'text-bottom', 'top', or 'bottom'.size
- the size of the image, e.g. '100px', 'x100px' or '100x100px'.upright
- the 'upright' parameter, used for setting the size of tall and thin images.link
- the page that the file should link to. Use the blank string to suppress the default link to the file description page.alt
- the alt text. Use the blank string to suppress the default alt text.caption
- a caption for the file.page
- sets a page number for multi-paged files such as PDFs.class
- adds aclass
parameter to image links. The MediaWiki software adds this parameter to theclass="..."
attribute of the image's<img />
element when the page is rendered into HTML.lang
- adds a language attribute to specify what language to render the file in.start
- specifies a start time for audio and video files.end
- specifies an end time for audio and video files.thumbtime
- 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.
Exemplos
With the file only:
mFileLink.main{file = 'Example.png'}
-- Renders as [[File:Example.png]]
With format, size, link and caption options:
mFileLink.main{
file = 'Example.png',
format = 'thumb',
size = '220px',
link = 'Wikipedia:Sandbox',
caption = 'An example.'
}
-- Renders as [[File:Example.png|thumb|220px|link=Wikipedia:Sandbox|An example.]]
With format, size, and border:
mFileLink.main{
file = 'Example.png',
format = 'frameless',
size = '220px',
border = true
}
-- Renders as [[File:Example.png|frameless|border|220px]]