Module:File link/doc: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
add more methods
(add alignment methods)
(add more methods)
Line 131:
 
Sets the ''alignment'' option. This is also known as the ''vertical alignment'' option. <var>s</var> must either be nil, or one of the strings 'baseline', 'middle', 'sub', 'super', 'text-top', 'text-bottom', 'top', or 'bottom'. To see the effect of each of these values, see the [[mw:Help:Images#Vertical alignment|images help page on mediawiki.org]].
 
=== Link ===
 
<source lang="lua">
obj:link(s)
</source>
 
Sets a link target for the file, instead of the default target of the file description page. <var>s</var> must either be nil or a string value. The link can be a wiki page or a URL, although the exact formatting of the string is not checked by this module. To specify no link, use the blank string: {{code|obj:link('')|lua}}.
 
=== Alt ===
 
<source lang="lua">
obj:alt(s)
</source>
 
Sets [[WP:ALT|alt text]] for the file. <var>s</var> must either be nil or a string value.
 
=== Page ===
 
<source lang="lua">
obj:page(num)
</source>
 
Sets a page number for multi-paged files such as PDFs. <var>num</var> must either be nil or a number.
 
=== Class ===
 
<source lang="lua">
obj:class(s)
</source>
 
Adds an HTML class to the file link. <var>s</var> must either be nil or a string value.
 
=== Lang ===
 
<source lang="lua">
obj:class(s)
</source>
 
Adds a language attribute to specify what language to render the file in. <var>s</var> must either be nil or a string value. This module does not check whether the language tag is valid or not.
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu