From: SONOLET Aymeric Date: Tue, 9 Apr 2024 15:51:31 +0000 (+0200) Subject: WIP: set up breathe X-Git-Tag: V9_14_0a1~28^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b86e684e38b09a961d59ad373315be43afe48eeb;p=tools%2Fmedcoupling.git WIP: set up breathe Still figuring out how to not use system python and system python exs so I can find breathe. --- diff --git a/doc/user/CMakeLists.txt b/doc/user/CMakeLists.txt index ccb6f06d5..2a621c8d6 100644 --- a/doc/user/CMakeLists.txt +++ b/doc/user/CMakeLists.txt @@ -17,19 +17,37 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(UseSphinx) +# INCLUDE(UseSphinx) +find_program(SPHINX_EXECUTABLE + NAMES sphinx-build + DOC "Sphinx Documentation Builder (sphinx-doc.org)" +) + +if (NOT SPHINX_EXECUTABLE) + message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!") +endif() SALOME_CONFIGURE_FILE(conf.py.in conf.py) -IF(MEDCOUPLING_BUILD_FRENCH_DOC) - SET(BUILD_LANGUAGE_SWITCHER "true") - SALOME_CONFIGURE_FILE(static/switchers.js.in static/switchers.js) - ADD_MULTI_LANG_DOCUMENTATION(TARGET_NAME usr_doc MODULE html LANGUAGES fr) -ELSE() - SET(BUILD_LANGUAGE_SWITCHER "false") - SALOME_CONFIGURE_FILE(static/switchers.js.in static/switchers.js) - ADD_MULTI_LANG_DOCUMENTATION(TARGET_NAME usr_doc MODULE html) -ENDIF() +# IF(MEDCOUPLING_BUILD_FRENCH_DOC) +# SET(BUILD_LANGUAGE_SWITCHER "true") +# SALOME_CONFIGURE_FILE(static/switchers.js.in static/switchers.js) +# ADD_MULTI_LANG_DOCUMENTATION(TARGET_NAME usr_doc MODULE html LANGUAGES fr) +# ELSE() +# SET(BUILD_LANGUAGE_SWITCHER "false") +# SALOME_CONFIGURE_FILE(static/switchers.js.in static/switchers.js) +# ADD_MULTI_LANG_DOCUMENTATION(TARGET_NAME usr_doc MODULE html) +# ENDIF() + +add_custom_target(usr_doc + COMMAND ${SPHINX_EXECUTABLE} + -c ${CMAKE_CURRENT_BINARY_DIR} + -b html + ${CMAKE_CURRENT_BINARY_DIR}/html + DEPENDS dev_docs + COMMENT "sphinx-build html user-doc" + VERBATIM +) INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_doc)") INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${MEDCOUPLING_INSTALL_DOC}/user) diff --git a/doc/user/conf.py.in b/doc/user/conf.py.in index 449e8e50b..34a660d16 100644 --- a/doc/user/conf.py.in +++ b/doc/user/conf.py.in @@ -24,7 +24,7 @@ import sphinx # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.mathjax'] +extensions = ['sphinx.ext.mathjax', "breathe"] try: import sphinx_rtd_theme extensions += ['sphinx_rtd_theme'] @@ -32,6 +32,7 @@ try: except: use_rtd_theme = False + # Add any paths that contain templates here, relative to this directory. #templates_path = ['_templates'] templates_path = [os.path.join('@CMAKE_CURRENT_SOURCE_DIR@','templates')] @@ -172,6 +173,12 @@ html_static_path = [os.path.join('@CMAKE_CURRENT_BINARY_DIR@','static')] # Output file base name for HTML help builder. htmlhelp_basename = 'MEDCouplingUsersGuide' +################### +# BREATHE OPTIONS # +################### + +breathe_projects = {"dev_docs": "../developer/xml/"} + # Options for LaTeX output # ------------------------ diff --git a/doc/user/input/api.rst b/doc/user/input/api.rst new file mode 100644 index 000000000..e76701843 --- /dev/null +++ b/doc/user/input/api.rst @@ -0,0 +1,8 @@ +API +=== + + +.. doxygenindex:: + :project: dev_docs + :no-link: + :allow-dot-graphs: diff --git a/doc/user/input/index.rst b/doc/user/input/index.rst index 11ee3eb20..d3eaf45c7 100644 --- a/doc/user/input/index.rst +++ b/doc/user/input/index.rst @@ -27,4 +27,5 @@ First, this documentation introduces :doc:`fundamental concepts/objects