2017-02-24 33 views
0

我直接跟着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看起来是这样的: enter image description here

我没有看到文档generic_accessor任何地方。

感谢您的任何指导。

+0

你加' “sphinx.ext.autodoc”'到'conf.py'了'extensions'列表? – jwodder

回答

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: 
+0

我还需要使用'sys.path.insert(0,“N:\\ tools”)在我的配置中明确地添加父目录' –