Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* Source: https://github.com/readthedocs/sphinx_rtd_theme/issues/1529#issuecomment-1918561608*/

/* Take out pointless vertical whitespace in the signatures. */
.rst-content dl .sig dl,
.rst-content dl .sig dd {
margin-bottom: 0;
}

/* Make signature boxes full-width, with view-source and header links right-aligned. */
.rst-content dl .sig {
width: -webkit-fill-available;
}
.rst-content .viewcode-link {
display: inline-flex;
float: inline-end;
margin-right: 1.5em;
}
.rst-content .headerlink {
position: absolute;
right: 0.5em;
}
24 changes: 22 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
needs_sphinx = "7.2"

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down Expand Up @@ -93,7 +93,8 @@
# 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 = []
html_static_path = ["_static"]
html_css_files = ["css/custom.css"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down Expand Up @@ -159,3 +160,22 @@
"Miscellaneous",
)
]

python_maximum_signature_line_length = 80

# Patch Sphinx to hide @overload signatures in docs
# Sphinx's autodoc uses ModuleAnalyzer.overloads via the parser
# We patch the analyze method to clear overloads after parsing
# To see why, check out https://github.com/cognitedata/cognite-sdk-python/pull/2460
from sphinx.pycode import ModuleAnalyzer # noqa: E402

analyze_fn = ModuleAnalyzer.analyze


def analyze_but_skip_overloads(self):
result = analyze_fn(self)
self.overloads = {} # Clear overloads after analysis
return result


ModuleAnalyzer.analyze = analyze_but_skip_overloads
Loading