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

Feature Request: Add Copy Button to Code Snippets in OnchainKit Documentation #1256

Open
3 tasks
Elishaokon13 opened this issue Sep 14, 2024 · 2 comments
Open
3 tasks

Comments

@Elishaokon13
Copy link

Elishaokon13 commented Sep 14, 2024

Issue Summary

Currently, the OnchainKit documentation lacks a copy button for code snippets, making it inconvenient for developers to quickly copy and paste the provided examples into their projects. This feature request proposes adding a copy button to all code blocks to enhance usability and improve the overall developer experience.

Motivation

  • Increased Efficiency: A copy button would allow developers to quickly copy the code without having to manually select text, reducing time and errors.
  • Improved Developer Experience: Many popular documentation sites include this feature, and adding it to OnchainKit will bring the docs in line with modern standards.

Proposed Solution

  • Implement a copy-to-clipboard button for all code snippets in the documentation.
  • The button should appear at the top-right corner of the code block.
  • When clicked, it should copy the entire code snippet to the user’s clipboard and provide a success notification (e.g., "Copied!").

Acceptance Criteria

  • A copy button is visible on all code snippets in the OnchainKit documentation.
  • Clicking the button copies the entire code block to the user’s clipboard.
  • A small notification (e.g., "Copied!") confirms the action.

Priority: Medium

Describe alternatives you've considered.

No response

@Zizzamia
Copy link
Contributor

Love that!

We use https://vocs.dev for our docs, and I think the issue here is that they miss this functionality (at least I believe so).

If you have some extra time, would love some help from you in adding this feature to Vocs, or just help us figure out how to do it.

Right now how priority is to complete twoslash support for the entire codebase. But after that we can start take a look on this as well.

@Elishaokon13
Copy link
Author

I have some time

I'll take it up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants