##// END OF EJS Templates
%magic: -rest argument generates restructuredtext output and returns it. indent mglob docstring
Ville M. Vainio -
Show More
@@ -147,7 +147,7 b' license. To use profiling, please install"python2.3-profiler" from non-free.""")'
147 filter(inst_magic,self.__dict__.keys()) + \
147 filter(inst_magic,self.__dict__.keys()) + \
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
148 filter(inst_bound_magic,self.__class__.__dict__.keys())
149 out = []
149 out = []
150 for fn in magics:
150 for fn in Set(magics):
151 out.append(fn.replace('magic_','',1))
151 out.append(fn.replace('magic_','',1))
152 out.sort()
152 out.sort()
153 return out
153 return out
@@ -386,7 +386,10 b' license. To use profiling, please install"python2.3-profiler" from non-free.""")'
386 return None
386 return None
387
387
388 def magic_magic(self, parameter_s = ''):
388 def magic_magic(self, parameter_s = ''):
389 """Print information about the magic function system."""
389 """Print information about the magic function system.
390
391 Supported formats: -latex, -brief, -rest
392 """
390
393
391 mode = ''
394 mode = ''
392 try:
395 try:
@@ -394,6 +397,9 b' license. To use profiling, please install"python2.3-profiler" from non-free.""")'
394 mode = 'latex'
397 mode = 'latex'
395 if parameter_s.split()[0] == '-brief':
398 if parameter_s.split()[0] == '-brief':
396 mode = 'brief'
399 mode = 'brief'
400 if parameter_s.split()[0] == '-rest':
401 mode = 'rest'
402 rest_docs = []
397 except:
403 except:
398 pass
404 pass
399
405
@@ -414,12 +420,21 b' license. To use profiling, please install"python2.3-profiler" from non-free.""")'
414 else:
420 else:
415 fndoc = 'No documentation'
421 fndoc = 'No documentation'
416 else:
422 else:
417 fndoc = fn.__doc__
423 fndoc = fn.__doc__.rstrip()
424
425 if mode == 'rest':
426 rest_docs.append('**%s%s**::\n\n\t%s\n\n' %(self.shell.ESC_MAGIC,
427 fname,fndoc))
418
428
429 else:
419 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
430 magic_docs.append('%s%s:\n\t%s\n' %(self.shell.ESC_MAGIC,
420 fname,fndoc))
431 fname,fndoc))
432
421 magic_docs = ''.join(magic_docs)
433 magic_docs = ''.join(magic_docs)
422
434
435 if mode == 'rest':
436 return "".join(rest_docs)
437
423 if mode == 'latex':
438 if mode == 'latex':
424 print self.format_latex(magic_docs)
439 print self.format_latex(magic_docs)
425 return
440 return
1 NO CONTENT: modified file
NO CONTENT: modified file
General Comments 0
You need to be logged in to leave comments. Login now