Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docstrings for magics that use @magic_arguments are rendered wrong #1890

Closed
fperez opened this issue Jun 9, 2012 · 0 comments · Fixed by #1921
Closed

Docstrings for magics that use @magic_arguments are rendered wrong #1890

fperez opened this issue Jun 9, 2012 · 0 comments · Fixed by #1921

Comments

@fperez
Copy link
Member

fperez commented Jun 9, 2012

For example, see the Rmagic docstring. The decorator destroys all linebreaks. See this response by @rkern on the list for details of a possible solution approach.

@fperez fperez closed this as completed in df97f2d Jun 12, 2012
takluyver pushed a commit to takluyver/ipython that referenced this issue Jun 12, 2012
…ocstring

magic_arguments: dedent but otherwise preserve indentation.

Previously magic_arguments stripped all whitespace at the beginning of each line, interfering with formatting syntax which relies on indentation to give context (e.g., code blocks). Now the docstring text is passed through dedent to strip the global indentation before being handed off to `RawDescriptionHelpFormatter` which preserves any remaining indentation.

Thanks to @rkern for suggesting the solution approach.

Closes ipythongh-1890.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Previously magic_arguments stripped all whitespace at the beginning of
each line, interfering with formatting syntax which relies on indentation
to give context (e.g., code blocks). Now the docstring text is passed
through dedent to strip the global indentation before being handed off
to RawDescriptionHelpFormatter which preserves any remaining indentation.

Thanks to @rkern for suggesting the solution approach.

Closes ipythongh-1890.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
…ocstring

magic_arguments: dedent but otherwise preserve indentation.

Previously magic_arguments stripped all whitespace at the beginning of each line, interfering with formatting syntax which relies on indentation to give context (e.g., code blocks). Now the docstring text is passed through dedent to strip the global indentation before being handed off to `RawDescriptionHelpFormatter` which preserves any remaining indentation.

Thanks to @rkern for suggesting the solution approach.

Closes ipythongh-1890.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant