[go: nahoru, domu]

Jump to content

Module:Sandbox/Jothefiredragon/Foss

From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Izno (talk | contribs) at 21:55, 13 September 2024 (Izno moved page Module:Foss to Module:Sandbox/Jothefiredragon/Foss without leaving a redirect: G7/Wikipedia:Templates_for_discussion/Log/2024_September_10#Module:Foss). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-- still testing
local p = {}

local pre = "[[Category:"
local suf = "]]"
local fos = "free and open-source"

-- array of categories with “free” in its name to be replaced with “free and open-source”
local cat = {}
cat["emulation software"] = fos .. "emulation software"
cat["game engines"] = fos .. "game engines"

function p.category(frame)
	kstring = ""
	vstring = ""
	for k, v in pairs(frame.args) do
		for g, h in pairs(cat) do
		    if string.lower(v) == g then
		    	vstring = vstring .. pre .. h .. suf
		    end
		end
	end
	return vstring
end

return p