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

Option to list enums in declared order #131

Open
lufinkey opened this issue Sep 19, 2022 · 2 comments
Open

Option to list enums in declared order #131

lufinkey opened this issue Sep 19, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@lufinkey
Copy link

When enum values are listed, they seem to be listed in alphabetical order. Is there any way to specify this in the configuration? I'd like to be able to choose to output them in Declared order, but i'm sure others would also appreciate a Numerical order option as well

@Doraku
Copy link
Owner

Doraku commented Sep 20, 2022

ah yes it actually totally make sense to use the declared order. The problem comes from here
https://github.com/Doraku/DefaultDocumentation/blob/master/source/DefaultDocumentation.Markdown/Extensions/IGeneralContextExtension.cs#L77
which order the children by their full name. It should be possible to change it by overriding ChildrenSection.GetChildren for EnumFieldsSection.
Not sure there is a need to choose between the two, I think almost everyone would want the same order as the one in their code?

@Doraku Doraku added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Sep 20, 2022
@lufinkey
Copy link
Author

You might want to generalize it to classes as well, as I think people might also want to set the order that fields appear in (declaration vs alphabetical). So in this case an order field might make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants