Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sphinx warning: Unknown interpreted text role "method"

When running:

$ make html

I get:

...
/home/app_dir/app1/forms.py:docstring of app1.forms.SomeForm.some_method:3: ERROR: Unknown interpreted text role "method".
...

My method docstring is:

... 
This method uses :method:`~app1.forms.other_method` to do other thing.
...

How can I cross-reference this other_method?

like image 258
NBajanca Avatar asked Oct 23 '25 03:10

NBajanca


1 Answers

According to Sphinx Domains a method of an object should be cross-referenced using :py:meth:

The correct docstring would be:

... 
This method uses :meth:`~app1.forms.other_method` to do other thing.
...

Note: Python domain is the default so :py:meth: is the same as :meth:

like image 169
NBajanca Avatar answered Oct 25 '25 21:10

NBajanca



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!