thegreenwebfoundation / developer-docs

The developer documentation site for The Green Web Foundations open source libraries.
https://developers.thegreenwebfoundation.org
Apache License 2.0
5 stars 13 forks source link

Add a Click to Copy Button for Code Blocks in docs #36

Open tarunsinghofficial opened 5 months ago

tarunsinghofficial commented 5 months ago

Is your feature request related to a problem? Please describe: It is important to have a "copy" button available on code blocks in the documentation. This will allow users to easily copy the entire code without accidentally leaving any important parts behind.

Describe the solution you'd like: We will use JavaScript to implement the copy functionality throughout the complete documentation, allowing for a specific code block to be copied.

Steps to reproduce:

Screenshot: image

tarunsinghofficial commented 5 months ago

I will be happy to work on this, please assign this to me. Thanks

fershad commented 5 months ago

@tarunsinghofficial thanks for the suggestion.

We'd like to keep our frontend code as light as possible, and so would appreciate a solution that:

  1. Uses minimal JavaScript
  2. Does not use any external libraries, frameworks, or scripts

Could you share your ideas around this.

kelvinparmar commented 5 months ago

Hey @fershad you are trying to say copy the commands that is written for installation for that you need to copy button? Am I write?

tarunsinghofficial commented 5 months ago

@tarunsinghofficial thanks for the suggestion.

We'd like to keep our frontend code as light as possible, and so would appreciate a solution that:

  1. Uses minimal JavaScript
  2. Does not use any external libraries, frameworks, or scripts

Could you share your ideas around this.

Thank you for considering the suggestion. I completely understand the importance of keeping the frontend lightweight and free from external dependencies.

To address the requirement of implementing a "copy" button without relying on heavy JavaScript frameworks or external scripts, we can explore a simple and lightweight solution. We can use simple javascript to add the copy functionality.

I'll start working on implementing this solution and will keep you updated on the progress. If you have any further suggestions or concerns, please feel free to share.

tarunsinghofficial commented 5 months ago

Hi @fershad ,

I have created the feature. Check out PR #38. Thanks