You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2017/08/28 18:00:17 UTC

[incubator-mxnet] branch master updated: Add script to build doc files for all versions (#7636)

This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new aceef5a  Add script to build doc files for all versions (#7636)
aceef5a is described below

commit aceef5abf3db968ee98333c1454a951dfbf07a43
Author: Yao Wang <ke...@gmail.com>
AuthorDate: Mon Aug 28 11:00:15 2017 -0700

    Add script to build doc files for all versions (#7636)
    
    * Add script to build doc files for all versions
    
    * Fix
    
    * Use add versipn script of each different version
---
 docs/build_version_doc/build_all_version.sh | 82 +++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/docs/build_version_doc/build_all_version.sh b/docs/build_version_doc/build_all_version.sh
new file mode 100755
index 0000000..140e51a
--- /dev/null
+++ b/docs/build_version_doc/build_all_version.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+# 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.
+
+# This script is for locally building website for all versions
+# Built files are stored in $built
+# Version numbers are stored in $tag_list.
+# Version numbers are ordered from latest to old and final one is master.
+tag_list="0.11.0.rc3 master"
+
+mxnet_url="https://github.com/apache/incubator-mxnet.git"
+mxnet_folder="apache_mxnet"
+built="VersionedWeb"
+mkdir $built
+mkdir "$built/versions"
+
+git clone $mxnet_url $mxnet_folder --recursive
+cd "$mxnet_folder/docs"
+tag_file="tag_list.txt"
+
+# Write all version numbers into $tag_file
+for tag in $tag_list; do
+    if [ $tag != 'master' ]
+    then
+        echo "$tag" >> "$tag_file"
+    fi
+done
+
+# Build all versions and use latest version(First version number in $tag_list) as landing page.
+version_num=0
+for tag in $tag_list; do
+    if [ $tag == 'master' ]
+    then
+        git checkout master
+    else
+        git checkout "tags/$tag"
+    fi
+
+    git submodule update || exit 1
+    cd ..
+    make clean
+    cd docs
+    make clean
+    make html USE_OPENMP=0 || exit 1
+    python build_version_doc/AddVersion.py --file_path "_build/html/" --current_version "$tag" || exit 1
+
+    if [ $tag != 'master' ]
+    then 
+        python build_version_doc/AddPackageLink.py --file_path "_build/html/get_started/install.html" \
+                                                   --current_version "$tag" || exit 1
+    fi
+
+    if [ $version_num == 0 ]
+    then
+        cp -a _build/html/. "../../$built"
+    else
+        file_loc="../../$built/versions/$tag"
+        mkdir "$file_loc"
+        cp -a _build/html/. "$file_loc"
+    fi
+
+    ((++version_num))
+done
+    
+mv "$tag_file" "../../$built/tag.txt"
+cd ../..
+rm -rf "$mxnet_folder"

-- 
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].