0

Right now my docs/source has an index.rst that in its doctree imports another file called api.rst. In this api.rst file I would like to autodoc a python module. This module is a .py with many functions not attached to any class, but they are organized in groups by their functionality. I could write the api file like this:

fbbotw api
==========

.. automodule:: fbbotw
   :members:

However it will autodoc all functions without considering these groups. Right now, I'm trying to do that using the .. autofunction:: directive like this:

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

It works locally, but online readthedocs only creates the titles of api.rst but the .. autofunction:: doesn't do anything. Is there another way to do that or am I missing any configuration?

Other things I have tried:

For every group in api.rst create another file and import it toctree, and in these group files use .. automodule: fbbotw :members: function1, function2... specifying the members I want to autodoc in that file.

I really suspect that it may be a bad configuration on the readthedocs admin and I cannot make it work online, since it all works fine locally.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Joabe da Luz
  • 1,030
  • 2
  • 18
  • 32
  • 1
    @JoabMendes so the problem is not related to autofunction vs automodule, it is autodocs which is not working, right? They have a FAQ section for this problem: http://read-the-docs.readthedocs.io/en/latest/faq.html#my-project-isn-t-building-with-autodoc – Mikhail Korobov Nov 29 '16 at 15:52
  • @MikhailKorobov thank you for you comment, I checked my building log and there was an error in my module that wasn't covered in my tests. So the autodoc wasnt working online because of it (Setting a `env` var I use on conf.py fixed it). If you want to post your comment as answer I will check it as correct. Thank you again. – Joabe da Luz Nov 29 '16 at 16:28

2 Answers2

0

Sphinx has an autodocs api for automatically generating rst files for your package. You can edit each rst after autodocs has run and add more info. Take care when running autodocs because it may overwrite older files.

Tobey
  • 1,400
  • 1
  • 10
  • 25
0

Answered in comments by @MikhailKorobov:

so the problem is not related to autofunction vs automodule, it is autodocs which is not working, right? They have a FAQ section for this problem: http://read-the-docs.readthedocs.io/en/latest/faq.html#my-project-isn-t-building-with-autodoc

There was an ImportError on my module so autodoc could not setup it. Checking the readthedocs building log I could see that this ImportError wasn't covered in my tests and also the environment for building the docs was diferent. Working now: http://fbbotw.readthedocs.io/en/latest/

Joabe da Luz
  • 1,030
  • 2
  • 18
  • 32