File tree Expand file tree Collapse file tree 3 files changed +18
-27
lines changed
Expand file tree Collapse file tree 3 files changed +18
-27
lines changed Original file line number Diff line number Diff line change 1111 - cmake --workflow --preset documentation-workflow
1212 # Copy built documentation to Read the Docs output directory
1313 - mkdir -p $READTHEDOCS_OUTPUT/html
14- - cp -r build/* $READTHEDOCS_OUTPUT/html/
14+ - cp -r build/html/* $READTHEDOCS_OUTPUT/html/
15+ - cp -r build/markdown/* $READTHEDOCS_OUTPUT/html/
Original file line number Diff line number Diff line change 1- # SetupSphinx.cmake - Find Sphinx for CI environments
1+ # Sphinx related utilities
2+
3+ set (SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR} /source )
4+ set (SPHINX_BUILD ${CMAKE_BINARY_DIR} )
25
36# Function to find Sphinx in the system
47function (setup_sphinx_environment)
@@ -15,3 +18,11 @@ function(setup_sphinx_environment)
1518 # Export to parent scope
1619 set (SPHINX_EXECUTABLE "${SPHINX_EXECUTABLE} " PARENT_SCOPE)
1720endfunction ()
21+
22+ # Function to add a Sphinx builder target
23+ function (add_sphinx_builder builder_name)
24+ add_custom_target (${builder_name}
25+ COMMAND ${SPHINX_EXECUTABLE} -b ${builder_name} ${SPHINX_SOURCE} ${SPHINX_BUILD} /${builder_name}
26+ VERBATIM
27+ )
28+ endfunction ()
Original file line number Diff line number Diff line change 1- # Find Sphinx
2- include (SetupSphinx)
3- setup_sphinx_environment()
4-
5- set (SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR} /source )
6- set (SPHINX_BUILD ${CMAKE_BINARY_DIR} )
1+ include (SphinxUtils)
72
8- # Build HTML documentation
9- add_custom_target (html
10- COMMAND ${SPHINX_EXECUTABLE} -b html ${SPHINX_SOURCE} ${SPHINX_BUILD}
11- COMMENT "Building HTML documentation"
12- VERBATIM
13- )
14-
15- # Build markdown documentation
16- add_custom_target (markdown
17- COMMAND ${SPHINX_EXECUTABLE} -b markdown ${SPHINX_SOURCE} ${SPHINX_BUILD}
18- COMMENT "Building Markdown documentation"
19- VERBATIM
20- )
3+ setup_sphinx_environment()
214
22- # Build reStructuredText documentation
23- add_custom_target (rst
24- COMMAND ${SPHINX_EXECUTABLE} -b rst ${SPHINX_SOURCE} ${SPHINX_BUILD}
25- COMMENT "Building reStructuredText documentation"
26- VERBATIM
27- )
5+ add_sphinx_builder(html)
6+ add_sphinx_builder(markdown)
You can’t perform that action at this time.
0 commit comments