summaryrefslogtreecommitdiffhomepage
path: root/tasks/doc.rake
diff options
context:
space:
mode:
authorHiroshi Mimaki <[email protected]>2019-10-18 14:46:03 +0900
committerHiroshi Mimaki <[email protected]>2019-10-18 14:46:03 +0900
commitb6546835457d1935a9c77965686b2a1256874d96 (patch)
tree724cfd71a7c956b0648e8c58f3717d797fff5f29 /tasks/doc.rake
parent8ee516436b8d174a50764939bee23a442aa00b3f (diff)
parent20d01f118ddb7e7f2f36926a7a3db35573611857 (diff)
downloadmruby-b6546835457d1935a9c77965686b2a1256874d96.tar.gz
mruby-b6546835457d1935a9c77965686b2a1256874d96.zip
Merge master.
Diffstat (limited to 'tasks/doc.rake')
-rw-r--r--tasks/doc.rake48
1 files changed, 48 insertions, 0 deletions
diff --git a/tasks/doc.rake b/tasks/doc.rake
new file mode 100644
index 000000000..4aec2d0a1
--- /dev/null
+++ b/tasks/doc.rake
@@ -0,0 +1,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
+ FileUtils.rm_rf 'doc/api'
+end
+
+desc 'clean all built docs'
+task :clean_capi_doc do
+ FileUtils.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