簡體   English   中英

Sphinx沒有為聲明的模塊生成文檔

[英]Sphinx not generating documentation for declared module

我直接遵循了本教程

我的代碼位於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文檔。

感謝您的指導。

請嘗試以下改編。 請注意,我正在使用.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:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM