diff --git a/.travis.yml b/.travis.yml index ed566016ec6e0d30a0761356580114020ada66a0..9dd5f48164a3417940880f2b15bf7d9906453fb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,7 @@ script: export DEPLOY_DOCS_SH=https://raw.githubusercontent.com/PaddlePaddle/PaddlePaddle.org/master/scripts/deploy/deploy_docs.sh export DOCS_DIR=`pwd` cd .. - curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH $DOCS_DIR $DOCS_DIR/build/doc + curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH $DOCS_DIR $DOCS_DIR/build/doc/v2 notifications: email: on_success: change diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index cdd8de78cef63e14274db368755bbba44e8fb845..da67701ec1af57df742dce105990cffa40f45d7c 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,2 +1 @@ -add_subdirectory(api) add_subdirectory(v2) diff --git a/doc/v2/CMakeLists.txt b/doc/v2/CMakeLists.txt index 50714258f3057a99514d9b120f282190a7e66aae..286fe8845cd7a909d4030540e72362864b536063 100644 --- a/doc/v2/CMakeLists.txt +++ b/doc/v2/CMakeLists.txt @@ -47,3 +47,5 @@ sphinx_add_target(paddle_docs_cn ${SPHINX_CACHE_DIR_CN} ${CMAKE_CURRENT_SOURCE_DIR} ${SPHINX_HTML_DIR_CN}) + +add_subdirectory(api) diff --git a/doc/api/CMakeLists.txt b/doc/v2/api/CMakeLists.txt similarity index 90% rename from doc/api/CMakeLists.txt rename to doc/v2/api/CMakeLists.txt index 4e0bc1d5b8e799ef86cb92a0dda348b0be4e299a..2ad589e8a260e48d46cba2300d6e2bcd4bdd8019 100644 --- a/doc/api/CMakeLists.txt +++ b/doc/v2/api/CMakeLists.txt @@ -8,7 +8,7 @@ set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees") set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html") configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.en.in" + "${CMAKE_CURRENT_SOURCE_DIR}/../../templates/conf.py.en.in" "${BINARY_BUILD_DIR_EN}/conf.py" @ONLY) diff --git a/doc/api/v2/config/activation.rst b/doc/v2/api/config/activation.rst similarity index 100% rename from doc/api/v2/config/activation.rst rename to doc/v2/api/config/activation.rst diff --git a/doc/api/v2/config/attr.rst b/doc/v2/api/config/attr.rst similarity index 100% rename from doc/api/v2/config/attr.rst rename to doc/v2/api/config/attr.rst diff --git a/doc/api/v2/config/evaluators.rst b/doc/v2/api/config/evaluators.rst similarity index 100% rename from doc/api/v2/config/evaluators.rst rename to doc/v2/api/config/evaluators.rst diff --git a/doc/api/v2/config/layer.rst b/doc/v2/api/config/layer.rst similarity index 100% rename from doc/api/v2/config/layer.rst rename to doc/v2/api/config/layer.rst diff --git a/doc/api/v2/config/networks.rst b/doc/v2/api/config/networks.rst similarity index 100% rename from doc/api/v2/config/networks.rst rename to doc/v2/api/config/networks.rst diff --git a/doc/api/v2/config/optimizer.rst b/doc/v2/api/config/optimizer.rst similarity index 100% rename from doc/api/v2/config/optimizer.rst rename to doc/v2/api/config/optimizer.rst diff --git a/doc/api/v2/config/pooling.rst b/doc/v2/api/config/pooling.rst similarity index 100% rename from doc/api/v2/config/pooling.rst rename to doc/v2/api/config/pooling.rst diff --git a/doc/api/v2/data.rst b/doc/v2/api/data.rst similarity index 100% rename from doc/api/v2/data.rst rename to doc/v2/api/data.rst diff --git a/doc/api/v2/data/data_reader.rst b/doc/v2/api/data/data_reader.rst similarity index 100% rename from doc/api/v2/data/data_reader.rst rename to doc/v2/api/data/data_reader.rst diff --git a/doc/api/v2/data/dataset.rst b/doc/v2/api/data/dataset.rst similarity index 100% rename from doc/api/v2/data/dataset.rst rename to doc/v2/api/data/dataset.rst diff --git a/doc/api/v2/data/image.rst b/doc/v2/api/data/image.rst similarity index 100% rename from doc/api/v2/data/image.rst rename to doc/v2/api/data/image.rst diff --git a/doc/api/fluid/data_feeder.rst b/doc/v2/api/fluid/data_feeder.rst similarity index 100% rename from doc/api/fluid/data_feeder.rst rename to doc/v2/api/fluid/data_feeder.rst diff --git a/doc/api/fluid/evaluator.rst b/doc/v2/api/fluid/evaluator.rst similarity index 100% rename from doc/api/fluid/evaluator.rst rename to doc/v2/api/fluid/evaluator.rst diff --git a/doc/api/fluid/executor.rst b/doc/v2/api/fluid/executor.rst similarity index 100% rename from doc/api/fluid/executor.rst rename to doc/v2/api/fluid/executor.rst diff --git a/doc/api/fluid/gen_doc.py b/doc/v2/api/fluid/gen_doc.py similarity index 100% rename from doc/api/fluid/gen_doc.py rename to doc/v2/api/fluid/gen_doc.py diff --git a/doc/api/fluid/gen_doc.sh b/doc/v2/api/fluid/gen_doc.sh similarity index 100% rename from doc/api/fluid/gen_doc.sh rename to doc/v2/api/fluid/gen_doc.sh diff --git a/doc/api/fluid/index.rst b/doc/v2/api/fluid/index.rst similarity index 100% rename from doc/api/fluid/index.rst rename to doc/v2/api/fluid/index.rst diff --git a/doc/api/fluid/initializer.rst b/doc/v2/api/fluid/initializer.rst similarity index 100% rename from doc/api/fluid/initializer.rst rename to doc/v2/api/fluid/initializer.rst diff --git a/doc/api/fluid/io.rst b/doc/v2/api/fluid/io.rst similarity index 100% rename from doc/api/fluid/io.rst rename to doc/v2/api/fluid/io.rst diff --git a/doc/api/fluid/layers.rst b/doc/v2/api/fluid/layers.rst similarity index 100% rename from doc/api/fluid/layers.rst rename to doc/v2/api/fluid/layers.rst diff --git a/doc/api/fluid/nets.rst b/doc/v2/api/fluid/nets.rst similarity index 100% rename from doc/api/fluid/nets.rst rename to doc/v2/api/fluid/nets.rst diff --git a/doc/api/fluid/optimizer.rst b/doc/v2/api/fluid/optimizer.rst similarity index 100% rename from doc/api/fluid/optimizer.rst rename to doc/v2/api/fluid/optimizer.rst diff --git a/doc/api/fluid/param_attr.rst b/doc/v2/api/fluid/param_attr.rst similarity index 100% rename from doc/api/fluid/param_attr.rst rename to doc/v2/api/fluid/param_attr.rst diff --git a/doc/api/fluid/profiler.rst b/doc/v2/api/fluid/profiler.rst similarity index 100% rename from doc/api/fluid/profiler.rst rename to doc/v2/api/fluid/profiler.rst diff --git a/doc/api/fluid/regularizer.rst b/doc/v2/api/fluid/regularizer.rst similarity index 100% rename from doc/api/fluid/regularizer.rst rename to doc/v2/api/fluid/regularizer.rst diff --git a/doc/api/index_en.rst b/doc/v2/api/index_en.rst similarity index 55% rename from doc/api/index_en.rst rename to doc/v2/api/index_en.rst index fc8dbd07eba248942c03c2b609cfc8d8712ed0c7..b11cd449affd1dcd9d3f42492961469331350942 100644 --- a/doc/api/index_en.rst +++ b/doc/v2/api/index_en.rst @@ -5,7 +5,7 @@ API :maxdepth: 1 overview.rst - v2/model_configs.rst - v2/data.rst - v2/run_logic.rst + model_configs.rst + data.rst + run_logic.rst fluid/index.rst diff --git a/doc/api/v2/model_configs.rst b/doc/v2/api/model_configs.rst similarity index 100% rename from doc/api/v2/model_configs.rst rename to doc/v2/api/model_configs.rst diff --git a/doc/api/overview.rst b/doc/v2/api/overview.rst similarity index 100% rename from doc/api/overview.rst rename to doc/v2/api/overview.rst diff --git a/doc/api/v2/run_logic.rst b/doc/v2/api/run_logic.rst similarity index 100% rename from doc/api/v2/run_logic.rst rename to doc/v2/api/run_logic.rst diff --git a/paddle/scripts/travis/build_doc.sh b/paddle/scripts/travis/build_doc.sh index 70c821fad94b688536a38c7a5cd02b66de553155..c3892491725dc960375f3f2d8fdda7f39dc84d04 100755 --- a/paddle/scripts/travis/build_doc.sh +++ b/paddle/scripts/travis/build_doc.sh @@ -14,78 +14,4 @@ make -j `nproc` paddle_docs paddle_docs_cn paddle_api_docs # check websites for broken links linkchecker doc/v2/en/html/index.html linkchecker doc/v2/cn/html/index.html -linkchecker doc/api/en/html/index.html - -# Parse Github URL -REPO=`git config remote.origin.url` -SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} -SHA=`git rev-parse --verify HEAD` - -# Documentation branch name -# gh-pages branch is used for PaddlePaddle.org. The English version of -# documentation in `doc` directory, and the chinese version in `doc_cn` -# directory. -TARGET_BRANCH="gh-pages" - -# Only deploy master branch to build latest documentation. -SOURCE_BRANCH="master" - -# Clone the repo to output directory -mkdir output -git clone $REPO output -cd output - -function deploy_docs() { - SOURCE_BRANCH=$1 - DIR=$2 - # If is not a Github pull request - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - exit 0 - fi - # If it is not watched branch. - if [ "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then - return - fi - - # checkout github page branch - git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH - - mkdir -p ${DIR} - # remove old docs. mv new docs. - set +e - rm -rf ${DIR}/doc ${DIR}/doc_cn ${DIR}/api_doc - set -e - cp -r ../doc/v2/cn/html ${DIR}/doc_cn - cp -r ../doc/v2/en/html ${DIR}/doc - cp -r ../doc/api/en/html ${DIR}/api_doc - git add . -} - -deploy_docs "master" "." -deploy_docs "develop" "./develop/" - -# Check is there anything changed. -set +e -git diff --cached --exit-code >/dev/null -if [ $? -eq 0 ]; then - echo "No changes to the output on this push; exiting." - exit 0 -fi -set -e - -if [ -n $SSL_KEY ]; then # Only push updated docs for github.com/PaddlePaddle/Paddle. - # Commit - git add . - git config user.name "Travis CI" - git config user.email "paddle-dev@baidu.com" - git commit -m "Deploy to GitHub Pages: ${SHA}" - # Set ssh private key - openssl aes-256-cbc -K $SSL_KEY -iv $SSL_IV -in ../../paddle/scripts/travis/deploy_key.enc -out deploy_key -d - chmod 600 deploy_key - eval `ssh-agent -s` - ssh-add deploy_key - - # Push - git push $SSH_REPO $TARGET_BRANCH - -fi +linkchecker doc/v2/api/en/html/index.html