From 912a573603a2fcc41d447cd6937351caae8cdefe Mon Sep 17 00:00:00 2001 From: weixing02 <564445201@qq.com> Date: Fri, 30 Mar 2018 15:40:44 +0800 Subject: [PATCH] Move v2/api/fluid to fluid/api and Adjust doc build commands --- doc/CMakeLists.txt | 7 +++++++ doc/fluid/CMakeLists.txt | 2 ++ doc/fluid/api/CMakeLists.txt | 20 +++++++++++++++++++ .../api/fluid => fluid/api}/data_feeder.rst | 0 doc/{v2/api/fluid => fluid/api}/evaluator.rst | 0 doc/{v2/api/fluid => fluid/api}/executor.rst | 0 doc/{v2/api/fluid => fluid/api}/gen_doc.py | 0 doc/{v2/api/fluid => fluid/api}/gen_doc.sh | 0 .../index.rst => fluid/api/index_en.rst} | 0 .../api/fluid => fluid/api}/initializer.rst | 0 doc/{v2/api/fluid => fluid/api}/io.rst | 0 doc/{v2/api/fluid => fluid/api}/layers.rst | 0 doc/{v2/api/fluid => fluid/api}/nets.rst | 0 doc/{v2/api/fluid => fluid/api}/optimizer.rst | 0 .../api/fluid => fluid/api}/param_attr.rst | 0 doc/{v2/api/fluid => fluid/api}/profiler.rst | 0 .../api/fluid => fluid/api}/regularizer.rst | 0 doc/v2/CMakeLists.txt | 4 ++-- doc/v2/api/CMakeLists.txt | 2 +- paddle/scripts/travis/build_doc.sh | 2 +- 20 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 doc/fluid/api/CMakeLists.txt rename doc/{v2/api/fluid => fluid/api}/data_feeder.rst (100%) rename doc/{v2/api/fluid => fluid/api}/evaluator.rst (100%) rename doc/{v2/api/fluid => fluid/api}/executor.rst (100%) rename doc/{v2/api/fluid => fluid/api}/gen_doc.py (100%) rename doc/{v2/api/fluid => fluid/api}/gen_doc.sh (100%) rename doc/{v2/api/fluid/index.rst => fluid/api/index_en.rst} (100%) rename doc/{v2/api/fluid => fluid/api}/initializer.rst (100%) rename doc/{v2/api/fluid => fluid/api}/io.rst (100%) rename doc/{v2/api/fluid => fluid/api}/layers.rst (100%) rename doc/{v2/api/fluid => fluid/api}/nets.rst (100%) rename doc/{v2/api/fluid => fluid/api}/optimizer.rst (100%) rename doc/{v2/api/fluid => fluid/api}/param_attr.rst (100%) rename doc/{v2/api/fluid => fluid/api}/profiler.rst (100%) rename doc/{v2/api/fluid => fluid/api}/regularizer.rst (100%) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index a9b27933a53..7066637a7cb 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,2 +1,9 @@ +add_custom_target(paddle_apis ALL + DEPENDS paddle_v2_apis paddle_fluid_apis) + +add_custom_target(paddle_docs ALL + DEPENDS paddle_v2_docs paddle_v2_docs_cn + paddle_fluid_docs paddle_fluid_docs_cn) + add_subdirectory(v2) add_subdirectory(fluid) diff --git a/doc/fluid/CMakeLists.txt b/doc/fluid/CMakeLists.txt index cc999f5a8d7..fbf654ada86 100644 --- a/doc/fluid/CMakeLists.txt +++ b/doc/fluid/CMakeLists.txt @@ -47,3 +47,5 @@ sphinx_add_target(paddle_fluid_docs_cn ${SPHINX_CACHE_DIR_CN} ${CMAKE_CURRENT_SOURCE_DIR} ${SPHINX_HTML_DIR_CN}) + +add_subdirectory(api) diff --git a/doc/fluid/api/CMakeLists.txt b/doc/fluid/api/CMakeLists.txt new file mode 100644 index 00000000000..1627b963f38 --- /dev/null +++ b/doc/fluid/api/CMakeLists.txt @@ -0,0 +1,20 @@ +# configured documentation tools and intermediate build results +set(BINARY_BUILD_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_build") + +# Sphinx cache with pickled ReST documents +set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees") + +# HTML output director +set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html") + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/../../templates/conf.py.en.in" + "${BINARY_BUILD_DIR_EN}/conf.py" + @ONLY) + +sphinx_add_target(paddle_fluid_apis + html + ${BINARY_BUILD_DIR_EN} + ${SPHINX_CACHE_DIR_EN} + ${CMAKE_CURRENT_SOURCE_DIR} + ${SPHINX_HTML_DIR_EN}) diff --git a/doc/v2/api/fluid/data_feeder.rst b/doc/fluid/api/data_feeder.rst similarity index 100% rename from doc/v2/api/fluid/data_feeder.rst rename to doc/fluid/api/data_feeder.rst diff --git a/doc/v2/api/fluid/evaluator.rst b/doc/fluid/api/evaluator.rst similarity index 100% rename from doc/v2/api/fluid/evaluator.rst rename to doc/fluid/api/evaluator.rst diff --git a/doc/v2/api/fluid/executor.rst b/doc/fluid/api/executor.rst similarity index 100% rename from doc/v2/api/fluid/executor.rst rename to doc/fluid/api/executor.rst diff --git a/doc/v2/api/fluid/gen_doc.py b/doc/fluid/api/gen_doc.py similarity index 100% rename from doc/v2/api/fluid/gen_doc.py rename to doc/fluid/api/gen_doc.py diff --git a/doc/v2/api/fluid/gen_doc.sh b/doc/fluid/api/gen_doc.sh similarity index 100% rename from doc/v2/api/fluid/gen_doc.sh rename to doc/fluid/api/gen_doc.sh diff --git a/doc/v2/api/fluid/index.rst b/doc/fluid/api/index_en.rst similarity index 100% rename from doc/v2/api/fluid/index.rst rename to doc/fluid/api/index_en.rst diff --git a/doc/v2/api/fluid/initializer.rst b/doc/fluid/api/initializer.rst similarity index 100% rename from doc/v2/api/fluid/initializer.rst rename to doc/fluid/api/initializer.rst diff --git a/doc/v2/api/fluid/io.rst b/doc/fluid/api/io.rst similarity index 100% rename from doc/v2/api/fluid/io.rst rename to doc/fluid/api/io.rst diff --git a/doc/v2/api/fluid/layers.rst b/doc/fluid/api/layers.rst similarity index 100% rename from doc/v2/api/fluid/layers.rst rename to doc/fluid/api/layers.rst diff --git a/doc/v2/api/fluid/nets.rst b/doc/fluid/api/nets.rst similarity index 100% rename from doc/v2/api/fluid/nets.rst rename to doc/fluid/api/nets.rst diff --git a/doc/v2/api/fluid/optimizer.rst b/doc/fluid/api/optimizer.rst similarity index 100% rename from doc/v2/api/fluid/optimizer.rst rename to doc/fluid/api/optimizer.rst diff --git a/doc/v2/api/fluid/param_attr.rst b/doc/fluid/api/param_attr.rst similarity index 100% rename from doc/v2/api/fluid/param_attr.rst rename to doc/fluid/api/param_attr.rst diff --git a/doc/v2/api/fluid/profiler.rst b/doc/fluid/api/profiler.rst similarity index 100% rename from doc/v2/api/fluid/profiler.rst rename to doc/fluid/api/profiler.rst diff --git a/doc/v2/api/fluid/regularizer.rst b/doc/fluid/api/regularizer.rst similarity index 100% rename from doc/v2/api/fluid/regularizer.rst rename to doc/fluid/api/regularizer.rst diff --git a/doc/v2/CMakeLists.txt b/doc/v2/CMakeLists.txt index 286fe8845cd..48c9cf73277 100644 --- a/doc/v2/CMakeLists.txt +++ b/doc/v2/CMakeLists.txt @@ -20,7 +20,7 @@ configure_file( "${BINARY_BUILD_DIR_EN}/conf.py" @ONLY) -sphinx_add_target(paddle_docs +sphinx_add_target(paddle_v2_docs html ${BINARY_BUILD_DIR_EN} ${SPHINX_CACHE_DIR_EN} @@ -41,7 +41,7 @@ configure_file( "${BINARY_BUILD_DIR_CN}/conf.py" @ONLY) -sphinx_add_target(paddle_docs_cn +sphinx_add_target(paddle_v2_docs_cn html ${BINARY_BUILD_DIR_CN} ${SPHINX_CACHE_DIR_CN} diff --git a/doc/v2/api/CMakeLists.txt b/doc/v2/api/CMakeLists.txt index 2ad589e8a26..a265a1b6f3a 100644 --- a/doc/v2/api/CMakeLists.txt +++ b/doc/v2/api/CMakeLists.txt @@ -12,7 +12,7 @@ configure_file( "${BINARY_BUILD_DIR_EN}/conf.py" @ONLY) -sphinx_add_target(paddle_api_docs +sphinx_add_target(paddle_v2_apis html ${BINARY_BUILD_DIR_EN} ${SPHINX_CACHE_DIR_EN} diff --git a/paddle/scripts/travis/build_doc.sh b/paddle/scripts/travis/build_doc.sh index c3892491725..09496e4de13 100755 --- a/paddle/scripts/travis/build_doc.sh +++ b/paddle/scripts/travis/build_doc.sh @@ -9,7 +9,7 @@ cd $TRAVIS_BUILD_DIR/build cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_GPU=OFF -DWITH_MKL=OFF -DWITH_DOC=ON -DWITH_STYLE_CHECK=OFF make -j `nproc` gen_proto_py framework_py_proto make -j `nproc` copy_paddle_pybind -make -j `nproc` paddle_docs paddle_docs_cn paddle_api_docs +make -j `nproc` paddle_docs paddle_docs_cn paddle_api_docs paddle_fluid_api_docs # check websites for broken links linkchecker doc/v2/en/html/index.html -- GitLab