astropy / sphinx-automodapi

Sphinx extension for generating API documentation
https://sphinx-automodapi.readthedocs.io
BSD 3-Clause "New" or "Revised" License
63 stars 45 forks source link

Question: headings not working #185

Open user41284863 opened 7 months ago

user41284863 commented 7 months ago

Hello.

I'm new to automodapi and i tried to do use your library for my python code: """ .. automodapi:: path.to.my.code.with.a.long.name.mycode :inheritance-diagram:

.. automodapi:: path.to.my.code.with.a.long.name.mysecondcode :inheritance-diagram:

"""

However my path is so long, it's baldy displayed in my doc. Especialy inside the table of content.

So i tried to use the :headings: option to change the name displayed and avoiding th

""" .. automodapi:: path.to.my.code.with.a.long.name.mycode :inheritance-diagram:
:headings: My_Title

.. automodapi:: path.to.my.code.with.a.long.name.mysecondcode :inheritance-diagram: :headings: My_second_Title
"""

However it didn't change the title in my table of content, but added a lot of the firsts letters in my titles like this in my page: """ automodapi:: path.to.my.code.with.a.long.name.mycode Package MMMMMMMMMMMMMMMMMMMM

Classes [...] Class Inheritance Diagram [...]

path.to.my.code.with.a.long.name.mysecondcode Package YYYYYYYYYYYYYYYYYYYYYYYYYYY

Classes [...] Class Inheritance Diagram [...]

"""

I didn't find any useful ressource except the documentation nor a satisfaying example on the internet. Could you explain me if it's an issue or if i'm using something wrong ?

pllim commented 7 months ago

I think you need to tweak Sphinx setting itself. Example: https://stackoverflow.com/questions/20864406/remove-package-and-module-name-from-sphinx-function

user41284863 commented 7 months ago

@pllim I added "add_module_names = False" in my conf.py but sadly it didn't do anything. I'm using the theme "sphinx_rtd_theme" if this helps.

pllim commented 7 months ago

Did you try to ask Sphinx developers first?