<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://wiki.itworks.cc/index.php?action=history&amp;feed=atom&amp;title=Module%3AFile_link%2Fdoc</id>
	<title>Module:File link/doc - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.itworks.cc/index.php?action=history&amp;feed=atom&amp;title=Module%3AFile_link%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.itworks.cc/index.php?title=Module:File_link/doc&amp;action=history"/>
	<updated>2026-06-18T10:32:31Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.itworks.cc/index.php?title=Module:File_link/doc&amp;diff=514&amp;oldid=prev</id>
		<title>甲虫：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://wiki.itworks.cc/index.php?title=Module:File_link/doc&amp;diff=514&amp;oldid=prev"/>
		<updated>2024-10-14T07:17:02Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2024年10月14日 (一) 07:17的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key mediawiki:diff:1.41:old-513:rev-514 --&gt;
&lt;/table&gt;</summary>
		<author><name>甲虫</name></author>
	</entry>
	<entry>
		<id>https://wiki.itworks.cc/index.php?title=Module:File_link/doc&amp;diff=513&amp;oldid=prev</id>
		<title>zh&gt;Cewbot：​機器人作業請求: source 改 syntaxhighlight (Category:使用已弃用source标签的页面) - log</title>
		<link rel="alternate" type="text/html" href="https://wiki.itworks.cc/index.php?title=Module:File_link/doc&amp;diff=513&amp;oldid=prev"/>
		<updated>2020-07-07T04:28:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/Special:Diff/60461710#source_改_syntaxhighlight&quot; title=&quot;Special:Diff/60461710&quot;&gt;機器人作業請求&lt;/a&gt;: source 改 syntaxhighlight (Category:使用已弃用source标签的页面) - &lt;a href=&quot;/index.php?title=User:Cewbot/log/20190913&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Cewbot/log/20190913（页面不存在）&quot;&gt;log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;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 [[mw:Help:Images|documentation at mediawiki.org]].&lt;br /&gt;
&lt;br /&gt;
== 維基語法的使用 ==&lt;br /&gt;
&lt;br /&gt;
From wikitext, this module should be called from a template, usually {{tl|file link}}. Please see the template page for documentation. However, it can also be called using the syntax &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:File link|main|&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;arguments&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Lua的使用 ==&lt;br /&gt;
&lt;br /&gt;
First, you need to import the module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local mFileLink = require(&amp;#039;Module:File link&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can make file links using the &amp;lt;code&amp;gt;_main&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mFileLink._main(args)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;var&amp;gt;args&amp;lt;/var&amp;gt; is a table of arguments that can have the following keys:&lt;br /&gt;
* &amp;lt;code&amp;gt;file&amp;lt;/code&amp;gt; - the filename. (required)&lt;br /&gt;
* &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; - the file format, e.g. &amp;#039;thumb&amp;#039;, &amp;#039;thumbnail&amp;#039;, &amp;#039;frame&amp;#039;, &amp;#039;framed&amp;#039;, or &amp;#039;frameless&amp;#039;.&lt;br /&gt;
* &amp;lt;code&amp;gt;formatfile&amp;lt;/code&amp;gt; - a filename to specify with the &amp;#039;thumbnail&amp;#039; format option. The filename specified will be used instead of the automatically generated thumbnail.&lt;br /&gt;
* &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt; - set this to true or &amp;quot;yes&amp;quot; (or any other value recognized as true by [[Module:Yesno]]) to set a border for the image.&lt;br /&gt;
* &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; - the horizontal alignment of the file, e.g. &amp;#039;right&amp;#039;, &amp;#039;left&amp;#039;, &amp;#039;center&amp;#039;, or &amp;#039;none&amp;#039;.&lt;br /&gt;
* &amp;lt;code&amp;gt;alignment&amp;lt;/code&amp;gt; - the vertical alignment of the file, e.g. &amp;#039;baseline&amp;#039;, &amp;#039;middle&amp;#039;, &amp;#039;sub&amp;#039;, &amp;#039;super&amp;#039;, &amp;#039;text-top&amp;#039;, &amp;#039;text-bottom&amp;#039;, &amp;#039;top&amp;#039;, or &amp;#039;bottom&amp;#039;.&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; - the size of the image, e.g. &amp;#039;100px&amp;#039;, &amp;#039;x100px&amp;#039; or &amp;#039;100x100px&amp;#039;.&lt;br /&gt;
* &amp;lt;code&amp;gt;upright&amp;lt;/code&amp;gt; - the &amp;#039;upright&amp;#039; parameter, used for setting the size of tall and thin images.&lt;br /&gt;
* &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; - the page that the file should link to. Use the blank string &amp;#039;&amp;#039; to suppress the default link to the file description page.&lt;br /&gt;
* &amp;lt;code&amp;gt;alt&amp;lt;/code&amp;gt; - the alt text. Use the blank string &amp;#039;&amp;#039; to suppress the default alt text.&lt;br /&gt;
* &amp;lt;code&amp;gt;caption&amp;lt;/code&amp;gt; - a caption for the file.&lt;br /&gt;
* &amp;lt;code&amp;gt;page&amp;lt;/code&amp;gt; - sets a page number for multi-paged files such as PDFs.&lt;br /&gt;
* &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; - adds a &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; parameter to image links. The MediaWiki software adds this parameter to the &amp;lt;code&amp;gt;class=&amp;quot;...&amp;quot;&amp;lt;/code&amp;gt; attribute of the image&amp;#039;s &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;img /&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; element when the page is rendered into HTML.&lt;br /&gt;
* &amp;lt;code&amp;gt;lang&amp;lt;/code&amp;gt; - adds a language attribute to specify what language to render the file in.&lt;br /&gt;
* &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; - specifies a start time for audio and video files.&lt;br /&gt;
* &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; - specifies an end time for audio and video files.&lt;br /&gt;
* &amp;lt;code&amp;gt;thumbtime&amp;lt;/code&amp;gt; - specifies the time to use to generate the thumbnail image for video files.&lt;br /&gt;
&lt;br /&gt;
To see the effect of each of these parameters, see the [[mw:Help:Images#Format|images help page on mediawiki.org]].&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
With the file only:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mFileLink.main{file = &amp;#039;Example.png&amp;#039;}&lt;br /&gt;
-- Renders as [[File:Example.png]]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With format, size, link and caption options:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mFileLink.main{&lt;br /&gt;
	file = &amp;#039;Example.png&amp;#039;,&lt;br /&gt;
	format = &amp;#039;thumb&amp;#039;,&lt;br /&gt;
	size = &amp;#039;220px&amp;#039;,&lt;br /&gt;
	link = &amp;#039;Wikipedia:Sandbox&amp;#039;,&lt;br /&gt;
	caption = &amp;#039;An example.&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
-- Renders as [[File:Example.png|thumb|220px|link=Wikipedia:Sandbox|An example.]]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With format, size, and border:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mFileLink.main{&lt;br /&gt;
	file = &amp;#039;Example.png&amp;#039;,&lt;br /&gt;
	format = &amp;#039;frameless&amp;#039;,&lt;br /&gt;
	size = &amp;#039;220px&amp;#039;,&lt;br /&gt;
	border = true&lt;br /&gt;
}&lt;br /&gt;
-- Renders as [[File:Example.png|frameless|border|220px]]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
&amp;lt;!-- Categories go here and interwikis go in Wikidata. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>zh&gt;Cewbot</name></author>
	</entry>
</feed>