I am using the Sphinx autodoc and napoleon extensions to generate the documentation for my project (Qtools). This works well on my local machines. I am using Sphinx 3.1.2 (or higher). However, when I build the documentation on Read the Docs (RTD), only text added directly to the reStructuredText files that form the source of the documentation is processed. The docstrings that are supposed to be pulled in by autodoc do not appear in the HTML documentation generated by RTD. So for example in docs\source\section2_rsdoc.rst
I have:
Response spectra
================
The response spectrum class
---------------------------
.. autoclass:: qtools.ResponseSpectrum
:members:
Response spectrum creation
--------------------------
.. autofunction:: qtools.calcrs
.. autofunction:: qtools.calcrs_cmp
.. autofunction:: qtools.loadrs
See also :func:`qtools.convert2rs` (converts a power spectrum into a response spectrum).
This results in:
Response spectra
The response spectrum class
Response spectrum creation
See also qtools.convert2rs
(converts a power spectrum into a response spectrum).
In other words, all directives are apparently ignored, and hyperlinks to other functions are not added. I have examined several basic guidance documents such as this one, but I cannot figure out what I am doing wrong. RTD builds the documentation without any errors or warnings. In RTD advanced settings I have:
- Documentation type: Sphinx HTML
- Requirements file: requirements.txt
- Python interpreter: CPython 3.x
- Install Project: no
- Use system packages: no
- Python configuration file: blank
- Enable PDF build: no
- Enable EPUB build: no
I haven't touched any other settings.
In conf.py
I have tried the following variations of line 15: sys.path.insert(0, os.path.abspath('.'))
, sys.path.insert(0, os.path.abspath('../..'))
and the current sys.path.insert(0, os.path.abspath('../../..'))
. None of those made any difference.
I would be grateful for any help!