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

Add the ability to copy the Code blocks #31

Open
aManNamedJed opened this issue May 4, 2021 · 1 comment
Open

Add the ability to copy the Code blocks #31

aManNamedJed opened this issue May 4, 2021 · 1 comment
Labels
feature request New feature or request good first issue Good for newcomers

Comments

@aManNamedJed
Copy link
Contributor

aManNamedJed commented May 4, 2021

Right now folks reading the documentation might have a hard time copying and pasting some of the commands to spin up a new site, etc. It would be awesome to have a little header at the top of the CodeBlock that had a simple Copy link that would copy the code to the user's clipboard. I saw this useClippy package and used it before, it's pretty simple and is supported accross all OS, etc.

https://www.npmjs.com/package/use-clippy

@aManNamedJed aManNamedJed created this issue from a note in Development Kanban (To do) May 4, 2021
@aManNamedJed aManNamedJed added feature request New feature or request good first issue Good for newcomers labels May 4, 2021
@benhalverson
Copy link

benhalverson commented Jun 25, 2021

Are you looking for something like this?

https://github.com/nodejs/nodejs.dev/blob/main/src/components/ShellBox/index.tsx
You can see the usage here https://nodejs.dev
https://nodejs.dev/storybook/?path=/story/installtabs--root

      <ShellBox textToCopy="curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash">
        <span className="install__text__no-select">$</span>
        <span className="install__text__command"> curl -o- </span>
        https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh{' '}
        <span className="install__text__command">| bash</span>
      </ShellBox>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request good first issue Good for newcomers
Projects
Development

No branches or pull requests

2 participants