Skip to content
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 code block header classes #41487

Merged
merged 7 commits into from Mar 15, 2024

Conversation

danilo-leal
Copy link
Contributor

@danilo-leal danilo-leal commented Mar 13, 2024

An attempt at adding headers to code blocks that are usually useful when we want to display the file name of a certain code snippet. I have a feeling this is not the most efficient/elegant way to do πŸ˜… I still wanted to take a shot at pulling this off, but there might be better ways where the DX is similar to the custom <codeblocks> component, and cleaner. Possibly something like:

<codeblock header="File name">

{...code here}

</codeblock>

Closes #38381 (or not β€” in any case, let me know! I'm happy to ditch this PR if we don't think it's useful.)
Preview: https://deploy-preview-41487--material-ui.netlify.app/experiments/docs/codeblock/

In the ideal world, we'd have a solution that would appear like a breadcrumb, displaying the full path from where a code snippet belongs. This is not covered in this PR and another reason why this is potentially not the best solution 😬

@danilo-leal danilo-leal added design This is about UI or UX design, please involve a designer scope: docs-infra Specific to the docs-infra product labels Mar 13, 2024
@danilo-leal danilo-leal requested a review from a team March 13, 2024 20:43
@danilo-leal danilo-leal self-assigned this Mar 13, 2024
@mui-bot
Copy link

mui-bot commented Mar 13, 2024

Netlify deploy preview

https://deploy-preview-41487--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 9439a07

@siriwatknp
Copy link
Member

@danilo-leal Here is my proposal to follow Docusaurus.

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘ Thanks for starting this! I almost forgot about it, sorry for the delay.

@siriwatknp
Copy link
Member

@danilo-leal feel free to bypass CI and merge if you want.

@danilo-leal danilo-leal merged commit 4b591ff into mui:master Mar 15, 2024
20 of 21 checks passed
@danilo-leal danilo-leal deleted the add-code-path-header branch March 15, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design This is about UI or UX design, please involve a designer scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs-infra] Add a code path heading to the code block
3 participants