Assume the following is the structure of my code:
A/
__init__.py
B.py
Run.py
I go ahead and install sphinx and numpydoc extension. Then I issue sphinx-quickstart and choose the default (don't separate the source and builder) then I have the following files:
A/
docs/
conf.py
index.rst
static
templates
__init__.py
B.py
Run.py
Next step I edit the index.rst and add the followings:
.. automodule:: Run
:members:
Then I edit the conf.py as follows:
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
Then I cd
into docs directory and issue make HTML however when I open index.html file I see no documentation and it is empty.
I searched all the posts in the internet and here but none of them work for me.
I would like to know can anyone tell me:
1- If what I am doing is correct?
2- Since I am using numpydoc convention in my docstring, can this be the reason why I do not see anything?
EDIT: I separated the project and source and run sphinx-apidoc -o ./source .. and this generates two more rst file for A.rst and modules.rst and I changed the index.rst accordingly however after running make HTML I receive warning no module name A and fail to import B from module A.
A/
__init__.py
B.py
source/
module.rst
index.rst
A.rst
Run.py
BTW I have added
'sphinx.ext.autodoc','sphinx.ext.napoleon'
to extension list in conf.py.
This is the content of my index.rst:
.. toctree::
:maxdepth: 2
:caption: Contents:
A
modules
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`