77
77
"sphinx_design" ,
78
78
"sphinx_jinja" ,
79
79
"sphinx_gallery.gen_gallery" ,
80
+ "sphinx.ext.todo" ,
80
81
]
81
82
82
83
# Intersphinx mapping
180
181
181
182
182
183
def extract_example_links (
183
- repo_fullname : str , path_relative_to_root : str , exclude_files : List [str ]
184
+ repo_fullname : str , path_relative_to_root : str , exclude_files : List [str ] = []
184
185
) -> List [str ]:
185
186
"""
186
187
Extract example links from a specific GitHub repository.
@@ -202,7 +203,8 @@ def extract_example_links(
202
203
g = Github ()
203
204
repo = g .get_repo (repo_fullname )
204
205
contents = repo .get_contents (path_relative_to_root )
205
-
206
+ if not isinstance (contents , list ):
207
+ contents = [contents ]
206
208
example_links = []
207
209
for content in contents :
208
210
if content .type == "dir" :
@@ -252,8 +254,17 @@ def download_and_process_files(example_links: List[str]) -> List[str]:
252
254
)
253
255
file_names = download_and_process_files (example_links )
254
256
257
+ admonitions_links = extract_example_links (
258
+ "pydata/pydata-sphinx-theme" ,
259
+ "docs/examples/kitchen-sink/admonitions.rst" ,
260
+ )
261
+
262
+ admonitions_links = download_and_process_files (admonitions_links )
263
+ print (admonitions_links )
264
+
255
265
jinja_contexts = {
256
266
"examples" : {"inputs_examples" : file_names },
267
+ "admonitions" : {"inputs_admonitions" : admonitions_links },
257
268
"install_guide" : {
258
269
"version" : f"v{ version } " if not version .endswith ("dev0" ) else "main" ,
259
270
},
0 commit comments