File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -442,11 +442,16 @@ def make_github_url(file_name):
442
442
443
443
# is it a gallery page?
444
444
if any (d in file_name for d in sphinx_gallery_conf ['gallery_dirs' ]):
445
- if file_name .split ("/" )[- 1 ] == "index" :
445
+ example_folder = file_name .split ("/" )[- 2 ]
446
+ if file_name .split ("/" )[- 1 ] == "index.rst" :
446
447
example_file = "README.rst"
447
448
else :
448
449
example_file = file_name .split ("/" )[- 1 ].replace ('.rst' , '.py' )
449
- target_url = URL_BASE + "docs/examples/" + example_file
450
+
451
+ if example_folder == 'gallery' :
452
+ target_url = URL_BASE + "docs/examples/" + example_file # noqa: E501
453
+ else :
454
+ target_url = URL_BASE + "docs/examples/" + example_folder + "/" + example_file # noqa: E501
450
455
451
456
# is it an API autogen page?
452
457
elif "generated" in file_name :
You can’t perform that action at this time.
0 commit comments