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
magic_arguments: dedent but otherwise preserve indentation. #1921
magic_arguments: dedent but otherwise preserve indentation. #1921
Conversation
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.
Awesome!! Rebuilding our docs right now... Many, many thanks. I was kind of embarrassed to have all these new fancy magics with completely unreadable docstrings. @jonathan-taylor should be happy about this fix. Merging now. |
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 gh-1890.
Test results for commit df97f2d (can't merge cleanly)
Not available for testing: python3.1 |
This introduced failing tests. |
Ouch, I didn't even think of that since it was only doing docstrings!! I did build the docs and they looked way better, so I thought we'd be clear. Sorry about that... Will look into it as soon as I can |
I think it's just a tiny test of the docstring output, which assumed the behavior this changes. Not an actual bug, so it should just be a matter of pasting in the new output. |
OK, I've just pushed the fix straight to master. test_pr should work reliably again. Sorry about the mess. |
…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.
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 gh-1890.