Template:Clean image/doc: Difference between revisions
Jump to navigation
Jump to search
Created page with "{{Documentation}} Cleans and formats an input image. This removes the following things if present: * <code><nowiki>[[File:</nowiki></code> * <code><nowiki>]]</nowiki></code> *..." |
mNo edit summary |
||
| Line 59: | Line 59: | ||
|- | |- | ||
| Clean + link | | Clean + link | ||
| <pre>{{clean image|file={{{image}}}|link= | | <pre>{{clean image|file={{{image}}}|link=Earth}}</pre> | ||
| {{clean image|file=[[File:Earth Icon.png|100px|link=Earth]]|link= | | {{clean image|file=[[File:Earth Icon.png|100px|link=Earth]]|link=Earth}} | ||
| Should result in | | Should result in | ||
<pre>[[File:{FILENAME}|link={LINK}]]</pre> | <pre>[[File:{FILENAME}|link={LINK}]]</pre> | ||
Latest revision as of 06:22, 2 June 2020
Template:Clean image invokes function main in Module:Clean image using Lua.
Cleans and formats an input image. This removes the following things if present:
[[File:]]|and{{!}}, and everything following the first of these until the end
Then it re-packages the image into a new file container, with specified height, width, and link. The frameless modifier is used, which prevents the image being resized larger than its actual dimensions.
Usage
{{clean image
|file = wikitext to be cleaned; this should usually be a template parameter (e.g. |file={{{image}}}); required
|width = width of image; no default; exclude 'px'
|height = height of image; no default; exclude 'px'; can be combined with width
|link = link to apply to image; no default (will link to file page); setting to no will suppress normal link
}}
Examples
To be practical the results will be as if |image=[[File:Earth Icon.png|100px|link=Earth]] as the input.
