Skip to content

Commit d235bc2

Browse files
authored
Fix custom directive 'galleryitem' (pytorch#161)
1 parent 055a90e commit d235bc2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_directives.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ def run(self):
8888
if 'intro' in self.options:
8989
intro = self.options['intro'][:195] + '...'
9090
else:
91-
intro = sphinx_gallery.gen_rst.extract_intro(abs_fname)
91+
_, blocks = sphinx_gallery.gen_rst.split_code_and_text_blocks(abs_fname)
92+
intro, _ = sphinx_gallery.gen_rst.extract_intro_and_title(abs_fname, blocks[0][1])
9293

9394
thumbnail_rst = sphinx_gallery.backreferences._thumbnail_div(
9495
dirname, basename, intro)

0 commit comments

Comments
 (0)