Skip to content

Commit 1e8b9ea

Browse files
committed
🎨
1 parent fdb0199 commit 1e8b9ea

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Diff for: docs/source/sphinxext/gallery_generator.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,10 @@ class NotebookGenerator:
7272

7373
def __init__(self, filename, target_dir):
7474
self.basename = os.path.basename(filename)
75-
self.stripped_name = os.path.splitext(self.basename)[0]
76-
self.output_html = str(
77-
Path("..") / Path(filename).relative_to(Path.cwd()).with_suffix(".html")
78-
)
75+
stripped_name = os.path.splitext(self.basename)[0]
76+
self.output_html = str(".." / Path(filename).relative_to(Path.cwd()).with_suffix(".html"))
7977
self.image_dir = os.path.join(target_dir, "_images")
80-
self.png_path = os.path.join(self.image_dir, f"{self.stripped_name}.png")
78+
self.png_path = os.path.join(self.image_dir, f"{stripped_name}.png")
8179
with open(filename) as fid:
8280
self.json_source = json.load(fid)
8381
self.pagetitle = self.extract_title()
@@ -188,6 +186,7 @@ def build_gallery(srcdir, gallery):
188186
js_file = os.path.join(image_dir, f"gallery_{gallery}_contents.js")
189187
with open(table_of_contents_file) as toc:
190188
table_of_contents = toc.read()
189+
191190
js_contents = "Gallery.examples = {}\n{}".format(json.dumps(data), table_of_contents)
192191

193192
with open(js_file, "w") as js:

0 commit comments

Comments
 (0)