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

Split EKS commands and outputs for better copy and paste #841

Merged
merged 3 commits into from
Oct 3, 2023
Merged

Conversation

simonrw
Copy link
Contributor

@simonrw simonrw commented Oct 3, 2023

Motivation

When starting an EKS cluster, I was copying the commands from the docs but the output was copied along with the commands.

Changes

  • Split the command and output into separate code blocks

@simonrw simonrw self-assigned this Oct 3, 2023
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-841.surge.sh 🎊

Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Great that you are changing the docs right when coming across issues!
For some of the changes in the PR it might make sense to use the new feature @webdev51 implemented: #804 (comment)
Wit that you can disable the copying for certain sections within the command, instead of separating command and output all the time (which sometimes makes sense, but sometimes disrupts the flow).

@simonrw
Copy link
Contributor Author

simonrw commented Oct 3, 2023

Great that you are changing the docs right when coming across issues! For some of the changes in the PR it might make sense to use the new feature @webdev51 implemented: #804 (comment) Wit that you can disable the copying for certain sections within the command, instead of separating command and output all the time (which sometimes makes sense, but sometimes disrupts the flow).

Thanks @alexrashed for the suggestion. I definitely prefer the output as rendered, however the copied command contains a newline at the end. An alternative is to do something like

{{< command >}}
$ pwd<disable-copy>
/
</disable-copy>
{{< / command >}}

which is a little ugly, but in general I prefer to not break up the reading flow as you say.

@alexrashed
Copy link
Member

Ah, interesting. A newline at the end really doesn't seem to be too nice when copy-pasting the commands.
Maybe we could fix the command shortcode to suppress the last newline?
Should be fixed somewhere around this line:
https://github.com/localstack/docs/blob/main/layouts/shortcodes/command.html#L6

@simonrw
Copy link
Contributor Author

simonrw commented Oct 3, 2023

Ah, interesting. A newline at the end really doesn't seem to be too nice when copy-pasting the commands. Maybe we could fix the command shortcode to suppress the last newline?

I have implemented this by trimming the whitespace from the copied text before sending to the clipboard.

Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Awesome! 💯

@simonrw simonrw merged commit a8c2f5d into main Oct 3, 2023
3 checks passed
@simonrw simonrw deleted the eks-copyable branch October 3, 2023 10:01
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.

3 participants