##// END OF EJS Templates
Fixed extract figure, rename from count to index
Jonathan Frederic -
Show More
@@ -96,7 +96,12 b' class NbConvertApp(Application):'
96 96 ipynb_file = (self.extra_args)[2]
97 97
98 98 #Export
99 output, resources, exporter = export_by_name(ipynb_file, export_type)
99 return_value = export_by_name(ipynb_file, export_type)
100 if return_value is None:
101 print("Error: '%s' template not found." % export_type)
102 return
103 else:
104 (output, resources, exporter) = return_value
100 105
101 106 #TODO: Allow user to set output directory and file.
102 107 destination_filename = None
@@ -108,7 +113,7 b' class NbConvertApp(Application):'
108 113 #be used to create the directory that the files will be exported
109 114 #into.
110 115 out_root = ipynb_file[:-6].replace('.', '_').replace(' ', '_')
111 destination_filename = os.path.join(out_root+'.'+exporter.fileext)
116 destination_filename = os.path.join(out_root+'.'+exporter.file_extension)
112 117
113 118 destination_directory = out_root+'_files'
114 119 if not os.path.exists(destination_directory):
@@ -29,7 +29,7 b' class BasicHtmlExporter(exporter.Exporter):'
29 29 """
30 30 Exports a basic HTML document. This exporter assists with the export of
31 31 HTML. Inherit from it if you are writing your own HTML template and need
32 custom tranformers/filters. If you don't need custom tranformers/
32 custom transformers/filters. If you don't need custom transformers/
33 33 filters, just change the 'template_file' config option.
34 34 """
35 35
@@ -46,7 +46,7 b' class ExtractFigureTransformer(ActivatableTransformer):'
46 46 display_data_priority = List(['svg', 'png', 'latex', 'jpg', 'jpeg','text'])
47 47
48 48 #TODO: Change this to .format {} syntax
49 default_key_template = Unicode('_fig_{count:02d}.{ext}', config=True)
49 default_key_template = Unicode('_fig_{index:02d}.{ext}', config=True)
50 50
51 51 def cell_transform(self, cell, resources, index):
52 52 """
@@ -104,9 +104,8 b' class ExtractFigureTransformer(ActivatableTransformer):'
104 104 ----------
105 105 data : str
106 106 Cell data (from Notebook node cell)
107 resources : dictionary
108 Additional resources used in the conversion process. Allows
109 transformers to pass variables into the Jinja engine.
107 format : str
108 Figure format
110 109 index : int
111 110 Modified index of the cell being processed (see base.py)
112 111 """
General Comments 0
You need to be logged in to leave comments. Login now