Difference between revisions of "Module:Extension"

From WPRDC Wiki
Jump to navigation Jump to search
>Ricordisamoa
(No difference)

Revision as of 22:40, 26 October 2014

Documentation for this module may be created at Module:Extension/doc

local p = {}

local addr = {
	GNU = '//www.gnu.org/',
	CC  = '//creativecommons.org/licenses/'
}
local cats = {
	GPL = 'GPL licensed extensions',
	CC  = 'Creative Commons licensed extensions'
}
local licenses = {
	['GPL']    = { '[' .. addr.GNU .. 'copyleft/gpl.html GNU General Public License]', cats.GPL },
	['GPL2']   = { '[' .. addr.GNU .. 'licenses/gpl-2.0.html GNU General Public License 2.0]', cats.GPL },
	['GPL2+']  = { '[' .. addr.GNU .. 'licenses/gpl-2.0.html GNU General Public License 2.0] or later', cats.GPL },
	['GPL3']   = { '[' .. addr.GNU .. 'licenses/gpl-3.0.html GNU General Public License 3.0]', cats.GPL },
	['GPL3+']  = { '[' .. addr.GNU .. 'licenses/gpl-3.0.html GNU General Public License 3.0] or later', cats.GPL },
	['AGPL3+'] = { '[' .. addr.GNU .. 'licenses/agpl-3.0.html GNU Affero General Public License 3.0] or later', cats.GPL },
	['LGPL']   = { '[' .. addr.GNU .. 'copyleft/lesser.html GNU Lesser General Public License]' },
	['LGPL3']  = { '[' .. addr.GNU .. 'licenses/lgpl-3.0.html GNU Lesser General Public License 3.0]' },
	['FDL']    = { '[' .. addr.GNU .. 'licenses/fdl.html GNU Free Documentation License]' }
}

-- work in progress
function p.license_url( frame )
	return licenses[frame.args[1]][1]
end

return p