18075: Note obsolete/deprecated config.
[arvados.git] / doc / Rakefile
index 3717f9f5f1d429568b748ff7e0ca1e558585a00e..1390aa0e9c0ca7dd9f3bf14772c037686db8ff3f 100644 (file)
@@ -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"
@@ -66,7 +76,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 +86,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 +96,7 @@ navmenu: R
 title: "R SDK Overview"
 ...
 
-#{rd.read.gsub(/^```$/, "~~~").gsub(/^```(\w)$/, "~~~\\1")}
+#{rd.read}
 EOF
               )
       end
@@ -150,13 +159,45 @@ 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
   end
 end
 
+task :import_vscode_training do
+  Dir.chdir("user") do
+  rm_rf "arvados-vscode-cwl-training"
+  `git clone https://github.com/arvados/arvados-vscode-cwl-training`
+  githash = `git --git-dir arvados-vscode-cwl-training/.git log -n1 --format=%H HEAD`
+  File.open("cwl/arvados-vscode-training.html.md.liquid", "w") do |fn|
+    File.open("arvados-vscode-cwl-training/README.md", "r") do |rd|
+      fn.write(<<-EOF
+---
+layout: default
+navsection: userguide
+title: "Developing CWL Workflows with VSCode"
+...
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+
+Imported from https://github.com/arvados/arvados-vscode-cwl-training
+git hash: #{githash}
+{% endcomment %}
+
+EOF
+              )
+               fn.write(rd.read())
+    end
+  end
+  rm_rf "arvados-vscode-cwl-training"
+  end
+end
+
 task :clean do
   rm_rf "sdk/python/arvados"
   rm_rf "sdk/R"