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

Return members in the same given order #29

Open
pawamoy opened this issue May 1, 2020 · 6 comments
Open

Return members in the same given order #29

pawamoy opened this issue May 1, 2020 · 6 comments

Comments

@pawamoy
Copy link
Member

pawamoy commented May 1, 2020

Is your feature request related to a problem? Please describe.
Feature asked in mkdocstrings: mkdocstrings/mkdocstrings#102 (comment)

Describe the solution you'd like

  • pytkdocs should re-order the root object children using the given members order.
  • For this we'll need to stop casting members as a set, and keep it as a list.
  • Before returning the root object, we'll then need to re-order them.
  • Let's make it the default, not configurable behavior (sorting is more a rendering issue, we shouldn't implement rendering configuration in pytkdocs)

Describe alternatives you've considered
It's easier to do it in pytkdocs than re-sorting in mkdocstrings: the renderer and collector options are separated, it would be messy to use the collector options in the renderer, and I don't want to duplicate the members option in the renderer (nor users want to copy/paste it).

@ofek
Copy link

ofek commented Jan 25, 2021

Hello again! Has this been fixed/implemented?

@pawamoy
Copy link
Member Author

pawamoy commented Sep 21, 2021

8 months later...

No 😕
PRs welcome. I'm currently reducing the number of open issues to keep the ones we could still implement/fix in pytkdocs (which will be replaced by a more robust tool).

@ofek
Copy link

ofek commented Nov 24, 2021

@pawamoy Hmm, I see your preferred solution but wouldn't it make more sense to have the renderer read the members and act accordingly? Especially since the renderer has since added a new sorting option mkdocstrings/mkdocstrings#274

@pawamoy
Copy link
Member Author

pawamoy commented Dec 14, 2021

@ofek sorry for the late reply 🙇

have the renderer read the members and act accordingly

Unfortunately that is not possible, because mkdocstrings passes the selection options only to the collector, not the renderer. I wouldn't be against a refactor that removes the distinction between these two options groups (no more selection/rendering keys, no more base renderer / base collector classes, just a base handler one that receives all options). Up to the discussion of course.

I'll try to come up with a workaround in the next few days (keeping that issue in my saved notifications).

Also note that I've been working on a new "collector" which might alleviate this issue. I'll try to move forward on this in the next few days as well.

@pawamoy
Copy link
Member Author

pawamoy commented May 28, 2022

This should now be fixed (finally 🥵!), at least with the new Python handler.

@pawamoy pawamoy closed this as completed May 28, 2022
@pawamoy
Copy link
Member Author

pawamoy commented May 28, 2022

Ah, but we're in the pytkdocs repo here 🤦
So it's not fixed. But it can now be fixed. Reopening.

@pawamoy pawamoy reopened this May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants