tektoncd / website

Tekton Website
https://tekton.dev
Apache License 2.0
62 stars 149 forks source link

Implement click-to-copy for code listings #446

Closed geriom closed 1 year ago

geriom commented 1 year ago

Changes

Implement click-to-copy for code blocks. Code blocks with no syntax highlight won't show the button, useful to show command outputs that are not supposed to have syntax highlighting and don't need to be copied.

Additional changes:

Screenshots

Normal view Mouseover Clicked
Screenshot from 2022-09-21 10-03-36 Screenshot from 2022-09-21 10-03-44 Screenshot from 2022-09-21 10-03-51

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you review them:

See the contribution guide for more details.

geriom commented 1 year ago

I will submit this same feature eventually to Docsy, but it requires some extra work because it will clash with the Prism syntax highlighter (we use the default Chroma highlighter) and there can be some push back if I have to implement a breaking change there, so I don't know how long that will take. We can have it for now and when this eventually makes it to Docsy we can delete this code and use the theme as is.

alhuizenga commented 1 year ago

Very excellent, thanks Geri.

geriom commented 1 year ago

Thank you @AlanGreene! I applied your suggestions, TAL.

tekton-robot commented 1 year ago

@AlanGreene: cat image

In response to [this](https://github.com/tektoncd/website/pull/446#pullrequestreview-1117317412): >Looks good, thanks Geri. >/lgtm >/meow Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
alhuizenga commented 1 year ago

/lgtm

dibyom commented 1 year ago

/approve

tekton-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/tektoncd/website/blob/main/OWNERS)~~ [dibyom] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment