sphinx-contrib / napoleon

Other
148 stars 48 forks source link

REQUEST: Ignore regions #13

Open Erotemic opened 5 years ago

Erotemic commented 5 years ago

In my docstrings I like to write bash one-liners that allow me to accomplish various tasks like running a particular task or performing some auto-generation or auto-transformation of my code.

As an example, I would really like to be able to ignore the AutogenInit block defined here: https://github.com/Erotemic/ubelt/blob/master/ubelt/__init__.py#L32 and currently rendered here: https://ubelt.readthedocs.io/en/latest/index.html

It would be awesome of napoleon had a way of setting something in conf.py that caused certain google-style docstring blocks to be ignored when passing them to sphinx or just having sphinx ignore them in the first place.

Something like

napoleon_ignore_blocks = [
    'AutogenInit', 
    'Ignore',
]

If someone would give me a few pointers on where in the code functionality like this might best be added or how this might be best implemented, I'd be willing to to code this feature up.

Erotemic commented 3 years ago

That feeling when you are searching for a solution to a problem you had 2 years ago, and you find your old empty post.

FWIW: I'm still interseted in this, and I will implement this if someone points gives me a pointer.