Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build basic sphinx doctree for doc/fluid #9236

Merged
merged 2 commits into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_subdirectory(v2)
add_subdirectory(fluid)
49 changes: 49 additions & 0 deletions doc/fluid/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
if(NOT DEFINED SPHINX_THEME)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以在后续的PR中分批完成:

  1. 现在的命令是:paddle_fluid_docs, 那v2下的命令应该改为paddle_v2_docs等。
  2. 现在make paddle_docs前需要先make gen_proto_py,可以让paddle_docs依赖gen_proto_py,这样编译文档只需要使用make paddle_docs即可,比较清晰。其余命令类似。
  3. 编译文档现在有四个命令:v2/fluid+中英文,可以考虑再增加一个命令make paddle_docs编译出所有的文档。
  4. 目前doc/v2/CMakeLists.txt, doc/v2/api/CMakeLists.txt, doc/fluid/CMakeLists.txt 都非常类似,可以考虑使用function来包装一下。

set(SPHINX_THEME default)
endif()

if(NOT DEFINED SPHINX_THEME_DIR)
set(SPHINX_THEME_DIR)
endif()

# 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_docs
html
${BINARY_BUILD_DIR_EN}
${SPHINX_CACHE_DIR_EN}
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_HTML_DIR_EN})

# configured documentation tools and intermediate build results
set(BINARY_BUILD_DIR_CN "${CMAKE_CURRENT_BINARY_DIR}/cn/_build")

# Sphinx cache with pickled ReST documents
set(SPHINX_CACHE_DIR_CN "${CMAKE_CURRENT_BINARY_DIR}/cn/_doctrees")

# HTML output directory
set(SPHINX_HTML_DIR_CN "${CMAKE_CURRENT_BINARY_DIR}/cn/html")

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.cn.in"
"${BINARY_BUILD_DIR_CN}/conf.py"
@ONLY)

sphinx_add_target(paddle_fluid_docs_cn
html
${BINARY_BUILD_DIR_CN}
${SPHINX_CACHE_DIR_CN}
${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_HTML_DIR_CN})
2 changes: 2 additions & 0 deletions doc/fluid/build_and_install/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
安装与使用
------------
2 changes: 2 additions & 0 deletions doc/fluid/build_and_install/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Build and Install
------------
2 changes: 2 additions & 0 deletions doc/fluid/design/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
设计思想
------------
2 changes: 2 additions & 0 deletions doc/fluid/design/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Design
------------
2 changes: 2 additions & 0 deletions doc/fluid/dev/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
开发标准
------------
4 changes: 4 additions & 0 deletions doc/fluid/dev/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Development
------------

This is Development page
2 changes: 2 additions & 0 deletions doc/fluid/faq/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FAQ
------------
2 changes: 2 additions & 0 deletions doc/fluid/faq/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FAQ
------------
4 changes: 4 additions & 0 deletions doc/fluid/getstarted/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
新手入门
------------

新手入门
4 changes: 4 additions & 0 deletions doc/fluid/getstarted/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GET STARTED
------------

This is get started page
2 changes: 2 additions & 0 deletions doc/fluid/howto/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
进阶使用
------------
4 changes: 4 additions & 0 deletions doc/fluid/howto/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
HOW TO
------------

This is how to page
12 changes: 12 additions & 0 deletions doc/fluid/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PaddlePaddle Fluid
==========================

.. toctree::
:maxdepth: 1

getstarted/index_cn.rst
design/index_cn.rst
build_and_install/index_cn.rst
howto/index_cn.rst
dev/index_cn.rst
faq/index_cn.rst
12 changes: 12 additions & 0 deletions doc/fluid/index_en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PaddlePaddle Fluid
==========================

.. toctree::
:maxdepth: 1

getstarted/index_en.rst
design/index_en.rst
build_and_install/index_en.rst
howto/index_en.rst
dev/index_en.rst
faq/index_en.rst