X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cac9d1111f86a7ff6da2176e3069dec4484154d4..cc810d29fd64e1005dd7829640ea0fb9f4b638cd:/doc/Rakefile diff --git a/doc/Rakefile b/doc/Rakefile index ee87062f7e..89454940c7 100644 --- a/doc/Rakefile +++ b/doc/Rakefile @@ -8,6 +8,16 @@ # generating the documentation for the SDKs, which (the R docs # especially) take a fair bit of time and slow down the edit-preview # cycle. +# +# To generate and view the documentation locally, run this command +# +# rake && sensible-browser .site/index.html +# +# Or alternatively: +# +# baseurl=http://localhost:8000 rake && rake run +# +# and then visit http://localhost:8000 in a browser. require "rubygems" require "colorize" @@ -41,20 +51,22 @@ file ["install/new_cluster_checklist_Azure.xlsx", "install/new_cluster_checklist end file "sdk/python/arvados/index.html" do |t| - if ENV['NO_SDK'] || File.exists?("no-sdk") + if ENV['NO_SDK'] || File.exist?("no-sdk") next end `which pdoc` if $? == 0 - STDERR.puts `pdoc --html -o sdk/python ../sdk/python/arvados/ 2>&1` - raise if $? != 0 + raise unless system("python3", "setup.py", "build", + chdir: "../sdk/python", out: :err) + raise unless system("pdoc", "--html", "-o", "sdk/python", "../sdk/python/build/lib/arvados/", + out: :err) else puts "Warning: pdoc3 not found, Python documentation will not be generated".colorize(:light_red) end end file "sdk/R/arvados/index.html" do |t| - if ENV['NO_SDK'] || File.exists?("no-sdk") + if ENV['NO_SDK'] || File.exist?("no-sdk") next end `which R` @@ -66,7 +78,6 @@ file "sdk/R/arvados/index.html" do |t| cp('css/R.css', 'sdk/R/arvados') docfiles = [] Dir.chdir("../sdk/R/") do - STDERR.puts `Rscript createDoc.R README.Rmd #{tgt}/sdk/R/README.md 2>&1` Dir.entries("man").each do |rd| if rd[-3..-1] == ".Rd" htmlfile = "#{rd[0..-4]}.html" @@ -77,7 +88,7 @@ file "sdk/R/arvados/index.html" do |t| end raise if $? != 0 - File.open("sdk/R/README.md", "r") do |rd| + File.open("../sdk/R/README.md", "r") do |rd| File.open("sdk/R/index.html.md", "w") do |fn| fn.write(<<-EOF --- @@ -87,7 +98,7 @@ navmenu: R title: "R SDK Overview" ... -#{rd.read.gsub(/^```$/, "~~~").gsub(/^```(\w)$/, "~~~\\1")} +#{rd.read} EOF ) end @@ -121,7 +132,7 @@ EOF end file "sdk/java-v2/javadoc/index.html" do |t| - if ENV['NO_SDK'] || File.exists?("no-sdk") + if ENV['NO_SDK'] || File.exist?("no-sdk") next end `which java` @@ -150,7 +161,8 @@ task :linkchecker => [ :generate ] do Dir.chdir(".site") do `which linkchecker` if $? == 0 - system "linkchecker index.html --ignore-url='!file://'" or exit $?.exitstatus + # we need --check-extern to check relative links, weird but true + system "linkchecker index.html --check-extern --ignore-url='!file://'" or exit $?.exitstatus else puts "Warning: linkchecker not found, skipping run".colorize(:light_red) end