Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 23:47, 3 December 2013 by commons>Bawolff (quick little lua thing)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Module documentation[ create · purge ]
This documentation is transcluded from Module:FileName/doc.
-- Quick experiment with lua
-- Module for removing the extension from a file name (Should this or something like it be part of module:File?)
local p = {}
p.removeExtension = function(frame)
	local parts = mw.text.split( frame.args[1] or frame.args["file"] or frame.args["title"] or mw.title.getCurrentTitle().text, '.', true )
        local upTo = #parts - 1
        if (upTo) == 0 then
	        upTo = 1
        end
        return table.concat( parts, '.', 1, upTo )
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.