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

[Ray Serve] Copy and paste code snippet also copies line numbers #40936

Open
robertnishihara opened this issue Nov 3, 2023 · 4 comments
Open
Labels
docs An issue or change related to documentation P2 Important issue, but not time-critical

Comments

@robertnishihara
Copy link
Collaborator

robertnishihara commented Nov 3, 2023

Description

On this page https://docs.ray.io/en/latest/serve/model_composition.html

When I click the "copy" button in the upper right corner of the code snippet, it copies all of the line numbers (which prevents the example from working).

Screenshot 2023-11-03 at 11 08 57 AM

This is what it looks like after pasting the code into an editor (the line numbers should not be pasted).

Screenshot 2023-11-03 at 11 10 07 AM

This is probably a problem in multiple places in our documentation, not just here.

Link

No response

@robertnishihara robertnishihara added triage Needs triage (eg: priority, bug/not-bug, and owning component) docs An issue or change related to documentation labels Nov 3, 2023
@angelinalg
Copy link
Contributor

This is a known problem. The workaround is to turn off line numbers, but in these cases the line numbers are needed to refer to specific lines of code in the docs. This is a docs infrastructure/tooling issue. @peytondmurray, do you have any ideas on how to fix this?

@angelinalg angelinalg added P2 Important issue, but not time-critical and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 7, 2023
@peytondmurray
Copy link
Contributor

peytondmurray commented Nov 7, 2023

I was never able to reproduce this issue on my local machines, and I expect it to depend on what browser and what version you're using. There are CSS styles which control the selectability of elements, but they're browser-dependent. Even forcibly overriding the styles of the <span> elements that contain the numbers didn't seem to work for @angelinalg. Being unable to replicate the problem I'm unsure exactly what the best way to proceed with this issue would be. See #39652 for more information.

@peytondmurray
Copy link
Contributor

I can spend a little time digging into sphinx_copybutton to see if there's something there I can change. For now, I'd propose closing this issue as a duplicate of #39652.

@angelinalg
Copy link
Contributor

This issue is slightly different from #39652, which is doing a copy and paste. @MattEWeber is able to reproduce this one, which uses the "copy" button, but not #39652. I suggest we keep both open as they seem to be different mechanisms.

@peytondmurray peytondmurray removed their assignment Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs An issue or change related to documentation P2 Important issue, but not time-critical
Projects
None yet
Development

No branches or pull requests

3 participants