diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/CMakeLists.txt | 72 | ||||
-rw-r--r-- | docs/conf.py.in (renamed from docs/conf.py) | 4 |
2 files changed, 37 insertions, 39 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 14126cfd..4b281eb4 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt | |||
@@ -1,40 +1,38 @@ | |||
1 | # cmake should not fail if sphinx is missing | 1 | find_package(Sphinx QUIET) |
2 | find_package(Sphinx) | ||
3 | 2 | ||
4 | if(SPHINX_EXECUTABLE) | 3 | if(NOT DEFINED SPHINX_THEME) |
5 | 4 | set(SPHINX_THEME default) | |
6 | if(NOT DEFINED SPHINX_THEME) | 5 | endif() |
7 | set(SPHINX_THEME default) | 6 | |
8 | endif() | 7 | if(NOT DEFINED SPHINX_THEME_DIR) |
9 | 8 | set(SPHINX_THEME_DIR) | |
10 | if(NOT DEFINED SPHINX_THEME_DIR) | 9 | endif() |
11 | set(SPHINX_THEME_DIR) | 10 | |
12 | endif() | 11 | # configured documentation tools and intermediate build results |
13 | 12 | set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") | |
14 | # configured documentation tools and intermediate build results | 13 | |
15 | set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") | 14 | # Sphinx cache with pickled ReST documents |
16 | 15 | set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") | |
17 | # Sphinx cache with pickled ReST documents | 16 | |
18 | set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") | 17 | # HTML output directory |
19 | 18 | set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") | |
20 | # HTML output directory | 19 | |
21 | set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") | 20 | configure_file( |
22 | 21 | "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" | |
23 | configure_file( | 22 | "${BINARY_BUILD_DIR}/conf.py" |
24 | "${CMAKE_CURRENT_SOURCE_DIR}/conf.py" | 23 | @ONLY) |
25 | "${BINARY_BUILD_DIR}/conf.py" | 24 | |
26 | @ONLY) | 25 | if(SPHINX_FOUND) |
27 | 26 | add_custom_target(docs | |
28 | add_custom_target(docs | 27 | ${SPHINX_EXECUTABLE} |
29 | ${SPHINX_EXECUTABLE} | 28 | -b html |
30 | -b html | 29 | -c "${BINARY_BUILD_DIR}" |
31 | -c "${BINARY_BUILD_DIR}" | 30 | -d "${SPHINX_CACHE_DIR}" |
32 | "${CMAKE_CURRENT_SOURCE_DIR}" | 31 | "${CMAKE_CURRENT_SOURCE_DIR}" |
33 | "${SPHINX_HTML_DIR}" | 32 | "${SPHINX_HTML_DIR}" |
34 | COMMENT "Building HTML documentation with Sphinx") | 33 | COMMENT "Building HTML documentation with Sphinx") |
35 | else() | 34 | else() |
36 | add_custom_target(docs | 35 | add_custom_target(docs |
37 | echo | 36 | echo "Please install python-sphinx to build the docs or read the docs online: https://projecttox.readthedocs.org/en/latest" |
38 | "Please install python-sphinx to build the docs or read the docs online: https://projecttox.readthedocs.org/en/latest" | 37 | - COMMENT "No sphinx executable found") |
39 | COMMENT "No sphinx executebale found") | ||
40 | endif() | 38 | endif() |
diff --git a/docs/conf.py b/docs/conf.py.in index afebb632..260e77a8 100644 --- a/docs/conf.py +++ b/docs/conf.py.in | |||
@@ -91,7 +91,7 @@ pygments_style = 'sphinx' | |||
91 | 91 | ||
92 | # The theme to use for HTML and HTML Help pages. See the documentation for | 92 | # The theme to use for HTML and HTML Help pages. See the documentation for |
93 | # a list of builtin themes. | 93 | # a list of builtin themes. |
94 | html_theme = 'default' | 94 | html_theme = '@SPHINX_THEME@' |
95 | 95 | ||
96 | # Theme options are theme-specific and customize the look and feel of a theme | 96 | # Theme options are theme-specific and customize the look and feel of a theme |
97 | # further. For a list of options available for each theme, see the | 97 | # further. For a list of options available for each theme, see the |
@@ -99,7 +99,7 @@ html_theme = 'default' | |||
99 | #html_theme_options = {} | 99 | #html_theme_options = {} |
100 | 100 | ||
101 | # Add any paths that contain custom themes here, relative to this directory. | 101 | # Add any paths that contain custom themes here, relative to this directory. |
102 | #html_theme_path = [] | 102 | html_theme_path = ['@SPHINX_THEME_DIR@'] |
103 | 103 | ||
104 | # The name for this set of Sphinx documents. If None, it defaults to | 104 | # The name for this set of Sphinx documents. If None, it defaults to |
105 | # "<project> v<release> documentation". | 105 | # "<project> v<release> documentation". |