-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add group metadata to EEP48 #9183
Conversation
CT Test Results 2 files 70 suites 1h 7m 28s ⏱️ Results for commit ffc7372. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Yes, using The way that I did for us was like this:
For an examples see ssl, ssh and string. The code that does this lives here and I even wrote some docs. |
@garazdawi I see. I'd prefer to have one single and clear rule, so we either add "Type: " and "Function: " or we never add it. Then we can possibly add a new callback in ExDoc that configures the
So it is easy for you to convert from one default to another. I think this |
Sure, a simple rule makes sense. I don't mind either way as the default. I still think the ordering is important, so that function groups are always below the types + callback. |
I don't have any opinion or reservations on the ordering, so I am glad to defer to your preference. :) |
I just realised that the reference manual should also be updated, so I pushed a fixup commit. Feel free to squash if you agree and I'll merge this. |
I have been thinking a bit more about this from the shell side. When can we realistically use groups? We can definitely autocomplete a remote call and, in that case, looking up the docs chunk is necessary to avoid showing private functions, so we can get the group. However, would we show group for any local or import auto completion? Because those can come from several modules and they have already been imported anyway, I would say no? Also, should we show group for modules? That would require getting the docs chunk for every module, which is potentially too expensive. So we should show groups there. Are those ok? Also, groups in ExDoc have historically been atoms, but binary strings are likely better. So I would have to change this there internally too. |
I was thinking mainly for function completion. That is when you do: 1> string:<TAB>
Functions:
casefold( chomp( concat( .....
Obsolete API Functions
centre( chars(.... I think that would be the primary usecase. We can add more later on if we like, though for ExDoc it might be good to have ground for modules already now as you can use those already.
Not sure what you mean by this, if you mean functions defined in the shell session, at least we have a separate group for those already.
I think they can be binary strings already? or am I missing something? |
The ones defined in the shell OR imported, such as
Theoretically they cannot but it may just work today. :D |
What do you think @frazze-jobb? does this make sense for the shell? |
I like the idea.
Its already cluttered as it is when you just type:
I think it could make more sense with additional keys in expand mode to toggle sorting methods, and more navigation keys/or search to quickly jump to a certain group and select the function of interest. I'm also contemplating if we should support fuzzy matching of a function, but thats a topic for another day. |
Yes for deprecated, but I think that the shell should be considered a debug tool which should expose "-doc false" functions.
Yes, agreed, but right now |
Also changed one item to keep order alphabetical.
I squashed the changes and merged for release in Erlang/OTP 28. Thanks! |
Thank you! I have finished the changes to ExDoc, I will implement Group in the terminal today and report back. |
Ok, I have implemented it all works well. Let me know if you need further changes in ExDoc. If we can all use |
Also changed one item to keep order alphabetical.
For ExDoc, I propose that, if the group is used, it will still be prefixed by its type, such as "Functions" or "Types". For example, in Nx, you can imagine the functions below were tagged as:
group: "Aggregates"
,group: "Backend"
, etc.However, if you really want to override it, you can use the
groups_for_docs
configuration. Like done above, where "Guards" are getting its own group.@garazdawi would these conventions suit Erlang?