From 2aa11d831401969a1c6052ece749ec4d56beb117 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Mon, 19 Dec 2016 05:19:48 +0000 Subject: [PATCH 1/2] [SPARK-API-DOC][DOC][BUILD] Support skipping R/Python API docs --- docs/_plugins/copy_api_dirs.rb | 49 +++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/docs/_plugins/copy_api_dirs.rb b/docs/_plugins/copy_api_dirs.rb index 71e643244ec28..95e3ba35e9027 100644 --- a/docs/_plugins/copy_api_dirs.rb +++ b/docs/_plugins/copy_api_dirs.rb @@ -113,36 +113,41 @@ File.open(css_file, 'a') { |f| f.write("\n" + css.join()) } end - # Build Sphinx docs for Python + if not (ENV['SKIP_PYTHONDOC'] == '1') + # Build Sphinx docs for Python - puts "Moving to python/docs directory and building sphinx." - cd("../python/docs") - system("make html") || raise("Python doc generation failed") + puts "Moving to python/docs directory and building sphinx." + cd("../python/docs") + system("make html") || raise("Python doc generation failed") - puts "Moving back into home dir." - cd("../../") + puts "Moving back into docs dir." + cd("../../docs") - puts "Making directory api/python" - mkdir_p "docs/api/python" + puts "Making directory api/python" + mkdir_p "api/python" - puts "cp -r python/docs/_build/html/. docs/api/python" - cp_r("python/docs/_build/html/.", "docs/api/python") + puts "cp -r ../python/docs/_build/html/. api/python" + cp_r("../python/docs/_build/html/.", "api/python") + end - # Build SparkR API docs - puts "Moving to R directory and building roxygen docs." - cd("R") - system("./create-docs.sh") || raise("R doc generation failed") + if not (ENV['SKIP_RDOC'] == '1') + # Build SparkR API docs - puts "Moving back into home dir." - cd("../") + puts "Moving to R directory and building roxygen docs." + cd("../R") + system("./create-docs.sh") || raise("R doc generation failed") - puts "Making directory api/R" - mkdir_p "docs/api/R" + puts "Moving back into docs dir." + cd("../docs") - puts "cp -r R/pkg/html/. docs/api/R" - cp_r("R/pkg/html/.", "docs/api/R") + puts "Making directory api/R" + mkdir_p "api/R" - puts "cp R/pkg/DESCRIPTION docs/api" - cp("R/pkg/DESCRIPTION", "docs/api") + puts "cp -r ../R/pkg/html/. api/R" + cp_r("../R/pkg/html/.", "api/R") + + puts "cp ../R/pkg/DESCRIPTION api" + cp("../R/pkg/DESCRIPTION", "api") + end end From 1419f7ce3c19c3f3f73425c4823a359e3dd026ce Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Tue, 20 Dec 2016 11:06:03 -0800 Subject: [PATCH 2/2] Add the description about skiping individual language in README.md. --- docs/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index ffd3b5712b618..90e10a104b517 100644 --- a/docs/README.md +++ b/docs/README.md @@ -69,4 +69,5 @@ may take some time as it generates all of the scaladoc. The jekyll plugin also PySpark docs using [Sphinx](http://sphinx-doc.org/). NOTE: To skip the step of building and copying over the Scala, Python, R API docs, run `SKIP_API=1 -jekyll`. +jekyll`. In addition, `SKIP_SCALADOC=1`, `SKIP_PYTHONDOC=1`, and `SKIP_RDOC=1` can be used to skip a single +step of the corresponding language.