|
3 | 3 | # For the full list of built-in configuration values, see the documentation: |
4 | 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
5 | 5 |
|
| 6 | +import os |
| 7 | +import re |
| 8 | +import sys |
| 9 | + |
| 10 | +# Add the project source to Python path for autodoc |
| 11 | +sys.path.insert(0, os.path.abspath("../src")) |
| 12 | + |
| 13 | + |
| 14 | +# Custom autodoc processing to clean up Pydantic classes |
| 15 | +def autodoc_skip_member(app, what, name, obj, skip, options): |
| 16 | + """Skip unwanted Pydantic and other internal members.""" |
| 17 | + exclude_patterns = {re.compile(r"model_.*")} |
| 18 | + |
| 19 | + if any(pattern.match(name) for pattern in exclude_patterns): |
| 20 | + return True |
| 21 | + |
| 22 | + # Skip private methods starting with underscore (except __init__) |
| 23 | + if name.startswith("_") and name != "__init__": |
| 24 | + return True |
| 25 | + |
| 26 | + return skip |
| 27 | + |
| 28 | + |
| 29 | +def setup(app): |
| 30 | + app.connect("autodoc-skip-member", autodoc_skip_member) |
| 31 | + |
| 32 | + |
6 | 33 | # -- Project information ----------------------------------------------------- |
7 | 34 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
8 | 35 |
|
9 | 36 | project = "CloudAI" |
10 | 37 | copyright = "2025, NVIDIA CORPORATION & AFFILIATES" |
11 | 38 | author = "NVIDIA CORPORATION & AFFILIATES" |
| 39 | +version = "1.4.0-beta" |
| 40 | +release = "1.4.0-beta" |
12 | 41 |
|
13 | 42 | # -- General configuration --------------------------------------------------- |
14 | 43 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
|
17 | 46 | "sphinx.ext.autodoc", |
18 | 47 | "sphinx.ext.viewcode", |
19 | 48 | "sphinx.ext.napoleon", |
| 49 | + "sphinx.ext.autosummary", |
20 | 50 | "myst_parser", |
21 | 51 | "sphinxcontrib.mermaid", |
| 52 | + "sphinx_copybutton", |
22 | 53 | ] |
23 | 54 |
|
24 | 55 | exclude_patterns = ["_build"] |
25 | 56 |
|
| 57 | +# -- Autodoc configuration --------------------------------------------------- |
| 58 | +autodoc_default_options = { |
| 59 | + "members": True, |
| 60 | + "member-order": "bysource", |
| 61 | + "special-members": "__init__", |
| 62 | + "undoc-members": False, # Don't show undocumented members |
| 63 | +} |
| 64 | + |
| 65 | +# Generate autosummary even if no references |
| 66 | +autosummary_generate = True |
| 67 | + |
26 | 68 | # -- Options for HTML output ------------------------------------------------- |
27 | 69 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
28 | 70 |
|
|
35 | 77 | "html_image", |
36 | 78 | ] |
37 | 79 |
|
38 | | -# Configure MyST to handle mermaid code blocks properly |
| 80 | +# Configure MyST to handle code blocks as directives |
39 | 81 | myst_fence_as_directive = ["mermaid"] |
40 | 82 |
|
41 | 83 | # Mermaid configuration |
|
0 commit comments