Skip to content
This repository was archived by the owner on Oct 20, 2026. It is now read-only.
This repository was archived by the owner on Oct 20, 2026. It is now read-only.

Return members in the same given order #29

Closed as not planned
Closed as not planned

Description

@pawamoy

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).

Activity

  1. ofek commented on Jan 25, 2021

    @ofek

    Hello again! Has this been fixed/implemented?

  2. pawamoy commented on Sep 21, 2021

    @pawamoy
    MemberAuthor

    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).

  3. ofek commented on Nov 24, 2021

    @ofek

    @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

  4. pawamoy commented on Dec 14, 2021

    @pawamoy
    MemberAuthor

    @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.

  5. pawamoy commented on May 28, 2022

    @pawamoy
    MemberAuthor

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

  6. pawamoy commented on May 28, 2022

    @pawamoy
    MemberAuthor

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

  7. pawamoy commented on Oct 24, 2024

    @pawamoy
    MemberAuthor

    If there are still users of pytkdocs who are interested in this, please let us know what is preventing you from migrating to the new handler (using Griffe instead of pytkdocs)! Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions