-
-
Notifications
You must be signed in to change notification settings - Fork 479
fix(docs): ensure class member order follows source #4436
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
base: main
Are you sure you want to change the base?
Conversation
3865d12
to
863a38d
Compare
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4436 |
Interesting find! Does this replicate in a fresh project? If so, I think you should submit this as a bug to https://github.com/sphinx-doc/sphinx/. As for the proposed fix on our side, I'm not entirely sure this is fine to do, since it would mean that only members of @euri10, got some thoughts on this? I know how much you like to consult documentation :) |
vey interesting finding yeah. i agree with you it would be confusing, and if i had to choose i'd sacrifice the order for the "correct" import. now the order is already weird to me in other cases, not just class member, if you look at https://docs.litestar.dev/main/reference/middleware/constraints.html for instance i find it weird to get exceptions before classes for instance, |
- Fixes issue where class members are sometimes listed alphabetically instead of by source in middleware documentation.(litestar-org#4393) - Updates references to use the base module.
863a38d
to
6b03aaa
Compare
Alright, then let's merge this and see if can can sort out the imports again once the bug has been fixed upstream. |
any issue to follow ? |
![]() Maybe we can consider alternatives like https://docusaurus.io/ ? |
idk https://docusaurus.io/ to be fair so I cant comment on this |
@euri10 Maybe this is expected behavior ? Because this is the sequence in source code and this PR haven't introduce relevant changes. litestar/litestar/middleware/constraints.py Lines 27 to 40 in 94073d3
|
yep sorry for the confusion i was speaking in general, its expected behaviour as you rightully say, with autoapi this would be ordered differently I think without thinking about how it's organized in source, |
Description
At first glance, other modules works fine. e.g. https://docs.litestar.dev/main/reference/middleware/logging.html#litestar.middleware.logging.LoggingMiddlewareConfig
After digging in, i found that if a class is imported into
__init__.py
viafrom ... import ...
and added to__all__
, Sphinx may lose the original source order of its members so i changed to document classes directly from their original module, rather than through indirect imports in__init__.py
.Closes
close #4393