-
-
Notifications
You must be signed in to change notification settings - Fork 32.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-infra] Add GitHub source link to components #43228
Conversation
@aarongarciah Should we wait for failing CIs ? |
Thanks for the contribution. Effectively, it's a quick win. I removed the autocolosing because the issue is about API pages. In that case the link should ba done by a script. Otherwise, it would be hard to keep something up to date. I'm modifying the way to define the path. The URL of the repo and the current branch are left to the config. The markdown only have the take care of the file path. Such that when releasing the new major, this feature does not require extra modifications |
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 left this PR open if someone want to give a second look at my modification. Otherwise I will mere it during at the end of the week
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.
Looks good to me, the only suggestion is if we want to relook at the order of the chips, and move the GitHub source one to be the first or second to indicate its priority.
Should we close #36824 after merge ? |
Answered in #43228 (comment) TLTR; no ;)
|
Are we sure about this change? It feels a bit strange in two ways:
|
size="small" | ||
variant="outlined" | ||
rel="nofollow" | ||
href={`${process.env.SOURCE_CODE_REPO}/tree/${process.env.SOURCE_GITHUB_BRANCH}/${headers.githubSource}`} |
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.
This link we break once we version the docs pages: Why not do the same thing as with the link to the source for the demos?
githubLocation={`${process.env.SOURCE_CODE_REPO}/blob/v${process.env.LIB_VERSION}${fileNameWithLocation}`} |
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.
Was not aware of this part of the code
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.
Alright, then I assume we can move to do the same 😄
About having links in API pages, I agree it would be more reliable and could be automated. For me they solve different issues:
|
@alexfauquette Maybe we could have a default logic that picks the first component listed in the
Would it be better if we were to only show the action if there is a single entry in the @colmtuite I'm curious about your view on this. https://www.radix-ui.com/primitives/docs/components/switch has a link to the source, which makes sense in this context and in the context of Base UI because of how the sources are organized: https://github.com/mui/base-ui/tree/master/packages/mui-base/src/Menu. We basically say to the developers, that if you import a Menu, you won't get tree shaking in dev mode for the menu components that you don't use. |
Adds a "Source" chip in component header links.
Chip links to their respective folder in
packages/mui-material
.Note:
LinearProgress
andCircularProgress
, the source chip can only link to one page, I have linked toLinearProgress
Part of #36824