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

Feature: #9120

Merged
merged 1 commit into from May 2, 2021
Merged

Feature: #9120

merged 1 commit into from May 2, 2021

Conversation

V0lantis
Copy link
Contributor

Remove div.doctest in basic.css_t so that the selecting feature in snippets code
are not just available for doctests snippets. Basically, I want the following feature :

Capture d’écran 2021-04-20 à 11 50 36

which is available for every doctest, to be also available for basic snippet code.
For example, in the actual [Sphinx doc](https://www.sphinx-doc.org/en/master/usage/installation.html#installation-from-source), when we select a code's snippet, it also selects the $sign, which is annoying for multi line snippets :
Capture d’écran 2021-04-20 à 11 42 39

With the modification, we can now do :

Capture d’écran 2021-04-20 à 11 43 54

This PR is following #9101. I ask for discussion here, because I don't know what was intended span.gp at the first place. From my research, it has been introduced by @tk0miya, in #6727

* Remove `div.doctest` so that the selecting feature in snippets code
are not just available for doctests snippets
@tk0miya tk0miya added html theme type:proposal a feature suggestion labels Apr 25, 2021
@tk0miya tk0miya added this to the 4.1.0 milestone Apr 25, 2021
@tk0miya
Copy link
Member

tk0miya commented Apr 25, 2021

I ask for discussion here, because I don't know what was intended span.gp at the first place.

As the comment in the CSS file says, span.gp means "Generic.Prompt". They're considered as prompt by pygments; a highlighting library.

Note: What I commented in #9101 (comment) is here:

Indeed, it will be helpful for almost of users. But I can't say ALL of the people want to do that. So this would not be changed, I think.

I'm still debating this will not introduce troubles. I'd like to hear comments from @shimizukawa .

@shimizukawa
Copy link
Member

I think the prompt will get in the way if it is copied when we want to run the procedure as it is in the sample. The only situations I can think of where we would want to copy text with prompts are: 1) to tell people in chat, etc., or 2) to transcribe the same procedure into a document (including doctest).
In this sense, there are very few situations where we would want to copy and use either the $ symbol or the >>> symbol.

(As a side note, the official Python documentation includes a feature to show/hide the >>> symbol, but I couldn't find a same feature to switch the $ symbol.)

@tk0miya
Copy link
Member

tk0miya commented May 2, 2021

@shimizukawa Thank you for your comment.

Okay, let's merge this and wait for user's reaction.

@tk0miya tk0miya merged commit 11d3a45 into sphinx-doc:4.x May 2, 2021
@tk0miya
Copy link
Member

tk0miya commented May 2, 2021

Just merged. Thank you for your contribution!

tk0miya added a commit that referenced this pull request May 2, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
html theme type:proposal a feature suggestion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants