-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathconf.py
More file actions
282 lines (237 loc) · 7.7 KB
/
conf.py
File metadata and controls
282 lines (237 loc) · 7.7 KB
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
import os
import sys
try:
import gi
gi.require_version("Gtk", "4.0")
gi.require_version("Gdk", "4.0")
gi.require_version("GObject", "2.0")
except ImportError:
pass
sys.path.insert(0, os.path.abspath("../src"))
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "Sugar-Toolkit-GTK4"
copyright = "2025, MostlyK"
author = "MostlyK"
release = "1.1.4"
version = "1.1.4"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.todo",
"autoapi.extension",
]
# AutoAPI Configuration - parses source files statically without importing
autoapi_type = "python"
autoapi_dirs = ["../src/sugar4"]
autoapi_root = "autoapi"
autoapi_ignore = ["*/__pycache__/*", "*/_version.py", "*/test_*.py", "*/*_test.py"]
autoapi_options = [
"members",
"undoc-members",
"show-inheritance",
"show-module-summary",
"special-members",
"imported-members",
]
autoapi_python_class_content = "both"
autoapi_member_order = "bysource"
autoapi_keep_files = True
autoapi_add_toctree_entry = False # We'll add it manually in index.rst
# Autodoc configuration
autodoc_default_options = {
"members": True,
"member-order": "bysource",
"special-members": "__init__",
"undoc-members": True,
"exclude-members": "__weakref__",
}
# Suppress warnings
suppress_warnings = [
"toc.not_included",
"ref.python",
"ref.class",
"ref.meth",
"ref.attr",
"ref.func",
"autodoc.import_object",
"docutils",
"autoapi",
]
# Autodoc ignore certain patterns
autodoc_inherit_docstrings = True
autodoc_member_order = "bysource"
# Skip problematic modules
autodoc_mock_imports = [
"gi",
"gi.repository",
"gi.repository.Gtk",
"gi.repository.Gdk",
"gi.repository.GdkPixbuf",
"gi.repository.GObject",
"gi.repository.GLib",
"gi.repository.Gio",
"gi.repository.Pango",
"gi.repository.PangoCairo",
"six",
"six.moves",
"decorator",
"telepathy",
"dbus",
"SimpleHTTPServer",
"socketserver",
"sugar4",
"cairo",
]
# Napoleon settings for Google/NumPy style docstrings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True
# Intersphinx configuration
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"gtk": ("https://lazka.github.io/pgi-docs/Gtk-4.0/", None),
}
# Autosummary configuration
autosummary_generate = True
autosummary_imported_members = True
# Show module contents in toctree
toctree_collapse = False
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# The master toctree document
master_doc = "index"
# The language for content autogenerated by Sphinx
language = "en"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files
exclude_patterns = ["_build"]
# The name of the Pygments (syntax highlighting) style to use
pygments_style = "sphinx"
# A list of ignored prefixes for module index sorting
modindex_common_prefix = ["sugar4."]
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
# Theme options are theme-specific and customize the look and feel of a theme
html_theme_options = {
"canonical_url": "https://sugar-toolkit-gtk4.readthedocs.io/",
"analytics_id": "",
"logo_only": False,
"display_version": True,
"prev_next_buttons_location": "bottom",
"style_external_links": True,
"vcs_pageview_mode": "blob",
"style_nav_header_background": "#2980B9",
# Toc options
"collapse_navigation": False, # Don't collapse by default
"sticky_navigation": True,
"navigation_depth": 6, # Show more levels
"includehidden": True,
"titles_only": False, # Show full contents, not just titles
}
# 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"]
# Custom CSS files
html_css_files = [
"custom.css",
]
# HTML title and meta
html_title = f"{project} v{release}"
html_short_title = project
html_show_sourcelink = True
html_show_sphinx = True
html_show_copyright = True
html_context = {
"display_github": True,
"github_user": "sugarlabs",
"github_repo": "sugar-toolkit-gtk4",
"github_version": "main",
"conf_py_path": "/docs/",
"source_suffix": ".rst",
}
# Custom sidebar templates, must be a dictionary that maps document names
# to template names
html_sidebars = {
"**": [
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
]
}
# Output file base name for HTML help builder
htmlhelp_basename = "SugarToolkitGtk4doc"
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, "sugar-toolkit-gtk4", "Sugar Toolkit GTK4 Documentation", [author], 1)
]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc,
"SugarToolkitGtk4",
"Sugar Toolkit GTK4 Documentation",
author,
"SugarToolkitGtk4",
"GTK4 port of the Sugar Toolkit for Python activities.",
"Miscellaneous",
),
]
# -- Extension configuration -------------------------------------------------
# -- Options for todo extension ----------------------------------------------
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for sphinx-copybutton extension --------------------------------
# Configure copy button behavior
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
copybutton_prompt_is_regexp = True
copybutton_only_copy_prompt_lines = True
copybutton_remove_prompts = True
# -- Options for MyST parser extension --------------------------------------
# Enable MyST extensions
myst_enable_extensions = [
"colon_fence",
"deflist",
"dollarmath",
"fieldlist",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"strikethrough",
"substitution",
"tasklist",
]
# MyST configuration
myst_heading_anchors = 3
myst_url_schemes = ["http", "https", "mailto"]
# -- Options for sphinx-design extension -----------------------------------
# Enable design extensions for better layouts
sd_fontawesome_latex = True