Module:File/doc: Difference between revisions
From Neodyland Wiki
More actions
←Created page with '{{Mdl}}' |
m usage etc. |
||
| Line 1: | Line 1: | ||
{{ | == Scope == | ||
File title and file information. If the code here grows beyond a border line, this should be converted to an interface and the processing code should be outsourced. | |||
== Usage == | |||
=== From Wikitext === | |||
Search ({{key press|Ctrl|F}}) for <code>@exports</code>. | |||
:Example: <code><nowiki>{{#invoke:File|extension|file=File:Test.jpg}}</nowiki></code> → <code>{{#invoke:File|extension|file=File:Test.jpg}}</code> | |||
=== From Lua === | |||
<source lang="Lua"> | |||
local file = require('Module:File') | |||
local fileObj = file.File("Foo.bar.svg") | |||
local withoutExtension = fileObj.woExtension() | |||
</source> | |||
Revision as of 18:49, 20 December 2013
Scope
File title and file information. If the code here grows beyond a border line, this should be converted to an interface and the processing code should be outsourced.
Usage
From Wikitext
Search (Template:Key press) for @exports.
- Example:
{{#invoke:File|extension|file=File:Test.jpg}}→jpg
From Lua
local file = require('Module:File')
local fileObj = file.File("Foo.bar.svg")
local withoutExtension = fileObj.woExtension()