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

FIX: avoid API double select #1015

Merged
merged 1 commit into from Oct 19, 2022
Merged

FIX: avoid API double select #1015

merged 1 commit into from Oct 19, 2022

Conversation

12rambau
Copy link
Collaborator

@12rambau 12rambau commented Oct 13, 2022

Fix #388

Suprisingly 1 extra CSS rule was sufficient (my recent discovery on inline-blocks led me to this test and lucky for us it works like a charm.
I think it should be ported to sphinx attention but until then it does the job on our side.

exemplified in our doc here: https://pydata-sphinx-theme--1015.org.readthedocs.build/en/1015/examples/api.html#exceptions

Capture d’écran 2022-10-13 à 10 25 54

@AA-Turner
Copy link
Contributor

On https://pydata-sphinx-theme.readthedocs.io/en/stable/examples/api.html#numpy.linalg.tensorinv

If I double click ind, only ind is highlighted. I am not sure of the behaviour difference of this PR, though maybe I misunderstand the bug.

A

@12rambau
Copy link
Collaborator Author

12rambau commented Oct 18, 2022

@AA-Turner on my side both ind and int are selected:

Capture d’écran 2022-10-18 à 20 32 28

I'm using safari but that's the same on firefox (MacOS Monterey)

Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

I just tried this on Chrome and both replicated the old bug and confirmed it works in this version:

ShareX_TOj3T6l6p8

@AA-Turner
Copy link
Contributor

@choldgraf are you on mac or windows? I tried with FF 105 originally (no issue), but having just now checked on chromium 106 the issue did appear--all testing on Windows 10.

This seems like a HTML rendering engine difference -- with FF treating the strong and span tags as different words but blink/webkit based browsers may treat them as one word. I don't know what the HTML 5 spec says is the right thing to do here.

A

@12rambau
Copy link
Collaborator Author

I'll merge this PR as it's solving our little problem and it is not creating issues for blink/webkit based browser.
FYI: the problem is kind of the inverse of the one described here: https://css-tricks.com/fighting-the-space-between-inline-block-elements/

@AA-Turner if you want we can continue this conversation in sphinx-doc/sphinx#10815 to come up with a more robust solution.

@12rambau 12rambau merged commit 23b2432 into pydata:main Oct 19, 2022
@12rambau 12rambau deleted the numpydoc branch October 19, 2022 20:43
@rok
Copy link

rok commented Oct 19, 2022

Thanks so much @12rambau ! :)

@choldgraf
Copy link
Collaborator

I'm on windows 10 as well!

@flying-sheep
Copy link
Contributor

It’s creating problems for us though. Just making a inline node display:flex is a very risky hack.

@12rambau
Copy link
Collaborator Author

12rambau commented Jul 4, 2023

could you elaborate on the risk you face due to our hack ?

@flying-sheep
Copy link
Contributor

I meant “risky” in the sense of “likely to break”. Numpydoc’s definition lists happen to have markup that survives this, other code emitting definition lists probably doesn’t happen to create them just that way.

@12rambau
Copy link
Collaborator Author

12rambau commented Jul 4, 2023

Sure but I think a more robust solution should come from Sphinx itself

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.

ENH: Double click on function parameter selects parameter type as well
5 participants