| 1 |
# Configuration file for the Sphinx documentation builder. |
| 2 |
# |
| 3 |
# This file only contains a selection of the most common options. For a full |
| 4 |
# list see the documentation: |
| 5 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 6 |
|
| 7 |
# -- Path setup -------------------------------------------------------------- |
| 8 |
|
| 9 |
# If extensions (or modules to document with autodoc) are in another directory, |
| 10 |
# add these directories to sys.path here. If the directory is relative to the |
| 11 |
# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 12 |
# |
| 13 |
# import os |
| 14 |
# import sys |
| 15 |
# sys.path.insert(0, os.path.abspath('.')) |
| 16 |
|
| 17 |
# -- Doxygen generation |
| 18 |
|
| 19 |
from pathlib import Path |
| 20 |
import subprocess |
| 21 |
|
| 22 |
this_folder = Path(__file__).parent |
| 23 |
|
| 24 |
def configureDoxyfile(input_dir, output_dir): |
| 25 |
with open(this_folder/'Doxyfile.in', 'r') as file : |
| 26 |
filedata = file.read() |
| 27 |
|
| 28 |
filedata = filedata.replace('@CMAKE_SOURCE_DIR@', str(input_dir)) |
| 29 |
filedata = filedata.replace('@CMAKE_CURRENT_BINARY_DIR@', str(output_dir)) |
| 30 |
|
| 31 |
with open('Doxyfile', 'w') as file: |
| 32 |
file.write(filedata) |
| 33 |
|
| 34 |
doxygen_inputdir = (this_folder/"..").resolve() |
| 35 |
doxygen_output = (this_folder/"doxygen").resolve() |
| 36 |
|
| 37 |
if not Path(this_folder/"doxygen").exists(): |
| 38 |
configureDoxyfile(doxygen_inputdir, doxygen_output) |
| 39 |
subprocess.check_call('doxygen', cwd=this_folder) |
| 40 |
|
| 41 |
breathe_projects = {'ISMRMRD': str(doxygen_output/"xml")} |
| 42 |
breathe_default_project = 'ISMRMRD' |
| 43 |
|
| 44 |
# -- Project information ----------------------------------------------------- |
| 45 |
|
| 46 |
project = 'ISMRMRD' |
| 47 |
copyright = '2022, ISMRMRD Working Group' |
| 48 |
author = 'ISMRMRD Working Group' |
| 49 |
|
| 50 |
|
| 51 |
# -- General configuration --------------------------------------------------- |
| 52 |
|
| 53 |
# Add any Sphinx extension module names here, as strings. They can be |
| 54 |
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 55 |
# ones. |
| 56 |
extensions = ['breathe', 'myst_parser', 'sphinxcontrib.mermaid'] |
| 57 |
|
| 58 |
# Add any paths that contain templates here, relative to this directory. |
| 59 |
templates_path = ['_templates'] |
| 60 |
|
| 61 |
# List of patterns, relative to source directory, that match files and |
| 62 |
# directories to ignore when looking for source files. |
| 63 |
# This pattern also affects html_static_path and html_extra_path. |
| 64 |
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 65 |
|
| 66 |
|
| 67 |
# -- Options for HTML output ------------------------------------------------- |
| 68 |
|
| 69 |
# The theme to use for HTML and HTML Help pages. See the documentation for |
| 70 |
# a list of builtin themes. |
| 71 |
# |
| 72 |
html_theme = 'sphinx_rtd_theme' |
| 73 |
|
| 74 |
# Add any paths that contain custom static files (such as style sheets) here, |
| 75 |
# relative to this directory. They are copied after the builtin static files, |
| 76 |
# so a file named "default.css" will overwrite the builtin "default.css". |
| 77 |
html_static_path = ['_static'] |
| 78 |
|
| 79 |
# Override wide tables issue: https://github.com/readthedocs/sphinx_rtd_theme/issues/117 |
| 80 |
# html_context = { |
| 81 |
# 'css_files': [ |
| 82 |
# '_static/theme_overrides.css', # overrides for wide tables in RTD theme |
| 83 |
# ], |
| 84 |
# } |
| 85 |
html_css_files = [ |
| 86 |
'css/custom.css', |
| 87 |
] |
| 88 |
|
| 89 |
# -- Custom CSS -------------------------------------------------------------- |
| 90 |
# def setup(app): |
| 91 |
# app.add_javascript("custom.js") |
| 92 |
# app.add_css_file("theme_overrides.css") |