-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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] Allows to use codeblock in the docs #37643
[docs-infra] Allows to use codeblock in the docs #37643
Conversation
@alexfauquette Great improvements! |
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.
Very nice!
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.
A great addition to the docs! Thanks for working on this @alexfauquette @siriwatknp 🎉
}), | ||
); | ||
|
||
const STORAGE_KEY = 'package-manager'; |
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.
Should be configurable?
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.
Nice idea. Now it's feasible to do <codeblock storageKey="package-manager">
which will save the value in the key codeblock-package-manager
. I'm adding codeblock-
to avoid naming collisions.
@@ -0,0 +1,144 @@ | |||
import * as React from 'react'; |
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.
The selected state is acting weird after a few time switching between tabs:
Screen.Recording.2023-06-29.at.13.01.25.mov
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.
Fixed
@siriwatknp I noticed, you used <Tab slot={{ root: StyledTab }} />
instead of doing StyledTab = styled(Tab)
Moving from the first to the second strategy fixed the bug. But I'm wondering if their is a reason to choose the first one?
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.
Nice! 👍
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.
👍
@samuelsycamore You can now update all the install script you want on core :) |
Iteration over the #36766
Preview: https://deploy-preview-37643--material-ui.netlify.app/experiments/docs/installation/
Context
This PR solves the same issue as #36766 : Allowing to have tabs into code. But instead of using a component with some props, it's directly set into the markdown with a
<codeblock />
wrapping multiple codes.codeblocks with the same
storageKey
will save their value in the same placeWhich difference with initial PR
I did not keep the selected interface
The main reason was the management of the configuration, which does not feat well with their
<codeblock>
and it's very edge case to have those selects. So I assumed we will create a dedicated component for that based on<HighlightedCodeWithTabs/>