Skip to content

Commit c42cba4

Browse files
authored
Add section targets to gallery grid page (#546)
* Update thumbnail_extractor.py * black
1 parent 0c39a19 commit c42cba4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sphinxext/thumbnail_extractor.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
"""
7878

7979
SECTION_TEMPLATE = """
80+
.. _{section_id}:
81+
8082
{section_title}
8183
{underlines}
8284
@@ -184,7 +186,11 @@ def main(app):
184186
for folder, title in folder_title_map.items():
185187

186188
nb_paths = glob(f"{folder}/*.ipynb")
187-
file.append(SECTION_TEMPLATE.format(section_title=title, underlines="-" * len(title)))
189+
file.append(
190+
SECTION_TEMPLATE.format(
191+
section_title=title, section_id=folder, underlines="-" * len(title)
192+
)
193+
)
188194
target_dir = os.path.join("..", "_thumbnails", folder)
189195
if not os.path.isdir(target_dir):
190196
os.mkdir(target_dir)

0 commit comments

Comments
 (0)