Skip to content

Commit 0a135de

Browse files
committed
Use the cmake configure_file to setup imports for API docs
1 parent b568fbe commit 0a135de

File tree

7 files changed

+19
-4
lines changed

7 files changed

+19
-4
lines changed

doc/fluid/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees")
1515
# HTML output director
1616
set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html")
1717

18+
set(IMPORT_PADDLE_STRING "")
19+
set(IMPORT_PADDLEV2_STRING "")
20+
1821
configure_file(
1922
"${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.en.in"
2023
"${BINARY_BUILD_DIR_EN}/conf.py"

doc/fluid/api/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees")
77
# HTML output director
88
set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html")
99

10+
set(IMPORT_PADDLE_STRING "import paddle")
11+
set(IMPORT_PADDLEV2_STRING "import paddle.v2")
12+
1013
configure_file(
1114
"${CMAKE_CURRENT_SOURCE_DIR}/../../templates/conf.py.en.in"
1215
"${BINARY_BUILD_DIR_EN}/conf.py"

doc/mobile/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees")
1515
# HTML output director
1616
set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html")
1717

18+
set(IMPORT_PADDLE_STRING "")
19+
set(IMPORT_PADDLEV2_STRING "")
20+
1821
configure_file(
1922
"${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.en.in"
2023
"${BINARY_BUILD_DIR_EN}/conf.py"

doc/templates/conf.py.cn.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import os, subprocess
1616
sys.path.insert(0, os.path.abspath('@PADDLE_BINARY_DIR@/python'))
1717
import shlex
1818
from recommonmark import parser, transform
19-
import paddle
20-
import paddle.v2
19+
@IMPORT_PADDLE_STRING@
20+
@IMPORT_PADDLEV2_STRING@
2121

2222
MarkdownParser = parser.CommonMarkParser
2323
AutoStructify = transform.AutoStructify

doc/templates/conf.py.en.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import os, subprocess
1616
sys.path.insert(0, os.path.abspath('@PADDLE_BINARY_DIR@/python'))
1717
import shlex
1818
from recommonmark import parser, transform
19-
import paddle
20-
import paddle.v2
19+
@IMPORT_PADDLE_STRING@
20+
@IMPORT_PADDLEV2_STRING@
2121

2222

2323
MarkdownParser = parser.CommonMarkParser

doc/v2/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees")
1515
# HTML output director
1616
set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html")
1717

18+
set(IMPORT_PADDLE_STRING "")
19+
set(IMPORT_PADDLEV2_STRING "")
20+
1821
configure_file(
1922
"${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.en.in"
2023
"${BINARY_BUILD_DIR_EN}/conf.py"

doc/v2/api/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees")
77
# HTML output director
88
set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html")
99

10+
set(IMPORT_PADDLE_STRING "import paddle")
11+
set(IMPORT_PADDLEV2_STRING "import paddle.v2")
12+
1013
configure_file(
1114
"${CMAKE_CURRENT_SOURCE_DIR}/../../templates/conf.py.en.in"
1215
"${BINARY_BUILD_DIR_EN}/conf.py"

0 commit comments

Comments
 (0)