python classmethods are formatted strangely using autodoc

robwhess avatarrobwhess created an issue

I'm using autodoc to document a python package (mainly with automodule), and I've found that in the generated HTML documentation, python classmethods have strange formatting that makes them hard to find (in particular, they're missing a horizontal rule to separate them from the function above, as normal functions do). See the attached screenshot for an example.

I browsed through the code for a bit to see where this might be happening, but I wasn't able to trace down the problem. I might be able to fix this myself with more guidance about where it's happening.

Comments (4)

  1. robwhess

    I forgot to point this out initially, but it may be related: it was my understanding that classmethods were supposed to appear first in the function listing when using autodoc, but this is also not the case. They instead appear in alphabetical order along with the rest of the class's methods.

  2. Georg Brandl

    The horizontal line is not present in any built-in Sphinx themes. A custom theme adds it, and apparently does not catch all CSS classes that it should. ("dl.classmethod" instead of "dl.method"). Please report this to the theme author.

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.