|
22 | 22 | from typing import Dict, List, Any, Optional |
23 | 23 |
|
24 | 24 |
|
25 | | -def run_apidoc(app): |
26 | | - """Generate doc stubs using sphinx-apidoc.""" |
27 | | - module_dir = os.path.join(app.srcdir, "../src/") |
28 | | - output_dir = os.path.join(app.srcdir, "_apidoc") |
29 | | - excludes = [] |
30 | | - |
31 | | - # Ensure that any stale apidoc files are cleaned up first. |
32 | | - if os.path.exists(output_dir): |
33 | | - shutil.rmtree(output_dir) |
34 | | - |
35 | | - cmd = [ |
36 | | - "--separate", |
37 | | - "--module-first", |
38 | | - "--doc-project=SDK API Reference", |
39 | | - "-o", |
40 | | - output_dir, |
41 | | - module_dir, |
42 | | - ] |
43 | | - cmd.extend(excludes) |
44 | | - |
45 | | - try: |
46 | | - from sphinx.ext import apidoc # Sphinx >= 1.7 |
47 | | - |
48 | | - apidoc.main(cmd) |
49 | | - except ImportError: |
50 | | - from sphinx import apidoc # Sphinx < 1.7 |
51 | | - |
52 | | - cmd.insert(0, apidoc.__file__) |
53 | | - apidoc.main(cmd) |
54 | | - |
55 | 25 |
|
56 | 26 | def setup(app): |
57 | 27 | """Register our sphinx hooks.""" |
58 | 28 |
|
59 | | - #app.connect("builder-inited", run_apidoc) |
60 | | - |
61 | 29 |
|
62 | 30 | # Get version from setup.py |
63 | 31 | def get_version(): |
@@ -105,12 +73,6 @@ def get_version(): |
105 | 73 | "sphinx.ext.autosectionlabel", |
106 | 74 | ] |
107 | 75 |
|
108 | | -''' |
109 | | -# Mock modules that might not be available during documentation build |
110 | | -autodoc_mock_imports = [ |
111 | | - 'sagemaker.hyperpod.training.config.hyperpod_pytorch_job_config', |
112 | | - 'hyperpod_pytorch_job_template.registry', |
113 | | -]''' |
114 | 76 | autodoc_mock_imports = ["pyspark", "feature_store_pyspark", "py4j"] |
115 | 77 |
|
116 | 78 | source_suffix = { |
@@ -150,7 +112,9 @@ def get_version(): |
150 | 112 |
|
151 | 113 | htmlhelp_basename = "{}doc".format(project) |
152 | 114 | html_static_path = ["_static"] |
153 | | -html_css_files = ["custom.css"] |
| 115 | +html_css_files = ["custom.css", |
| 116 | + "search_accessories.css", |
| 117 | + ] |
154 | 118 | napoleon_use_rtype = False |
155 | 119 |
|
156 | 120 | # nbsphinx configuration |
|
0 commit comments