-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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: Visible type information. #13308
Conversation
That looks great to me! 👍👍👍 |
I do not think the foreground/background contrast, as proposed, is sufficiently legible. There are metrics for these things, but I expect someone could select reasonably-high-contrast colors and they would be fine. |
Pushed an update with higher contrast, matching the comments in our code blocks. I'll wait to update other pages until after r90 to avoid drift/conflicts on the PR and to get any other feedback. |
I think a different color scheme for the entire document is in order, quite frankly. I vote for clearly legible. |
Let's address that in another PR — showing type information at all, with the same legibility as example comments (slightly more legible, actually, since the background is lighter), is an improvement on hover-text-only, especially for touchscreen users. 🙂 |
This is awesome! 😄 |
f04c59a
to
ce4fd0b
Compare
ce4fd0b
to
c87bad1
Compare
A few prayers to the regex gods later, this PR should cover all of the docs now. 😅 |
I'm sure this change is very helpful to users. One thing, "return value type
This seems existing issue, so another PR would be good. |
Good point. Hiding the return type when there is no return value seems cleanest. Updated. |
docs/page.js
Outdated
text = text.replace( /\[(?:member|property|method):([\w]+) ([\w\.\s]+)\]/gi, "<a onclick=\"window.parent.setUrlFragment('" + name + ".$2')\" target=\"_parent\" title=\"" + name + ".$2\" class=\"permalink\">#</a> .<a onclick=\"window.parent.setUrlFragment('$1')\" title=\"$1\" id=\"$2\">$2</a> " ); | ||
text = text.replace( /\[(member|property|method|param):([\w]+)\]/gi, "[$1:$2 $2]" ); // [member:name] to [member:name title] | ||
text = text.replace( /\[(?:member|property|method):([\w]+) ([\w\.\s]+)\]\s*(\(.*\))?/gi, "<a onclick=\"window.parent.setUrlFragment('" + name + ".$2')\" target=\"_parent\" title=\"" + name + ".$2\" class=\"permalink\">#</a> .<a onclick=\"window.parent.setUrlFragment('" + name + ".$2')\" id=\"$2\">$2</a> $3 : <a class=\"param\" onclick=\"window.parent.setUrlFragment('$1')\">$1</a>" ); | ||
text = text.replace( / : <a class="param" onclick="window.parent.setUrlFragment\('\w+'\)">null<\/a>/gi, '' ); // remove null return types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this line. What's wrong with showing : null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets remove this line and the PR will be good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
Strange... I think that's caused by Rawgit — there are errors on the console about MIME types of the code highlighting CSS. It works when serving the @mrdoob I think you left a comment about handling
... where the EDIT: Oh there's your comment 😅 yeah i'm fine with leaving |
When a method return |
Codebase has 357 matches for |
Personally I wanna be strict with value type representation as much as possible so I wanna distinguish between return But, as I said, we can leave |
Yes please. |
This reverts commit fca1c62.
Sounds good, removed the line. Glad to consider other changes in another PR. 👍 |
Thanks! |
After this PR, I guess the |
Not functionally necessary, no. I like the pattern where the |
This came up in an issue at one point, so thought I'd suggest a way of displaying type information in the docs.
This just covers BufferGeometry, but I can update other pages if the approach is agreeable.PR now covers all pages. Method/property names would now use their own permalinks, with type information in a low-contrast color afterward.Demo — All docs