我直接关注this tutorial。
我的代码位于N:/Tools/data/generic_accessor.py
。
generic_accessor.py
包含类似的内容:
def access_hfri_returns(terms=[]):
"""
This accesses HFRI returns data.
Returns:
"""
在generic_accessor中只有函数而没有类。
我补充说:
sys.path.insert(0,"N:\\Tools\\data")
到N:\Tools\data\conf.py
。
我的N:\Tools\data\index.rst
读取:
.. data documentation master file, created by
sphinx-quickstart on Fri Feb 24 11:52:57 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to data's documentation!
================================
Contents:
.. toctree::
:maxdepth: 2
.. automodule:: generic_accessor
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search
我重新make html
但我的N:\Tools\data\_build\html\index.html
看起来像这样:
我在任何地方都看不到generic_accessor
的文档。
感谢您提供任何指导。
答案 0 :(得分:0)
尝试以下修改。请注意,我使用.txt文件。
index.txt
.. data documentation master file, created by
sphinx-quickstart on ...
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to data's documentation!
===================================
Contents:
.. toctree::
:maxdepth: 2
generic_accessor
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
generic_accessor.txt
:mod:`generic_accessor`
==========================
.. automodule:: generic_accessor
:members:
:undoc-members:
:inherited-members:
:show-inheritance: