aboutsummaryrefslogtreecommitdiff
path: root/docs/_plugins/copy_api_dirs.rb
diff options
context:
space:
mode:
authorAndy Konwinski <andyk@berkeley.edu>2012-09-13 16:52:53 -0700
committerAndy Konwinski <andyk@berkeley.edu>2012-09-13 17:17:58 -0700
commit6765d9727e6e374a8fc6a361c43e3ddc5c8e12db (patch)
treeadb1a8b749c2cb856f66ca78aa23026899069754 /docs/_plugins/copy_api_dirs.rb
parent462cd8be60bcd78180a31641b20c6d313e91f56d (diff)
downloadspark-6765d9727e6e374a8fc6a361c43e3ddc5c8e12db.tar.gz
spark-6765d9727e6e374a8fc6a361c43e3ddc5c8e12db.tar.bz2
spark-6765d9727e6e374a8fc6a361c43e3ddc5c8e12db.zip
Adds a jekyll plugin (written in Ruby) to the _plugins directory
which generates scala doc by calling `sbt/sbt doc`, copies it over to docs, and updates the links from the api webpage to now point to the copied over scaladoc (making the _site directory easy to just copy over to a public website).
Diffstat (limited to 'docs/_plugins/copy_api_dirs.rb')
-rw-r--r--docs/_plugins/copy_api_dirs.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/_plugins/copy_api_dirs.rb b/docs/_plugins/copy_api_dirs.rb
new file mode 100644
index 0000000000..84f5e59fde
--- /dev/null
+++ b/docs/_plugins/copy_api_dirs.rb
@@ -0,0 +1,28 @@
+require 'fileutils'
+include FileUtils
+
+projects = ["core", "examples", "repl", "bagel"]
+
+puts "Moving to project root and building scaladoc."
+curr_dir = pwd
+cd("..")
+
+puts "Running sbt/sbt doc from " + pwd + "; this may take a few minutes..."
+puts `sbt/sbt doc`
+
+puts "moving back into docs dir."
+cd("docs")
+
+# Copy over the scaladoc from each project into the docs directory.
+# This directory will be copied over to _site when `jekyll` command is run.
+projects.each do |project_name|
+ source = "../" + project_name + "/target/scala-2.9.1/api"
+ dest = "api/" + project_name
+
+ puts "echo making directory " + dest
+ mkdir_p dest
+
+ # From the rubydoc: cp_r('src', 'dest') makes src/dest, but this doesn't.
+ puts "cp -r " + source + "/. " + dest
+ cp_r(source + "/.", dest)
+end