-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconf.py
More file actions
103 lines (81 loc) · 3.47 KB
/
conf.py
File metadata and controls
103 lines (81 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
import os
import sys
# Add paths for autodoc modules
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../rips/generated'))
sys.path.insert(0, os.path.abspath('_ext'))
# TODO: We need to get access to the generated files in /ApplicationCode/GrpcInterface/Python/rips/generated
# It is not clear how we can organize these files for readthedocs
# sys.path.insert(0, os.path.abspath('../../ApplicationCode/GrpcInterface/Python'))
# -- Project information -----------------------------------------------------
project = 'ResInsight Python API - rips'
copyright = 'Ceetron Solutions AS'
author = 'Ceetron Solutions AS'
# Import version information from RiaVersionInfo
try:
import RiaVersionInfo
release = f"{RiaVersionInfo.RESINSIGHT_MAJOR_VERSION}.{RiaVersionInfo.RESINSIGHT_MINOR_VERSION}.{RiaVersionInfo.RESINSIGHT_PATCH_VERSION}"
version = f"{RiaVersionInfo.RESINSIGHT_MAJOR_VERSION}.{RiaVersionInfo.RESINSIGHT_MINOR_VERSION}"
except ImportError:
# Fallback version if RiaVersionInfo is not available
release = '2020.10'
version = '2020.10'
# -- General configuration ---------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'm2r2',
'sphinx_automodapi.automodapi',
'hide_grpc_params',
'clean_internal_methods',
'searchable_literalinclude'
]
# Enable search functionality
html_search_language = 'en'
html_search_options = {'type': 'default'}
# Include source files in search
html_copy_source = True
html_show_sourcelink = True
master_doc = 'index'
napoleon_google_docstring = True
smartquotes = False
# Clean up automodapi generated files in source after build to make sure we get a full rebuild next time
def cleanup_automodapi_files(app, exception):
"""Remove automodapi generated files from source directory after build."""
import shutil
api_dir = os.path.join(app.srcdir, 'api')
if os.path.exists(api_dir):
shutil.rmtree(api_dir)
def setup(app):
app.connect('build-finished', cleanup_automodapi_files)
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns to ignore when looking for source files
exclude_patterns = ['build/*']
# -- Read the Docs configuration ---------------------------------------------
# https://about.readthedocs.com/blog/2024/07/addons-by-default/
# Define the canonical URL if using a custom domain on Read the Docs
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
# Tell Jinja2 templates the build is running on Read the Docs
if os.environ.get("READTHEDOCS", "") == "True":
if "html_context" not in globals():
html_context = {}
html_context["READTHEDOCS"] = True
html_context["current_version"] = release
# -- HTML output options -----------------------------------------------------
html_theme = "sphinx_rtd_theme"
html_logo = "images/ResInsightCroppedIconPicture.png"
html_theme_options = {
'style_nav_header_background': '#505050',
'display_version': True, # Show version in sidebar
}
# Add paths that contain custom static files (CSS, etc.)
html_static_path = ['_static']
html_style = 'css/custom.css'