summaryrefslogtreecommitdiffhomepage
path: root/tasks/doc.rake
blob: 11b76bb3fe8e788fe306c014157e9a1b068ff635 (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
41
42
43
44
45
46
47
48
desc 'generate document'
task :doc => [:api_doc, :capi_doc] do

end

desc 'generate yard docs'
task :api_doc do
  begin
    sh "mrbdoc"
  rescue
    puts "ERROR: To generate yard documentation, you should install yard-mruby gem."
    puts "  $ gem install yard-mruby yard-coderay"
  end
end

desc 'generate doxygen docs'
task :capi_doc do
  begin
    sh "doxygen Doxyfile"
  rescue
    puts "ERROR: To generate C API documents, you need Doxygen."
    puts "  $ sudo apt-get install doxygen"
  end
end

desc 'clean all built docs'
task :clean_api_doc do
  rm_rf 'doc/api'
end

desc 'clean all built docs'
task :clean_capi_doc do
  rm_rf 'doc/capi'
end

desc 'clean all built docs'
task :clean_doc => [:clean_api_doc, :clean_capi_doc] do
end

desc 'clean all built docs'
task :view_api => [:api_doc] do
  sh 'xdg-open doc/api/index.html'
end

desc 'clean all built docs'
task :view_capi => [:capi_doc] do
  sh 'xdg-open doc/capi/html/index.html'
end