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

fixed copy code block bug #448

Merged
merged 2 commits into from
Oct 7, 2024
Merged

fixed copy code block bug #448

merged 2 commits into from
Oct 7, 2024

Conversation

melodywang060
Copy link
Contributor

Problem

Currently the entirety of the multiline command isn't copied over when users hit the copy code block button (only the first line)

Quick Fix

Turning the multiline block into a single line

Pros

More convenient for users to copy and paste

Cons

May be harder to read and interpret each of the configurations in the arguments

@melodywang060 melodywang060 requested a review from a team as a code owner October 7, 2024 16:25
@melodywang060 melodywang060 linked an issue Oct 7, 2024 that may be closed by this pull request
Copy link
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Thanks! Left a suggestion for your consideration.

$ gcloud container clusters create rapids-gpu-kubeflow \
--accelerator type=nvidia-tesla-a100,count=2 --machine-type a2-highgpu-2g \
--zone us-central1-c --release-channel stable
$ $ gcloud container clusters create rapids-gpu-kubeflow --accelerator type=nvidia-tesla-a100,count=2 --machine-type a2-highgpu-2g --zone us-central1-c --release-channel stable
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$ $ gcloud container clusters create rapids-gpu-kubeflow --accelerator type=nvidia-tesla-a100,count=2 --machine-type a2-highgpu-2g --zone us-central1-c --release-channel stable
$ gcloud container clusters create rapids-gpu-kubeflow --accelerator type=nvidia-tesla-a100,count=2 --machine-type a2-highgpu-2g --zone us-central1-c --release-channel stable

I don't think we want multiple leading $, can you please remove one?

Copy link
Member

Choose a reason for hiding this comment

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

Actually... could you test something? Could you push a change here to remove ALL the leading $ in this code block, and put back the multi-line break? Then we could use the preview at https://rapids-deployment--448.org.readthedocs.build/en/448/cloud/gcp/gke/ to test if the copy button does the expected thing in that case, and could consider just dropping the leading $.

I really think that'd be preferable if it does work... look how much information is hidden by putting this on 1 line:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yay I tested it on a local server and it works! I'll push those changes right now

Copy link
Member

Choose a reason for hiding this comment

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

Ah great, glad that worked! I just tried on the docs preview and also confirmed it works as expected. And I think it's great that it now renders with the entire command visible:

image

Could you please open an issue documenting the work to remove these leading $ from all the shell blocks across this repo?

I've always found them a little annoying anyway (because you have to manually exclude them when copying in a place that doesn't have the copy-button logic that filters them out), and now we have a specific functional reason to prefer not having them.

Don't actually do that implementation work though (except for other multi-line cases like this one where it's necessary to fix them), until @jacobtomlinson gives us his opinion on the issue.

Copy link
Member

@jacobtomlinson jacobtomlinson Oct 8, 2024

Choose a reason for hiding this comment

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

I have a few thoughts on this, @melodywang060 if you could open the issue that James suggested then we can discuss it over there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good, I'll open it up right now 👍🏼

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New issue and documentation is here: #452

@jameslamb jameslamb merged commit da85da7 into main Oct 7, 2024
4 checks passed
@jameslamb jameslamb deleted the gcp-gke branch October 7, 2024 18:16
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.

https://docs.rapids.ai/deployment/nightly/cloud/gcp/gke
3 participants