现在我的文档/来源有一个index.rst
,在其doctree导入另一个文件,称为api.rst
。我想这个api.rst
文件autodoc一个python模块。这个模块是一个.py,许多函数没有附加到任何类,但它们按功能分组。我可以编写API文件是这样的:Readthedocs:有没有办法在一个文件中分别自动分配相同的模型函数?
fbbotw api
==========
.. automodule:: fbbotw
:members:
然而,将车博士的所有功能,而无需考虑这些群体。现在,我想这样做,使用.. autofunction::
指令是这样的:
fbbotw Functions reference
==========================
Graph API Functions
-------------------
.. autofunction:: fbbotw.get_user_information
Send Api Functions
------------------
Sender Actions
~~~~~~~~~~~~~~
.. autofunction:: fbbotw.typing
Content Types
~~~~~~~~~~~~~
.. autofunction:: fbbotw.post_text_message
.. autofunction:: fbbotw.post_audio_attachment
.. autofunction:: fbbotw.post_file_attachment
.. autofunction:: fbbotw.post_image_attachment
.. autofunction:: fbbotw.post_video_attachment
Quick Replies
~~~~~~~~~~~~~
.. autofunction:: fbbotw.post_text_w_quickreplies
Templates
~~~~~~~~~
.. autofunction:: fbbotw.post_button_template
.. autofunction:: fbbotw.post_generic_template
.. autofunction:: fbbotw.post_list_template
.. autofunction:: fbbotw.post_receipt_template
Buttons
~~~~~~~
.. autofunction:: fbbotw.post_call_button
Thread Settings Functions
-------------------------
.. autofunction:: fbbotw.post_settings
.. autofunction:: fbbotw.post_greeting_text
.. autofunction:: fbbotw.post_start_button
.. autofunction:: fbbotw.post_persistent_menu
.. autofunction:: fbbotw.post_domain_whitelisting
.. autofunction:: fbbotw.post_account_linking_url
它本地工作,但网上readthedocs只创建的api.rst
的冠军,但在.. autofunction::
没有做任何事情。是否有另一种方式来做到这一点,或者我错过了任何配置?
我曾尝试其他的事情:
对于每一个组中api.rst
创建另一个文件,并将其导入toctree,和这些组中的文件使用.. automodule: fbbotw :members: function1, function2...
指定我想在该文件中,以车博士成员。
我真的怀疑它可能是readthedocs admin上的一个错误配置,我无法使它在线工作,因为它在本地都能正常工作。
你尝试使用[sphinx-apidoc](https://codeandchaos.wordpress.com/2012/07/30/sphinx-autodoc-tutorial-for-dummies/)(页面的buttom)for自动文档 – Tobey
autodocs是否在readthedocs上工作? –
@Tobey大部分教程对于readthedocs的入门都是一样的,所以它和我一样。 –