From 120376c68b9c0957fdd33aa82502b0c4dbd8f5b8 Mon Sep 17 00:00:00 2001 From: Sebastian Hoffmann Date: Tue, 7 Jan 2025 17:21:13 +0100 Subject: [PATCH] doc: links to python and torch (intersphinx) & parse types from type hints (sphinx_autodoc_typehints) --- doc/conf.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 5930ee6..77ee8a9 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -13,26 +13,35 @@ # -- General configuration --------------------------------------------------- extensions = [ - 'sphinx.ext.duration', 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', + 'sphinx_autodoc_typehints', + 'sphinx.ext.duration', + 'sphinx.ext.autosummary', 'sphinx.ext.coverage', + 'sphinx.ext.intersphinx', ] templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +# -- autodoc ----------------------------------------------------------------- +# autodoc_typehints = "description" + +# -- Napoleon ---------------------------------------------------------------- +# napoleon_use_param = False +# napoleon_use_rtype = False +# napoleon_preprocess_types = True + +# -- External documentation (intersphinx) ------------------------------------ +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), + 'torch': ('https://pytorch.org/docs/stable/', None), +} + + # -- Options for HTML output ------------------------------------------------- html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] html_logo = '../misc/logo/dmlcloud_light.png' - - -# Napoleon configs -napoleon_google_docstring = True -napoleon_numpy_docstring = False -napoleon_use_param = False -napoleon_use_rtype = False -napoleon_preprocess_types = True