readthedocs / sphinx-autoapi

A new approach to API documentation in Sphinx.
https://sphinx-autoapi.readthedocs.io/
MIT License
415 stars 126 forks source link

What is generated exactly? #420

Closed HealthyPear closed 4 months ago

HealthyPear commented 4 months ago

From the docs I do not understand if the generated documentation is directly in HTML or they are supposed to be RsT files.

I manage to generate the TOC tree page but I do not see it in my source files.

as far as I understood they should stay in docs/source/autoapi (because I didn't change autoapi_root), but I only see built material under docs/build/html/autoapi.

I would like to not have my TOC tree at the top level, but referenced from another page, for example

Reference API
===========

bal bla

.. toctree::

   api/c++/index
   api/python/index <------------ this should be the index made with sphinx-autoapi

the relevant section of my conf.py file is

autoapi_dirs = ["../build/my_package_api"]
autoapi_add_toctree_entry = True
autoapi_template_dir = templates_path[0]

where docs/build/my_package_api is populated by .pyi files.

HealthyPear commented 4 months ago

OK I think what I need is autoapi_keep_files=True...

HealthyPear commented 4 months ago

Now I am able to link the page from another page but I still see the top-level link

if I set autoapi_add_toctree_entry = False I do not get theindex.rst file as per docs

HealthyPear commented 4 months ago

OK the solution was to do

autoapi_add_toctree_entry = False
autoapi_keep_files = True

and customize the template of the index page to do

.. toctree::
   :glob:
   :hidden:

   **