]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
WIP: set up breathe
authorSONOLET Aymeric <aymeric.sonolet@cea.fr>
Tue, 9 Apr 2024 15:51:31 +0000 (17:51 +0200)
committerSONOLET Aymeric <aymeric.sonolet@cea.fr>
Tue, 27 Aug 2024 11:45:29 +0000 (13:45 +0200)
Still figuring out how to not use system python and system python exs so
I can find breathe.

doc/user/CMakeLists.txt
doc/user/conf.py.in
doc/user/input/api.rst [new file with mode: 0644]
doc/user/input/index.rst

index ccb6f06d5c04744c264434a89f77fd936adaa60c..2a621c8d66a8f254639b8de849fe43c039deca04 100644 (file)
 # 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)
index 449e8e50b016c67626f2190a15bb7458d30d87fc..34a660d16933967d13dbeeed0644d0a52c7c08f6 100644 (file)
@@ -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 (file)
index 0000000..e767018
--- /dev/null
@@ -0,0 +1,8 @@
+API
+===
+
+
+.. doxygenindex::
+   :project: dev_docs
+   :no-link:
+   :allow-dot-graphs:
index 11ee3eb2072d89aca038443b83e0390348393e41..d3eaf45c78af91e70a50e30c8293459176c85f58 100644 (file)
@@ -27,4 +27,5 @@ First, this documentation introduces :doc:`fundamental concepts/objects <basic_c
    data_analysis
    data_conversion
    data_optimization
+   api