RedHat-UX / red-hat-design-system

Red Hat's Design System
https://ux.redhat.com
MIT License
96 stars 18 forks source link

[docs] Add an "View source on GitHub" link on Element pages #1442

Open markcaron opened 8 months ago

markcaron commented 8 months ago

Adding an "View source on GitHub" link on Element pages, which will take the user directly to the Element's code in GitHub would be beneficial in learning more about the element in GitHub as well as potentially getting more contributors.

bennypowers commented 8 months ago

great idea!

marionnegp commented 7 months ago

@coreyvickery @markcaron , I think a "View source on GitHub" CTA can go below the sample component. What do you think? I also thought about moving it below the demo, but depending on the height of the code block, it might be far down the page. (Figma link)

Screenshot 2024-02-20 at 10 02 50 AM

coreyvickery commented 7 months ago

@marionnegp I think I'm good with just adding a link until the new playground is designed.

marionnegp commented 2 months ago

This link has been added to the bottom of each demo section.

bennypowers commented 2 months ago

I'd still like to add a link for each element, which would link not specifically to the demo file, but to the element source directory

bennypowers commented 2 months ago

putting the link below the sample element would require us to either:

  1. add a link manually to each and every element overview.md file or
  2. write a transform for each file would would find that section and append the link

Instead, can we put it in the header or footer?

mockup

image

bennypowers commented 2 months ago

or perhaps it would always be the last nav tab, with an 'external link' icon image

coreyvickery commented 2 months ago

@bennypowers

or perhaps it would always be the last nav tab, with an 'external link' icon image

Getting a bit crowded with the new Demos tab.

putting the link below the sample element would require us to either:

add a link manually to each and every element overview.md file or write a transform for each file would would find that section and append the link

Guessing this is tedious and not ideal?

coreyvickery commented 1 month ago

@bennypowers Making sure you saw the above.

zeroedin commented 2 weeks ago

Reference #1882

Could likely do something similar and link to the Github source for elements.

coreyvickery commented 2 weeks ago

@zeroedin Do we still need to do this? I see it repeated a lot on the Demos pages in the element code blocks.

bennypowers commented 2 weeks ago

this needs design before we can proceed

bennypowers commented 2 weeks ago

@coreyvickery those links are to view the source for each particular demo file on github e.g. https://github.com/RedHat-UX/red-hat-design-system/blob/main/elements/rh-card/demo/grid.html

but this issue is for adding a link to view the element definition's source e.g. https://github.com/RedHat-UX/red-hat-design-system/blob/main/elements/rh-card/

bennypowers commented 1 week ago

bumping to cubone since design isn't ready