-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hi @Chilipp ,
thanks for making docrep, I find it really useful!
I have 3 small requests, all somewhat related to keep_params/ delete_params:
- would it be possible to include
aliasargument (optional) to access the modified docstring? With some check if it's specified so that it doesn't overwrite existing keys.
d.keep_params("foo.parameters", "bar", "baz", "quux", alias="name")
# foo.parameters.name can be used instead of foo.parameters.bar|baz|quuux
d.keep_params("foo.parameters", "bar", "baz", "quux", alias=None)
# same as it is right now: foo.parameters.bar|baz|quuux
d.keep_params("foo.parameters", "bar", "baz", alias="name")
# would raise an error, alias "name" is already present- can
keep_paramsanddeleta_paramsbe used as decorators? I'd like to keep things in place rather than invokingd.keep_paramssomewhere below the functions
@d.keep_parameters("foo.parameters", "bar")
@d.get_sections(base="foo", sections=["Parameters"])
def foo(bar, baz):
"""
...
"""
pass- can typehints in the docstrings be made optional? I always use https://pypi.org/project/sphinx-autodoc-typehints/, so including them in the docstring is not necessary. However, not including them doesn't currently work with
{keep,delete}_params.
def foo(bar: int, baz: str) -> None:
"""
Quux.
Parameters
----------
bar
The bar.
baz
The baz.
"""
passI think 1. and 2. are fairly easy to adjust and I can make a PR for them.
As for 3., I somewhat naively though it might be as simple as modifying the relevant part of the regex from : to :? (or similar), however that's not the case, since some tests were failing (esp. the complex ones, where there was a mixture of keeping the annotations in the docstrings and omitting them [which is really discouraged]).
Maybe you have an idea how to best approach this?
Metadata
Metadata
Assignees
Labels
No labels