6 $repo = Mlt::Factory::init
17 template = %q{%%META:TOPICPARENT{name="Plugins<%= type_title %>s"}%
19 ---+ <%= type_title %>: <%= yml['identifier'] %>
21 ---++ Plugin Information
22 title: <%= yml['title'] %> %BR%
25 % yml['tags'].each do |x|
30 description: <%= yml['description'] %> %BR%
31 version: <%= yml['version'] %> %BR%
32 creator: <%= yml['creator'] %> %BR%
33 % yml['contributor'] and yml['contributor'].each do |x|
34 contributor: <%= x %> %BR%
36 <%= "license: #{yml['license']} %BR%\n" if yml['license'] %>
37 <%= "URL: [[#{yml['url']}]] %BR%\n" if yml['url'] %>
41 % yml['notes'].each do |x|
48 % yml['bugs'].each do |x|
53 % if yml['parameters']
55 % yml['parameters'].each do |param|
56 ---+++ <%= param['identifier'] %>
57 <%= "title: #{param['title']} %BR%\n" if param['title'] %>
58 <%= "description: #{param['description']} %BR%\n" if param['description'] %>
59 type: <%= param['type'] %> %BR%
60 readonly: <%= param['readonly'] or 'no' %> %BR%
61 required: <%= param['required'] or 'no' %> %BR%
62 % $optional_params.each do |key|
63 <%= "#{key}: #{param[key]} %BR%\n" if param[key] %>
67 % param['values'].each do |value|
77 $processor = ERB.new(template, 0, "%<>")
80 def output(mlt_type, services, type_title)
81 index = File.open("Plugins#{type_title}s.txt", 'w')
82 index.puts '%META:TOPICPARENT{name="Documentation"}%'
83 index.puts '<noautolink>'
84 index.puts "---+ #{type_title} Plugins"
86 (0..(services.count - 1)).each do |i|
87 unsorted << services.get_name(i)
89 unsorted.sort().each do |name|
90 meta = $repo.metadata(mlt_type, name)
92 filename = type_title + name.capitalize.gsub('.', '-')
93 puts "Processing #{filename}"
95 yml = YAML.load(meta.serialise_yaml)
97 File.open(filename + '.txt', 'w') do |f|
98 f.puts $processor.result(binding)
101 puts "Failed to write file for #{filename}"
103 index.puts " * [[#{filename}][#{name}]]: #{meta.get('title')}\n"
105 puts "Failed to parse YAML for #{filename}"
109 index.puts '</noautolink>'
114 [Mlt::Consumer_type, $repo.consumers, 'Consumer'],
115 [Mlt::Filter_type, $repo.filters, 'Filter'],
116 [Mlt::Producer_type, $repo.producers, 'Producer'],
117 [Mlt::Transition_type, $repo.transitions, 'Transition']
118 ].each {|x| output *x}