简体   繁体   中英

Change the title in index.rst generated by Sphinx AutoAPI

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?

Found these tutorials pretty nice and had helped a lot. They explain how to manually add and set up Sphink AutoAPI's default template:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM