Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 
0003 #
0004 # Licensed to the Apache Software Foundation (ASF) under one or more
0005 # contributor license agreements.  See the NOTICE file distributed with
0006 # this work for additional information regarding copyright ownership.
0007 # The ASF licenses this file to You under the Apache License, Version 2.0
0008 # (the "License"); you may not use this file except in compliance with
0009 # the License.  You may obtain a copy of the License at
0010 #
0011 #    http://www.apache.org/licenses/LICENSE-2.0
0012 #
0013 # Unless required by applicable law or agreed to in writing, software
0014 # distributed under the License is distributed on an "AS IS" BASIS,
0015 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0016 # See the License for the specific language governing permissions and
0017 # limitations under the License.
0018 #
0019 
0020 # Script to create SQL API and config docs. This requires `mkdocs` and to build
0021 # Spark first. After running this script the html docs can be found in
0022 # $SPARK_HOME/sql/site
0023 
0024 set -o pipefail
0025 set -e
0026 
0027 FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
0028 SPARK_HOME="$(cd "`dirname "${BASH_SOURCE[0]}"`"/..; pwd)"
0029 
0030 if ! hash python 2>/dev/null; then
0031   echo "Missing python in your path, skipping SQL documentation generation."
0032   exit 0
0033 fi
0034 
0035 if ! hash mkdocs 2>/dev/null; then
0036   echo "Missing mkdocs in your path, trying to install mkdocs for SQL documentation generation."
0037   pip install mkdocs
0038 fi
0039 
0040 pushd "$FWDIR" > /dev/null
0041 
0042 rm -fr docs
0043 mkdir docs
0044 
0045 echo "Generating SQL API Markdown files."
0046 "$SPARK_HOME/bin/spark-submit" gen-sql-api-docs.py
0047 
0048 echo "Generating SQL configuration table HTML file."
0049 "$SPARK_HOME/bin/spark-submit" gen-sql-config-docs.py
0050 
0051 echo "Generating HTML files for SQL function table and examples."
0052 "$SPARK_HOME/bin/spark-submit" gen-sql-functions-docs.py
0053 
0054 echo "Generating HTML files for SQL API documentation."
0055 mkdocs build --clean
0056 rm -fr docs
0057 
0058 popd