1+ import os
2+ import sys
3+
4+ # Allow autodoc to import the sinch package from the project root
5+ sys .path .insert (0 , os .path .abspath (".." ))
6+ from sinch import __version__
7+
8+ # -- Project information -------------------------------------------------------
9+
10+ project = "Sinch Python SDK"
11+ copyright = "2024, Sinch Developer Experience Team"
12+ author = "Sinch Developer Experience Team"
13+ release = __version__
14+
15+ # -- General configuration -----------------------------------------------------
16+
17+ extensions = [
18+ # Automatically generates .rst files from Python source (replaces running
19+ # sphinx-apidoc manually — configured via apidoc_modules below)
20+ "sphinx.ext.apidoc" ,
21+ # Pulls docstrings from Python source into the generated .rst files
22+ "sphinx.ext.autodoc" ,
23+ # Adds [source] links that open the highlighted source file
24+ "sphinx.ext.viewcode" ,
25+ ]
26+
27+ # -- sphinx.ext.apidoc ---------------------------------------------------------
28+ # Runs apidoc automatically during the build — no need for a separate command.
29+ # Each entry in the list corresponds to one package to document.
30+
31+ apidoc_modules = [
32+ {
33+ # Path to the Python package, relative to this conf.py file
34+ "path" : "../sinch" ,
35+ # Output directory for the generated .rst files, relative to the docs source dir
36+ "destination" : "api" ,
37+ }
38+ ]
39+
40+ # -- sphinx.ext.autodoc --------------------------------------------------------
41+
42+ autodoc_default_options = {
43+ # Document all public members (methods, attributes, nested classes)
44+ "members" : True ,
45+ # Show the class inheritance chain
46+ "show-inheritance" : True ,
47+ # Preserve the order in which members appear in the source file
48+ "member-order" : "bysource" ,
49+ }
50+
51+ # Render type hints as part of the parameter/return descriptions, not the signature
52+ autodoc_typehints = "both"
53+
54+ # -- HTML output ---------------------------------------------------------------
55+
56+ html_theme = "sphinx_rtd_theme"
57+
58+ html_theme_options = {
59+ # Maximum depth of the navigation sidebar (-1 = unlimited)
60+ "navigation_depth" : - 1 ,
61+ # Keep all navigation entries expanded by default
62+ "collapse_navigation" : False ,
63+ }
0 commit comments