-
-
Notifications
You must be signed in to change notification settings - Fork 919
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
docs: display all signatures #3030
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3030 +/- ##
========================================
Coverage 99.96% 99.97%
========================================
Files 2776 2776
Lines 226338 226338
Branches 589 943 +354
========================================
+ Hits 226267 226275 +8
+ Misses 71 63 -8 |
thoughts: this come with some downsides regarding UX using CTRL+F |
This definitely seems confusing to navigate. There is no way to know what signature you need without clicking on all of them. Having a single table with all the parameters like currently seems more intuitive. |
That would probably be solved by giving them names.
Or
How about greying out the ones not applying to the current signature?
Any suggestions? |
I thought about something like this: https://quasar.dev/vue-components/tab-panels#with-qtabs If we dont find something nice that still works in terms of UX, we might even leave as is 🤷 |
How about horizontal scrolling? |
maybe, feel free to try and experiment |
Horizontal UI results in weird behavior/UX and I wasn't able to make it look good (or visible that you can actually scroll there horizontally). @xDivisionByZerox Any ideas on how to display multiple signatures? |
I can try to come up with a prototype tomorrow 👍 |
I'm not really sure showing multiple signatures is necessary. Given most methods have very simple signatures (just passing an options object). Showing a good set of examples is probably easier to quickly grasp than showing all the signatures. |
This PR changes the docs by showing all api signatures of a method instead of only the last one.
Single Signature
https://deploy-preview-3030.fakerjs.dev/api/color.html#csssupportedfunction
Multi Signature
https://deploy-preview-3030.fakerjs.dev/api/color.html#cmyk
No Args
With Options
Not sure whether we should merge this first and then find a way to name the signatures or vice versa.