Open eymeric-giraux opened 1 week ago
@eymeric-giraux I couldn't reproduce your problem. It seems to work fine on my side.
Maybe the following will help:
"""an incorrect note
.. note:: A Note """
```python
"""an correct note
.. note::
A Note
"""
Note
or Notes
"Sections" instead of using rst directly:
Numpy docstring format uses Notes
: https://numpydoc.readthedocs.io/en/latest/format.html#notes
Google docstring format uses Note
: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.htmlHope that helps!
Thanks @sachahu1 for taking the time... no, this is not related to notes in particular. The problem is there with any directive and has been reproduced by some other people too. I have checked indentation which is fine. In fact, copy pasting the same snippet to an actual rst
file is working...
In your example, there is some text a correct note
before the .. note::
... you need to remove it in order to reproduce the issue. In fact, a workaround for this issue is adding an invisible character before the directive, so that the docstring does not start with it...
@eymeric-giraux I've tried removing the additional text a correct note
and it seems to still be working fine on my side, maybe I'm doing something wrong?
def valid_note():
"""
.. note::
A Note
"""
pass
Do you mean to have your docstring as:
def valid_note():
""".. note::
A Note
"""
pass
In which case I don't think this is a valid docstring.
no, it seems that it is working fine on your side... I am using sphinx-autoapi 3.0.0 though, the latest one is 3.1.2. I could try updating to the latest version I guess.
I've tried downgrading to 3.0.0 but it still works on my side... Not sure what's causing the problem on your side, might be worth having a look through your conf.py
.
Ok, now you really have been going the extra mile... thank you so much! From that point, I guess I have to look on my side what might be the issue. I will be updating the outcome here if I can figure it out.
So,
.. note:: This is a test
is processed correctly in docstrings.but
is not working.
is working.