Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC fix behavior of copy button in installation instructions #27052

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

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

tuscland
Copy link
Contributor

@tuscland tuscland commented Aug 11, 2023

Reference Issues/PRs

Fixes #26948

What does this implement/fix? Explain your changes.

In doc/install.rst, the code blocks that contained conditionally displayed shell commands have been replaced with conditionally displayed code blocks.

Any other comments?

I lightly reorganized the shell commands and fix an incorrect linux command (python cvs python3).
I am not happy with the HTML code formatting, but this is the best compromise I found dealing with pre-formatted code blocks.

@github-actions
Copy link

github-actions bot commented Aug 11, 2023

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: fae7e61. Link to the linter CI: here

Copy link
Member

@betatim betatim left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I tested on the HTML page rendered by the CI and it seems to work.

However:

I lightly reorganized the shell commands and fix an incorrect linux command (python cvs python3).

The use of the python command instead of python3 on Linux when using a virtualenv with pip was intentional. Indeed in an activated venv it is expected to always use the python command, whatever the Python version.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

I mean to put my above review in "request changes" mode.

@tuscland tuscland force-pushed the doc_split_code_blocks-26948 branch from fd12805 to fae7e61 Compare August 21, 2023 16:37
@tuscland
Copy link
Contributor Author

I reverted to the previous logic, that is, when a virtual environment is selected, shell commands used to check the installation are identical across operating systems.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM as well. We could probably move the inline prompt1 CSS class to the theme.css file but let's keep that for another PR.

We could alternatively define a new class (to be added to the parent div) to insert the $ before content on each span using a .prompt-eachline pre scoped CSS rule instead of having to insert class="prompt1 on each span tag. We could then probably drop the span tags in the process.

@tuscland
Copy link
Contributor Author

The span.prompt1:before is inlined by sphinx-prompt during html generation (see sphinx-prompt init code).

I agree this CSS should be internalized, however I don't see a javascript-free way of getting rid of the spans.

I will follow-up in another PR.

@ogrisel
Copy link
Member

ogrisel commented Aug 22, 2023

The span.prompt1:before is inlined by sphinx-prompt during html generation (see sphinx-prompt init code).

Thanks, I was not aware of that. I think it's good enough then (but still feel free to attempt something cleaner in a follow-up if you wish).

@ogrisel ogrisel merged commit 20c301b into scikit-learn:main Aug 22, 2023
@tuscland tuscland deleted the doc_split_code_blocks-26948 branch August 23, 2023 13:59
akaashpatelmns pushed a commit to akaashp2000/scikit-learn that referenced this pull request Aug 25, 2023
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Sep 18, 2023
REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The copy button on install copies an extensive comman including env activation
3 participants