-
Notifications
You must be signed in to change notification settings - Fork 133
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
Allow the choice of classes having their own page #226
Comments
I came here to report this issue. This is the behavior of This is the part of the sphinx-autoapi/autoapi/templates/python/module.rst Lines 110 to 112 in 85739d5
|
Hey, I just ended up here after hours of trying to get unique files for each object of a module... Is there already an existing workaround that can be used to tell sphinx-autoapi to create unique files for each In my opinion, having a unique page for each object would make the docs much less overwhelming... |
At PyAnsys we would like to use this feature. Thus, we are more than happy to contribute and develop it, although we may need some guidance @AWhetter. For the time being, we will update our However, we would prefer to have a page per class as most of our APIs are massive. This would improve readability and avoid having long and huge |
After taking a look to the source code, it looks like this is the method in charge of creating the doc source files prior Sphinx rendering: sphinx-autoapi/autoapi/mappers/base.py Lines 310 to 329 in 92437c9
Maybe, we could add a second loop if enabled through autoapi configuration to generate files for each module object: # conf.py
autoapi_render_in_single_page = ["class", "function"] As said before, any guidance is more than welcome, Ashley 👍🏼 |
Closing as implemented. |
In a project that contains few functions and many classes with a lot of methods, it might be desirable to be able to have classes create rst files rather than modules or in addition to modules. An example of such documentation would be the PySide documentation.
We need to add a new option to support this behaviour. I think it's fine for it to be specific to having Python classes in particular produce new pages, rather than it being a list where you define which type of objects you want to create new pages. I can't think of a use case where you would want a single function or a single module level attribute per page. Module pages can already by turned off by skipping them with the autoapi-skip-member event.
It's likely that the templates would need to change to make this behaviour make sense, but it's fine for us to only add the option and expect the user to customise their own templates.
The text was updated successfully, but these errors were encountered: