7
7
from pathlib import Path
8
8
from typing import TYPE_CHECKING
9
9
10
+ import transport_data # noqa: F401
11
+
10
12
if TYPE_CHECKING :
11
13
import sphinx .application
12
14
@@ -54,6 +56,10 @@ def setup(app: "sphinx.application.Sphinx"):
54
56
55
57
html_css_files = ["css/custom.css" ]
56
58
59
+ # -- Options for sphinx.ext.autosummary ------------------------------------------------
60
+
61
+ autosummary_generate = True
62
+
57
63
# -- Options for sphinx.ext.extlinks ---------------------------------------------------
58
64
59
65
extlinks = {
@@ -67,6 +73,7 @@ def setup(app: "sphinx.application.Sphinx"):
67
73
intersphinx_mapping = {
68
74
"click" : ("https://click.palletsprojects.com/en/8.1.x/" , None ),
69
75
"pandas" : ("https://pandas.pydata.org/pandas-docs/stable/" , None ),
76
+ "platformdirs" : ("https://platformdirs.readthedocs.io/en/latest/" , None ),
70
77
"pooch" : ("https://www.fatiando.org/pooch/latest/" , None ),
71
78
"py" : ("https://docs.python.org/3/" , None ),
72
79
"pytest" : ("https://docs.pytest.org/en/stable/" , None ),
@@ -93,7 +100,10 @@ def linkcode_resolve(domain, info):
93
100
rel = Path (module .__file__ ).relative_to (base_path [info ["module" ].split ("." )[0 ]])
94
101
95
102
# The object itself
96
- obj = getattr (module , info ["fullname" ])
103
+ try :
104
+ obj = getattr (module , info ["fullname" ])
105
+ except AttributeError :
106
+ return None
97
107
try :
98
108
# First line number
99
109
firstlineno = obj .__code__ .co_firstlineno
@@ -103,3 +113,8 @@ def linkcode_resolve(domain, info):
103
113
fragment = f"#L{ firstlineno } " # Function, class, or other definition
104
114
105
115
return f"{ base_url } { rel } { fragment } "
116
+
117
+
118
+ # -- Options for sphinx.ext.napoleon ---------------------------------------------------
119
+
120
+ napoleon_preprocess_types = True
0 commit comments