Reputation: 21
I am trying to use Sphinx for the first time to get documentation from docstrings in my code. I am currently using pycharm to run a sphinx task but I did not have luck with the command line either. The problem is that the process gets struck without returning any error:
Running Sphinx v1.2.2
loading pickled environment... done
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] index
Then nothing.
I tried to follow the Sphinx documentation and guides available online, but maybe I got something wrong. These is my index.rst file:
Welcome to Mycode's documentation!
===================================
Contents:
.. automodule:: mycode
:members:
___________________________________
**Sub-Modules: **
.. toctree::
:maxdepth: 2
mycode.TerminalColors
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
And this is my conf.py:
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../docs'))
sys.path.insert(0, os.path.abspath('../scripts'))
sys.path.insert(0, os.path.abspath('../source'))
print(sys.path)
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinxcontrib.napoleon'
]
# Napoleon settings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True
autodoc_member_order = 'groupwise'
templates_path = ['.templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Mycode'
copyright = u'2016, Me'
version = '1.0'
release = '1.0'
exclude_patterns = []
pygments_style = 'sphinx'
html_theme = 'default'
html_static_path = ['.static']
htmlhelp_basename = 'Mycodedoc'
latex_elements = {}
latex_documents = [
('index', 'Mycode.tex', u'Mycode Documentation',
u'me', 'manual'),
]
man_pages = [
('index', 'mycode', u'mycode Documentation',
[u'me'], 1)
]
texinfo_documents = [
('index', 'Mycode', u'Mycode Documentation',
u'me', 'Mycode', 'One line description of project.',
'Miscellaneous'),
]
Finally, this is my project structure:
-mycode
-scripts
-mycode.py
-docs(output folder)
-index.html
-...
-build
-source
-conf.py
-index.rst
Any help will be very appreciated! Thank you
Upvotes: 1
Views: 1355
Reputation: 21
Solved. It appears that any wait-like function in a module will cause Sphinx to hang when importing it if it is executed at import time. I was using ROS and rospy.wait_for_service was causing the problem.
Upvotes: 1