-
-
Notifications
You must be signed in to change notification settings - Fork 167
Double click on function parameter selects parameter type as well #427
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
Comments
The html is not directly generated by numpydoc - rather, numpydoc converts from numpydoc-flavored rst -> sphinx-flavored rst, which is then parsed by docutils and eventually converted to html via the sphinx html builder. FWIW you can see what numpydoc produces via something like (using the original docstring as an example): >>> from numpydoc.docscrape_sphinx import SphinxDocString
>>> import pandas as pd
>>> sds = SphinxDocString(pd.DataFrame.from_records.__doc__)
>>> print(sds) Which gives (only showing printed output through the Parameters section): Convert structured or record ndarray to DataFrame.
Creates a DataFrame object from a structured ndarray, sequence of
tuples or dicts, or DataFrame.
:Parameters:
**data** : structured ndarray, sequence of tuples or dicts, or DataFrame
Structured input data.
**index** : str, list of fields, array-like
Field of array to use as the index, alternately a specific set of
input labels to use.
**exclude** : sequence, default None
Columns or fields to exclude.
**columns** : sequence, default None
Column names to use. If the passed data do not have names
associated with them, this argument provides names for the
columns. Otherwise this argument indicates the order of the columns
in the result (any names not found in the data will become all-NA
columns).
**coerce_float** : bool, default False
Attempt to convert values of non-string, non-numeric objects (like
decimal.Decimal) to floating point, useful for SQL result sets.
**nrows** : int, default None
Number of rows to read if data is an iterator. The subsequent conversion to html is handled by docutils/sphinx.
Maybe I've misunderstood, but I see the same behavior for all three lines from the linked example w.r.t double-clicking the type description (the whole row is highlighted, including the data) |
yep my point is when you double click on data, the selection won't be the same. specificatlly in this case, double clicking on data in the first case select "data" and "structured".
Let me port this issue to sphinx then |
I found a solution in pydata/pydata-sphinx-theme#1015. A simple CSS trick and the problem was gone. As numpydoc is not setting extra CSS I'll close this issue. |
Great, thanks for following up @12rambau ! |
This issue was initially opened by @rok here: pydata/pydata-sphinx-theme#388.
After some digging and some help from SO, I think I identified the issue. The problem comes from the structure of the dt line. if everything is written without spaces and without line break it behave as described in the issue:
if on the other hand you add an extra space you are good to go
If you can point me to where this html is generated, I would be happy to make a PR
PS: see this copen to have a demo of the different behaviours: https://codepen.io/12rambau/pen/mdXQayr
The text was updated successfully, but these errors were encountered: