From 353bfbbfda349b0fa0a25d3ab703dd0ae3ae15c3 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Tue, 13 Feb 2024 08:30:40 -0600 Subject: [PATCH] Add breathe bridge doxygen to sphinx --- doc/doxygen_config.dox | 4 ++-- doc/requirements.txt | 1 + doc/sphinx/api_manual/available_apis.md | 7 ++++--- doc/sphinx/conf.in.py | 4 +++- doc/sphinx/conf.py | 16 +++++++++++++--- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/doc/doxygen_config.dox b/doc/doxygen_config.dox index 308a8787f..17a885337 100644 --- a/doc/doxygen_config.dox +++ b/doc/doxygen_config.dox @@ -297,7 +297,7 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- # Configuration options related to the XML output #--------------------------------------------------------------------------- -GENERATE_XML = NO +GENERATE_XML = YES XML_OUTPUT = xml XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- @@ -345,7 +345,7 @@ CLASS_DIAGRAMS = NO MSCGEN_PATH = DIA_PATH = HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = YES +HAVE_DOT = NO DOT_NUM_THREADS = 0 DOT_FONTNAME = Helvetica DOT_FONTSIZE = 10 diff --git a/doc/requirements.txt b/doc/requirements.txt index 744cac57b..ac8328ba8 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,3 +4,4 @@ sphinx-copybutton sphinx-design sphinx-inline-tabs sphinxcontrib-bibtex +breathe diff --git a/doc/sphinx/api_manual/available_apis.md b/doc/sphinx/api_manual/available_apis.md index 0a5ecad3a..40169b370 100644 --- a/doc/sphinx/api_manual/available_apis.md +++ b/doc/sphinx/api_manual/available_apis.md @@ -2,6 +2,7 @@ Available APIs ============== -```{todo} -Show the different APIs which are currently available in the world builder (temperature, composition and CPO. Others will be added as well.) -``` \ No newline at end of file +```{eval-rst} +.. doxygenindex:: + :outline: +``` diff --git a/doc/sphinx/conf.in.py b/doc/sphinx/conf.in.py index 0f329d4ad..6909f4c3d 100644 --- a/doc/sphinx/conf.in.py +++ b/doc/sphinx/conf.in.py @@ -39,6 +39,7 @@ 'sphinx_design', 'sphinx_copybutton', 'sphinxcontrib.bibtex', +'breathe', ] bibtex_default_style = 'plain' @@ -49,6 +50,7 @@ # Breathe Configuration breathe_default_project = "GWB" +breathe_projects = {"GWB": "../doxygen/xml"} # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -87,4 +89,4 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/sphinx/_static/'] \ No newline at end of file +html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/sphinx/_static/'] diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index fefe69aa4..1156f0e0f 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -10,10 +10,18 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os -# import sys +import os +import sys +import subprocess # sys.path.insert(0, os.path.abspath('.')) +# -- Run Doxygen first if this is a build on ReadTheDocs + +read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' + +if read_the_docs_build: + os.mkdir("../doxygen") + subprocess.call('cd ../.. ; doxygen doc/doxygen_config.dox', shell=True) # -- Project information ----------------------------------------------------- @@ -38,6 +46,7 @@ 'sphinx_design', 'sphinx_copybutton', 'sphinxcontrib.bibtex', +'breathe', ] bibtex_default_style = 'plain' @@ -48,6 +57,7 @@ # Breathe Configuration breathe_default_project = "GWB" +breathe_projects = {"GWB": "../doxygen/xml"} # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -86,4 +96,4 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static/'] \ No newline at end of file +html_static_path = ['_static/']