@@ -72,12 +72,10 @@ class NotebookGenerator:
72
72
73
73
def __init__ (self , filename , target_dir ):
74
74
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" ))
79
77
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" )
81
79
with open (filename ) as fid :
82
80
self .json_source = json .load (fid )
83
81
self .pagetitle = self .extract_title ()
@@ -188,6 +186,7 @@ def build_gallery(srcdir, gallery):
188
186
js_file = os .path .join (image_dir , f"gallery_{ gallery } _contents.js" )
189
187
with open (table_of_contents_file ) as toc :
190
188
table_of_contents = toc .read ()
189
+
191
190
js_contents = "Gallery.examples = {}\n {}" .format (json .dumps (data ), table_of_contents )
192
191
193
192
with open (js_file , "w" ) as js :
0 commit comments