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

docs(code): Introduce copy code feature #1697

Merged

Conversation

thisisommore
Copy link
Contributor

@thisisommore thisisommore commented Aug 2, 2021

What does this change

Adds copy button to every command in docs
Copy button can be used to quickly copy commands which saves time especially when commands are long

image

What issue does it fix

Closes #1688

Notes for the reviewer

I have not tried to put the copy button to the right of the code since it takes space resulting in reducing the code view area.
The button in the top right looks nicer.

Checklist

  • Unit Tests
  • Documentation
  • Schema (porter.yaml)

Signed-off-by: thisisommore <ommore501@gmail.com>
@thisisommore thisisommore force-pushed the thisisommore/introduce-copy-button-1688 branch from b96f4d8 to 938440a Compare August 2, 2021 08:41
@carolynvs
Copy link
Member

Some code blocks are not meant to be copy/pasted. For example when we are showing an example command and its output.

Those code blocks have the CSS class language-console. It's not a huge deal but can we hide the copy button for those code blocks? Or do you think that there is still value in having them copy an un-runnable command?

Screen Shot 2021-08-03 at 8 20 21 AM

@carolynvs carolynvs self-assigned this Aug 3, 2021
@thisisommore
Copy link
Contributor Author

Agreed!, I will make changes and push it.

Additional changes
-Added comments to explain whole code where necessary
-Renamed ele to preElement

Signed-off-by: thisisommore <ommore501@gmail.com>
@thisisommore thisisommore force-pushed the thisisommore/introduce-copy-button-1688 branch from 7f6eb05 to 19d6e8c Compare August 4, 2021 04:24
Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really useful, thank you for adding this to our documentation! 🎉

@carolynvs carolynvs merged commit 7fa4427 into getporter:main Aug 5, 2021
@thisisommore thisisommore deleted the thisisommore/introduce-copy-button-1688 branch August 6, 2021 01:40
@carolynvs carolynvs mentioned this pull request Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce copy button for docs
2 participants