pydata-sphinx-theme icon indicating copy to clipboard operation
pydata-sphinx-theme copied to clipboard

Remove class prefix from heading in Page Contents created by autodoc.

Open Maurycyt opened this issue 10 months ago • 1 comments

I am using a custom template which contains the following code:

*****************
Attribute details
*****************
{% for item in attributes %}
.. autoattribute:: {{ item }}
{% endfor %}

Here, {{ item }} is only the name of the method, not the method name with the class prefix. I ommited some formatting from the template, but this is the main gist.

The result is that, if I have a class called MyClass with a method called myMethod, then the method will be documented as myMethod, but the page contents navbar on the right will still contain MyClass.myMethod.

I attach the following screenshots: image image

I would like to remove the class name from the heading in the second screenshot, which shows the Page Contents section.

I did not find any way to achieve this, officially supported or otherwise.

At the same time, I apologize if this isn't the right place for this issue. I realise that the autodoc directive seems to generate the code, but at the same time, it's the theme which provides the contents section. Maybe the theme influences or can influence how the directive works.

Maurycyt avatar Aug 08 '23 12:08 Maurycyt