Jump to content

User:Cky2250/Tools

This user is American by birth
This user has AutoWikiBrowser permissions on the English Wikipedia.
This user gives a helping hand to new editors at the Feedback Dashboard
This user has template editor rights on the English Wikipedia.
From Wikipedia, the free encyclopedia
   
   
   
   
   
   
   
   
   
 
                                   


[edit]

Subpage

Code snippets

[edit]
Process arguments keeping all values as-is
local p = {}

function p.main( frame )
    -- If called via #invoke, use the args passed into the invoking
    -- template, or the args passed to #invoke if any exist. Otherwise
    -- assume args are being passed directly in from the debug console
    -- or from another Lua module.
    local args
    if frame == mw.getCurrentFrame() then
        args = frame:getParent().args
        for k, v in pairs( frame.args ) do
            args = frame.args
            break
        end
    else
        args = frame
    end
    return _main( args )
end

return p
Process arguments removing whitespace and blank arguments
local p = {}

function p.main(frame)
	-- If called via #invoke, use the args passed into the invoking template, or the args passed to #invoke if any exist.
	-- Otherwise assume args are being passed directly in from the debug console or from another Lua module.
	local origArgs
	if frame == mw.getCurrentFrame() then
		origArgs = frame:getParent().args
		for k, v in pairs(frame.args) do
			origArgs = frame.args
			break
		end
	else
		origArgs = frame
	end
	-- Trim whitespace and remove blank arguments.
	local args = {}
	for k, v in pairs(origArgs) do
		if type(v) == 'string' then
			v = mw.text.trim(v)
		end
		if v ~= '' then
			args[k] = v
		end
	end
	return p._main(args)
end

return p

Tools

[edit]

Templates

[edit]

What I find useful

[edit]

Other

[edit]
Main tool page: toolserver.org
  • Reflinks - Edits bare references - adds title/dates etc. to bare references
  • Checklinks - Edit and repair external links
  • Dab solver - Quickly resolve ambiguous links.
  • Peer reviewer - Provides hints and suggestion to improving articles.

Admins

[edit]