798ed22c28
Retire Epydoc, use Sphinx to generate API docs. Refine Sphinx docs, also convert some docstrings into Sphinx style. It looks like: ![api doc](https://cloud.githubusercontent.com/assets/40902/4538272/9e2d4f10-4dec-11e4-8d96-6e45a8fe51f9.png) Author: Davies Liu <davies.liu@gmail.com> Closes #2689 from davies/docs and squashes the following commits: bf4a0a5 [Davies Liu] fix links 3fb1572 [Davies Liu] fix _static in jekyll 65a287e [Davies Liu] fix scripts and logo 8524042 [Davies Liu] Merge branch 'master' of github.com:apache/spark into docs d5b874a [Davies Liu] Merge branch 'master' of github.com:apache/spark into docs 4bc1c3c [Davies Liu] refactor 746d0b6 [Davies Liu] @param -> :param 240b393 [Davies Liu] replace epydoc with sphinx doc
83 lines
2.5 KiB
Ruby
83 lines
2.5 KiB
Ruby
#
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
# this work for additional information regarding copyright ownership.
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
# (the "License"); you may not use this file except in compliance with
|
|
# the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
require 'fileutils'
|
|
include FileUtils
|
|
|
|
if not (ENV['SKIP_API'] == '1' or ENV['SKIP_SCALADOC'] == '1')
|
|
# Build Scaladoc for Java/Scala
|
|
|
|
puts "Moving to project root and building API docs."
|
|
curr_dir = pwd
|
|
cd("..")
|
|
|
|
puts "Running 'sbt/sbt -Pkinesis-asl compile unidoc' from " + pwd + "; this may take a few minutes..."
|
|
puts `sbt/sbt -Pkinesis-asl compile unidoc`
|
|
|
|
puts "Moving back into docs dir."
|
|
cd("docs")
|
|
|
|
# Copy over the unified ScalaDoc for all projects to api/scala.
|
|
# This directory will be copied over to _site when `jekyll` command is run.
|
|
source = "../target/scala-2.10/unidoc"
|
|
dest = "api/scala"
|
|
|
|
puts "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)
|
|
|
|
# Append custom JavaScript
|
|
js = File.readlines("./js/api-docs.js")
|
|
js_file = dest + "/lib/template.js"
|
|
File.open(js_file, 'a') { |f| f.write("\n" + js.join()) }
|
|
|
|
# Append custom CSS
|
|
css = File.readlines("./css/api-docs.css")
|
|
css_file = dest + "/lib/template.css"
|
|
File.open(css_file, 'a') { |f| f.write("\n" + css.join()) }
|
|
|
|
# Copy over the unified JavaDoc for all projects to api/java.
|
|
source = "../target/javaunidoc"
|
|
dest = "api/java"
|
|
|
|
puts "Making directory " + dest
|
|
mkdir_p dest
|
|
|
|
puts "cp -r " + source + "/. " + dest
|
|
cp_r(source + "/.", dest)
|
|
|
|
# Build Sphinx docs for Python
|
|
|
|
puts "Moving to python/docs directory and building sphinx."
|
|
cd("../python/docs")
|
|
puts `make html`
|
|
|
|
puts "Moving back into home dir."
|
|
cd("../../")
|
|
|
|
puts "Making directory api/python"
|
|
mkdir_p "docs/api/python"
|
|
|
|
puts "cp -r python/docs/_build/html/. docs/api/python"
|
|
cp_r("python/docs/_build/html/.", "docs/api/python")
|
|
|
|
cd("..")
|
|
end
|