##// END OF EJS Templates
Fix indentation of help text in %magic.
Bradley M. Froehle -
Show More
@@ -22,7 +22,7 b' from pprint import pformat'
22 from IPython.core import magic_arguments
22 from IPython.core import magic_arguments
23 from IPython.core.error import UsageError
23 from IPython.core.error import UsageError
24 from IPython.core.magic import Magics, magics_class, line_magic, magic_escapes
24 from IPython.core.magic import Magics, magics_class, line_magic, magic_escapes
25 from IPython.utils.text import format_screen
25 from IPython.utils.text import format_screen, dedent, indent
26 from IPython.core import magic_arguments, page
26 from IPython.core import magic_arguments, page
27 from IPython.testing.skipdoctest import skip_doctest
27 from IPython.testing.skipdoctest import skip_doctest
28 from IPython.utils.ipstruct import Struct
28 from IPython.utils.ipstruct import Struct
@@ -147,15 +147,17 b' class BasicMagics(Magics):'
147 docs = mman.lsmagic_docs(brief, missing='No documentation')
147 docs = mman.lsmagic_docs(brief, missing='No documentation')
148
148
149 if rest:
149 if rest:
150 format_string = '**%s%s**::\n\n\t%s\n\n'
150 format_string = '**%s%s**::\n\n%s\n\n'
151 else:
151 else:
152 format_string = '%s%s:\n\t%s\n'
152 format_string = '%s%s:\n%s\n'
153
153
154 return ''.join(
154 return ''.join(
155 [format_string % (magic_escapes['line'], fname, fndoc)
155 [format_string % (magic_escapes['line'], fname,
156 indent(dedent(fndoc)))
156 for fname, fndoc in sorted(docs['line'].items())]
157 for fname, fndoc in sorted(docs['line'].items())]
157 +
158 +
158 [format_string % (magic_escapes['cell'], fname, fndoc)
159 [format_string % (magic_escapes['cell'], fname,
160 indent(dedent(fndoc)))
159 for fname, fndoc in sorted(docs['cell'].items())]
161 for fname, fndoc in sorted(docs['cell'].items())]
160 )
162 )
161
163
General Comments 0
You need to be logged in to leave comments. Login now