X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b54a5ea817d3d2087eaa07dcf98ec8a82af56d06..15c86f88f1f5124c082e77dedd0b97c5efc93388:/doc/Rakefile diff --git a/doc/Rakefile b/doc/Rakefile index 2ebd27228f..811ca67c2c 100644 --- a/doc/Rakefile +++ b/doc/Rakefile @@ -1,18 +1,45 @@ #!/usr/bin/env rake require "rubygems" -Rake.application.rake_require "zenweb/tasks" -load "zenweb-textile.rb" -load "zenweb-liquid.rb" +require "colorize" -file ".site/sdk/python/arvados/index.html" do |t| - sh "epydoc --html -o sdk/python/arvados arvados" - Dir["sdk/python/arvados/*"].each do |f| - puts f - $website.pages[f] = Zenweb::Page.new($website, f) +task :generate => [ :realclean, 'sdk/python/arvados/index.html' ] do + vars = ['baseurl', 'arvados_api_host', 'arvados_workbench_host'] + vars.each do |v| + if ENV[v] + website.config.h[v] = ENV[v] + end end end +file "sdk/python/arvados/index.html" do |t| + `which epydoc` + if $? == 0 + `epydoc --html --parse-only -o sdk/python/arvados ../sdk/python/arvados/` + else + puts "Warning: epydoc not found, Python documentation will not be generated".colorize(:light_red) + end +end + +task :linkchecker => [ :generate ] do + Dir.chdir(".site") do + `which linkchecker` + if $? == 0 + system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus + else + puts "Warning: linkchecker not found, skipping run".colorize(:light_red) + end + end +end + +task :clean do + rm_rf "sdk/python/arvados" +end + +require "zenweb/tasks" +load "zenweb-textile.rb" +load "zenweb-liquid.rb" + task :extra_wirings do - $website.pages["sdk/python/python.html.textile.liquid"].depends_on(".site/sdk/python/arvados/index.html") + $website.pages["sdk/python/python.html.textile.liquid"].depends_on("sdk/python/arvados/index.html") end