Change the title in index.rst generated by Sphinx AutoAPI

782 Views Asked by At

I am looking for a way to rename the title in index.rst.

AutoAPI generates a documentation of modules inside a directory ..\docs\source\_autoapi with index.rst file as follows:

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

This page contains auto-generated API reference documentation [#f1]_.

.. toctree::
   :titlesonly:

   /_autoapi/moduleA/index
   /_autoapi/moduleB/index

.. [#f1] Created with `sphinx-autoapi <https://github.com/readthedocs/sphinx-autoapi>`_

Is there a way to rename the title "API Reference" inside the index.rst file when using AutoAPI?

1

There are 1 best solutions below

0
On

You need to copy the template files and python folder of the official autoapi git located at https://github.com/readthedocs/sphinx-autoapi I place my files/folders in the _templates folder of sphinx. so the folder path would look something like

src/docs/_templates/autoapi/

after this you need to add

autoapi_template_dir = "_templates/autoapi"

to your sphinx conf.py file after the extensions section. Now you can edit the index.rst to fit your needs, in your case you would change API Reference to YOUR TITLE HERE.