summaryrefslogtreecommitdiff
path: root/tools/list_scripts.lua
blob: d51ab6cd2ef434f4713595183203fcbe02500694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/lua5.3

top = arg[1] or "./"

function scripts ()
	local out = io.popen (
		string.format ("find '%s' -maxdepth 1 -type f -iname \"[^_]*.lua\" 2>/dev/null | grep -v '/s_'", top .. "share/scripts/")
	)
	return function()
		for file in out:lines() do
			return file
		end 
		return nil
	end
end

function list_script_types (h, t)
	function ardour (v)
		if v['type'] == t then
			local desc = string.gsub (v['description'], "\n", " ")
			desc = string.gsub (desc, "\t", " ")
			desc = string.gsub (desc, "  *", " ")
			desc = string.gsub (desc, " $", "")
			print ("<dt>" .. v['name'] .. "<dt><dd>" .. desc .. "</dd>")
		end
	end

	print ("<h2>" .. h .. "</h2>")
	print ("<dl>")
	for script in scripts () do
		loadfile (script)()
	end
	print ("</dl>")
end

list_script_types ("DSP Plugins", "dsp")
list_script_types ("Editor Actions", "EditorAction")
list_script_types ("Editor Callbacks", "EditorHook")
list_script_types ("Session Wide Realtime", "session")
list_script_types ("Session Templates", "SessionInit")