Doraku / DefaultDocumentation

Create a simple markdown documentation from the Visual Studio xml one.
MIT No Attribution
157 stars 26 forks source link

Option to list enums in declared order #131

Open lufinkey opened 1 year ago

lufinkey commented 1 year ago

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 commented 1 year ago

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?

lufinkey commented 1 year ago

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.