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 a code path heading to the code block #38381

Closed
danilo-leal opened this issue Aug 8, 2023 · 4 comments · Fixed by #41487
Closed

[docs-infra] Add a code path heading to the code block #38381

danilo-leal opened this issue Aug 8, 2023 · 4 comments · Fixed by #41487
Assignees
Labels
design This is about UI or UX design, please involve a designer enhancement This is not a bug, nor a new feature scope: docs-infra Specific to the docs-infra product

Comments

@danilo-leal
Copy link
Contributor

danilo-leal commented Aug 8, 2023

Problem

Sometimes, we want to say what is the name of the file a certain code block is part of. There are multiple instances of this throughout the documentation, and we seem to do it in different ways here and there:

  • Just mentioning the file name and bolding the text.
  • Back-ticking the file name within a paragraph.
  • Back-ticking the file name outside of a paragraph.
  • etc.

We could be much more polished and potentially clearer if we included this information within the code block. Sometimes, it can be a good redundancy, too ⎯ we don't need to remove the paragraph introduction to the file.

Screen Shot 2023-08-08 at 11 02 51 Screen Shot 2023-08-08 at 11 03 35 Screen Shot 2023-08-08 at 11 17 08

Solution design

There might be exciting challenges to pulling this off from a code perspective, but as far as design, this is what I'm thinking of. We could even add the ability to display longer paths if that makes sense.

Screen Shot 2023-08-08 at 11 03 35
@danilo-leal danilo-leal added status: waiting for maintainer These issues haven't been looked at yet by a maintainer design This is about UI or UX design, please involve a designer scope: docs-infra Specific to the docs-infra product and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 8, 2023
@alexfauquette
Copy link
Member

Sounds interesting

Should it be compliant with the codeblock where code gets a tab on top of it or no?

@danilo-leal
Copy link
Contributor Author

@alexfauquette that's up to you! I don't have any preferences on the DX side here ⎯ whatever you deem best. But it should work if the code block has tabs, too, in case we want to have both (tabs & file path).

@oliviertassinari oliviertassinari added the enhancement This is not a bug, nor a new feature label Oct 8, 2023
@alexfauquette alexfauquette removed their assignment Oct 26, 2023
@danilo-leal
Copy link
Contributor Author

@bharatkashyap I'm curious if you have any thoughts or ideas about this one! 😬

@bharatkashyap
Copy link
Member

@danilo-leal I really like your proposed solutions, and thought of the tabs we implemented for the Toolpad landing page:

Screenshot 2023-10-28 at 10 27 46 AM

I feel like what Alex mentioned about being compliant with the proposed multiple tabs solution might help us unify the efforts, so I think the image you showed of the filename header coupled with an easy way to hide the breadcrumbs in case of multiple tabs might help us create a solution that scales.

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 enhancement This is not a bug, nor a new feature scope: docs-infra Specific to the docs-infra product
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants