Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: headings not working #185

Open
user41284863 opened this issue Mar 1, 2024 · 3 comments
Open

Question: headings not working #185

user41284863 opened this issue Mar 1, 2024 · 3 comments
Labels

Comments

@user41284863
Copy link

user41284863 commented Mar 1, 2024

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
Copy link
Member

pllim commented Mar 1, 2024

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

@pllim pllim added the question label Mar 1, 2024
@user41284863
Copy link
Author

@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
Copy link
Member

pllim commented Mar 4, 2024

Did you try to ask Sphinx developers first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants