-
Notifications
You must be signed in to change notification settings - Fork 868
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 not sort Enum values #2285
Comments
makes sense. I think code change is needed. @vwxyzh Any idea? |
I second this request. I was initially thinking of sorting on their numerical value, but having the original order would be much better. |
Any changes here? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This would still be really useful, any chance it at least will be scheduled? |
Sorry, it is not our current priority. However, this is a valid feature request that will not be marked as |
Any updates for this? |
Hello there, You can do it easily with a few line of Javascript. Create a extension for the preprocessor (see here) with the following code :
I extract the "enum value" from the Syntax's content by using a regex and I set this value to the model. Then I can sort the enum values. You can also display the "Enum value" in the "enum.tmpl.partial" :
Enjoy 👍 |
The Javascript extension is good, but I do think this ought to be a docfx option. It's just more intuitive. |
This is not just a cosmetic issue. Often, enum values are used in |
Can somebody detail the steps required for the custom JS plugin to work? I've tried adding the files in my custom template to no avail, not sure how DocFX is supposed to discover them but apparently it's not a matter of just placing them there. Thanks |
Any updates on this please? |
Years ago, I used Sandcastle to generate API docs for a C++/CLI project. It turned out that the C++/CLI compiler shuffled the order of enum constants in the ECMA-335 metadata so that it did not match the lexical order of declarations, the alphabetic order of names, nor the numeric order of values. I don't know whether the C# compiler is more predictable in this respect, or whether the deterministic compilation option affects this. |
DocFX Version Used: docfx 2.28.2.0
I'm letting docfx extract the metadata for my API reference from a .csproj. In the API reference all members are sorted. That's great, but I'd like enum values to stay in the original order as it makes more sense that way.
Is there currently a possible work around or extension to achieve this?
The text was updated successfully, but these errors were encountered: