diff options
| author | realtradam <[email protected]> | 2023-05-09 12:58:33 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-05-09 12:58:33 -0400 |
| commit | 0edab992ab6ee804c223e30ae9347b3072a750be (patch) | |
| tree | 310feb32cfad556f736af63cf978cc37b06cb821 /scan.rb | |
| parent | a4314fafa69cacaa247277b7da8a647c34c4ede3 (diff) | |
| download | RodeoKit-0edab992ab6ee804c223e30ae9347b3072a750be.tar.gz RodeoKit-0edab992ab6ee804c223e30ae9347b3072a750be.zip | |
add some documentation generation
Diffstat (limited to 'scan.rb')
| -rw-r--r-- | scan.rb | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -0,0 +1,44 @@ +require "rexml/document" + +class CodeModule + attr_accessor :title, :color, :files, :code + + def initialize(title:, files:, color:) + self.title = title + self.color = color + self.files = files + self.code = "" + end +end + +code_modules = [ + CodeModule.new(title: "Core", files: ['rodeo_8h.xml', 'common_8h.xml'], color: "stone"), + CodeModule.new(title: "Audio", files: ['audio_8h.xml'], color: "blue"), + CodeModule.new(title: "Input", files: ['input_8h.xml'], color: "red"), + CodeModule.new(title: "Log", files: ['log_8h.xml'], color: "yellow"), +] +code_modules.each_with_index do |mod, index| + mod.files.each do |file| + file = File.new("doxygen/xml/#{file}") + doc = REXML::Document.new file + root = doc.root + + defines = root.get_elements('//sectiondef').filter { |attr| attr.attributes['kind'] == "func" } + + defines.each do |func| + func.get_elements('//definition').each_with_index do |defi, i| + mod.code += "#{defi.text}#{func.get_elements('//argsstring')[i].text};\n" + end + end + end + File.write("./docs/#{index}#{mod.title.downcase}.html", + "--- +title: #{mod.title} +id: #{mod.title.downcase} +color: #{mod.color} +--- +{% highlight c %} +#{mod.code} +{% endhighlight %} +") +end |
