Skip to content

Commit 09182d9

Browse files
committed
Documentation building updates
README update
1 parent cb2f688 commit 09182d9

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ And, one of the following:
4949

5050
- [Google Test](https://github.com/google/googletest) - version 1.8 or higher (only required for running test cases)
5151
- [Doxygen](http://www.doxygen.org) - version 1.8 or higher (only required for generating documentation)
52+
- [Swagger-codegen](https://github.com/swagger-api/swagger-codegen) - version 3.0 or higher (only required for generating documentation)
5253
- [Sphinx](https://www.sphinx-doc.org/en/master/usage/installation.html) - version 4.5 or higher along with the following Python packages: `pip3 install sphinx-rtd-theme breathe recommonmark` (only required for generating documentation)
5354
- [Batsched](https://gitlab.inria.fr/batsim/batsched) - version 1.4 - useful for expanded batch-scheduled resource simulation capabilities
5455
- [Asio](https://github.com/chriskohlhoff/asio/) - necessary only for building `wrench-daemon`

conf/cmake/Documentation.cmake

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@ if (NOT DOXYGEN_FOUND)
44
endif()
55

66
find_program(SWAGGER_CODEGEN_FOUND "swagger-codegen" QUIET)
7-
87
if (NOT SWAGGER_CODEGEN_FOUND)
98
message("-- swagger-codegen: No (warning: swagger-codegen is needed in case you want to generate WRENCH documentation)")
109
else()
1110
message("-- Found swagger-codegen")
1211
endif()
1312

14-
if (DOXYGEN_FOUND AND SWAGGER_CODEGEN_FOUND)
13+
find_program(SPHINX_FOUND "sphinx-build" QUIET)
14+
if (NOT SPHINX_FOUND)
15+
message("-- sphinx: No (warning: sphinx is needed in case you want to generate WRENCH documentation)")
16+
else()
17+
message("-- Found sphinx")
18+
endif()
19+
20+
21+
if (DOXYGEN_FOUND AND SWAGGER_CODEGEN_FOUND AND SPHINX_FOUND)
1522

1623
# WRENCH APIs documentation
1724
foreach (SECTION USER DEVELOPER INTERNAL)
@@ -56,20 +63,24 @@ if (DOXYGEN_FOUND AND SWAGGER_CODEGEN_FOUND)
5663
add_custom_target(doc DEPENDS wrench ${WRENCH_SECTIONS_LIST})
5764

5865
add_custom_command(TARGET doc
66+
POST_BUILD
5967
COMMAND swagger-codegen generate -i ${CMAKE_HOME_DIRECTORY}/tools/wrench/wrench-daemon/doc/wrench-openapi.json -l html2 -o ${CMAKE_HOME_DIRECTORY}/docs/build/${WRENCH_RELEASE_VERSION}/restapi
6068
COMMENT "Generating REST API HTML"
6169
VERBATIM
6270
)
63-
add_custom_command(TARGET doc COMMAND python3
71+
add_custom_command(TARGET doc COMMAND python3
6472
${CMAKE_HOME_DIRECTORY}/doc/scripts/generate_rst.py
6573
${CMAKE_HOME_DIRECTORY}/docs/${WRENCH_RELEASE_VERSION}
6674
${CMAKE_HOME_DIRECTORY}/doc/source
6775
${WRENCH_RELEASE_VERSION})
68-
add_custom_command(TARGET doc COMMAND sphinx-build
76+
add_custom_command(TARGET doc COMMAND sphinx-build
6977
${CMAKE_HOME_DIRECTORY}/doc/source
7078
${CMAKE_HOME_DIRECTORY}/docs/build/${WRENCH_RELEASE_VERSION})
71-
add_custom_command(TARGET doc COMMAND cp -R
79+
add_custom_command(TARGET doc COMMAND cp -R
7280
${CMAKE_HOME_DIRECTORY}/docs/build/${WRENCH_RELEASE_VERSION}
7381
${CMAKE_HOME_DIRECTORY}/docs/build/latest)
7482

83+
else()
84+
add_custom_target(doc echo "ERROR: Cannot build documentation because at least one of Doxygen, Swagger-Codegen, or Sphinx is not installed." COMMAND echo " If you have installed them, re-run cmake." VERBATIM)
85+
7586
endif()

doc/source/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
1616
# ones.
1717
extensions = [
18-
'recommonmark',
18+
'myst_parser',
1919
'sphinx_rtd_theme',
2020
'sphinx.ext.autodoc',
2121
'sphinx.ext.doctest',
@@ -95,3 +95,11 @@
9595
version = '2.4-dev'
9696
release = '2.4-dev'
9797

98+
breathe_projects = {
99+
"user": "../../docs/2.6-dev/user/xml/",
100+
"developer": "../../docs/2.6-dev/developer/xml/",
101+
"internal": "../../docs/2.6-dev/internal/xml/",
102+
}
103+
version = '2.6-dev'
104+
release = '2.6-dev'
105+

0 commit comments

Comments
 (0)