-
Notifications
You must be signed in to change notification settings - Fork 613
/
Copy pathconf.py
226 lines (190 loc) · 6.11 KB
/
conf.py
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# Configuration file for the Sphinx documentation builder.
import os
import pathlib
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('../../'))
import generate_examples
# -- Project information
project = 'SkyPilot'
copyright = '2025, SkyPilot Team'
author = 'the SkyPilot authors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
from sky import __version__ as version
# The full version, including alpha/beta/rc tags.
release = version
# -- General configuration
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
'sphinx_click',
'sphinx_copybutton',
"sphinx_togglebutton", # Used for collapsible sections in examples.
'sphinxcontrib.googleanalytics',
'sphinxemoji.sphinxemoji',
'sphinx_design',
'myst_parser',
'notfound.extension',
'sphinx.ext.autosectionlabel',
'extension.linting',
]
# Needed for admonitions in markdown:
# https://myst-parser.readthedocs.io/en/latest/syntax/admonitions.html
myst_enable_extensions = [
"colon_fence",
# Converts http links to clickable links in HTML output.
"linkify",
]
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}
intersphinx_disabled_domains = ['std']
templates_path = ['_templates']
# The main toctree document.
main_doc = 'index'
autosummary_generate = True
# Disable automatic type hints to let Napoleon handle them
napoleon_use_rtype = False
# Napoleon settings
napoleon_custom_sections = [
('Request Returns', 'params_style'),
('Request Raises', 'params_style'),
]
# -- Options for autodoc
# Python methods should be presented in source code order
autodoc_member_order = 'bysource'
# -- Options for HTML output
def render_svg_logo(path):
with open(pathlib.Path(__file__).parent / path, 'r') as f:
content = f.read()
return content
# html_theme = 'sphinx_book_theme'
html_theme = 'pydata_sphinx_theme'
html_theme_options = {
'show_toc_level': 1,
'navbar_align': 'left', # [left, content, right] For testing that the navbar items align properly
'navbar_start': ['navbar-skypilot-logo'],
'navbar_center': ['navbar-nav'],
'navbar_end': [
'theme-switcher',
'navbar-icon-links',
],
'navbar_persistent': ['search-button-field'],
'logo': {
'svg': render_svg_logo('_static/SkyPilot_wide_light.svg'),
},
'icon_links': [{
'name': 'Slack',
'url': 'https://slack.skypilot.co/',
'icon': 'fab fa-slack',
}, {
'name': 'Twitter',
'url': 'https://twitter.com/skypilot_org',
'icon': 'fab fa-twitter',
}, {
'name': 'GitHub',
'url': 'https://github.com/skypilot-org/skypilot/',
'icon': 'fab fa-github',
}],
'use_edit_page_button': True,
'announcement': None,
'secondary_sidebar_items': [
'page-toc',
'edit-this-page',
],
'navigation_depth': 4,
'pygment_light_style': 'tango',
'pygment_dark_style': 'monokai',
'primary_sidebar_end': [],
'footer_start': ['copyright'],
'footer_center': [],
'footer_end': [],
'header_links_before_dropdown': 6,
'article_header_start': None, # Disable breadcrumbs.
}
html_context = {
'github_user': 'skypilot-org',
'github_repo': 'skypilot',
'github_version': 'master',
'doc_path': 'docs/source',
}
html_sidebars = {
'index': [],
'**': ['main-sidebar'],
}
# The name for this set of Sphinx documents. If None, it defaults to
# '<project> v<release> documentation'.
html_title = 'SkyPilot documentation'
# -- Options for EPUB output
epub_show_urls = 'footnote'
# -- Options for sphinx-copybutton
copybutton_prompt_text = r'\$ '
copybutton_prompt_is_regexp = True
html_show_sourcelink = False
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = '_static/SkyPilot_wide_light.svg'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico), 16x16 or 32x32 pixels.
html_favicon = '_static/favicon.ico'
# 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 = ['_static']
html_js_files = ['custom.js']
html_css_files = ['custom.css']
# Allowing cross references in markdown files to be parsed
myst_heading_anchors = 7
show_sphinx = False
exclude_patterns = [
'_gallery_original',
'generated-examples',
]
myst_heading_anchors = 3
myst_url_schemes = {
'http': None,
'https': None,
'mailto': None,
'ftp': None,
'local': {
'url': '{{path}}',
'title': '{{path}}',
},
'gh-issue': {
'url': 'https://github.com/skypilot-org/skypilot/issues/{{path}}#{{fragment}}',
'title': 'Issue #{{path}}',
'classes': ['github'],
},
'gh-pr': {
'url': 'https://github.com/skypilot-org/skypilot/pull/{{path}}#{{fragment}}',
'title': 'Pull Request #{{path}}',
'classes': ['github'],
},
'gh-dir': {
'url': 'https://github.com/skypilot-org/skypilot/tree/master/{{path}}',
'title': '{{path}}',
'classes': ['github'],
},
'gh-file': {
'url': 'https://github.com/skypilot-org/skypilot/blob/master/{{path}}',
'title': '{{path}}',
'classes': ['github'],
},
}
googleanalytics_id = 'G-92WF3MDCJV'
autosectionlabel_prefix_document = True
suppress_warnings = ['autosectionlabel.*']
def setup(app):
# Run generate_examples directly during setup instead of connecting to builder-inited
# This ensures it completes fully before any build steps start
generate_examples.generate_examples(app)