-
Notifications
You must be signed in to change notification settings - Fork 50
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
Optionally preserve sub-indentation while parsing? #51
Comments
Thank you for the detailed report. Currently this feature isn't there and would need to be implemented. |
Thanks for the reply. If this was to be a PR, what would you suggest for exposing it? Would enough people need the feature to add a keyword to |
I wouldn't add a new flag and just always keep the original indentation – it's easy to emulate old behavior with |
You might be able to do something simple manually using |
Maybe this is unsupportable, but I figured it was worth asking. In my library, metadata for function arguments is stored in the docstring, looking something like this:
Under the hood, I can turn this into a configuration using
ConfigParser
. However,docstring_parser
removes all indentation underneath a parameter. This is a problem for me, sinceConfigParser
requires multiline values to be indented. The below example doesn't work, since all sub-indentation underneathx
is obliterated:docstring_parser.parse()
turns x's description into:Is there some way to optionally use
textwrap.dedent
instead ofstrip()
during the parsing logic for these cases? Thanks for your consideration.The text was updated successfully, but these errors were encountered: