##// END OF EJS Templates
added documentation to more functions and methods
Paul Ivanov -
Show More
@@ -195,6 +195,9 b' def markdown2rst(src):'
195 195
196 196
197 197 def rst_directive(directive, text=''):
198 """
199 Makes ReST directive block and indents any text passed to it.
200 """
198 201 out = [directive, '']
199 202 if text:
200 203 out.extend([indent(text), ''])
@@ -270,6 +273,22 b' class Converter(object):'
270 273 return getattr(self, 'render_display_format_' + format, self.render_unknown_display)
271 274
272 275 def convert(self, cell_separator='\n'):
276 """
277 Generic method to converts notebook to a string representation.
278
279 This is accomplished by dispatching on the cell_type, so subclasses of
280 Convereter class do not need to re-implement this method, but just
281 need implementation for the methods that will be dispatched.
282
283 Parameters
284 ----------
285 cell_separator : string
286 Character or string to join cells with. Default is "\n"
287
288 Returns
289 -------
290 out : string
291 """
273 292 lines = []
274 293 lines.extend(self.optional_header())
275 294 converted_cells = []
@@ -308,9 +327,19 b' class Converter(object):'
308 327 return os.path.abspath(outfile)
309 328
310 329 def optional_header(self):
330 """
331 Optional header to insert at the top of the converted notebook
332
333 Returns a list
334 """
311 335 return []
312 336
313 337 def optional_footer(self):
338 """
339 Optional footer to insert at the end of the converted notebook
340
341 Returns a list
342 """
314 343 return []
315 344
316 345 def _new_figure(self, data, fmt):
General Comments 0
You need to be logged in to leave comments. Login now