-
-
Notifications
You must be signed in to change notification settings - Fork 166
WIP: Add parameter class links #57
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
Conversation
What you probably want is a config parameter containing a regexp for type names. This should be sufficient in practice to list exceptions (for those sufficiently expert in regex), except perhaps where abbreviations are needed (e.g. "array" short for "numpy.ndarray"). Rather than specialising for Want to complete the PR? |
If we can come up with a really good default regular expression that can cover 90% of use cases (or hopefully, to start, For aliasing, adding e.g. an
Could be a pretty simple interface and work nicely.
Neat, didn't realize that was an option.
Do you think it should be I could try to make some default, test it, and update the PR, sure. It might take me a bit because my |
Problem is that usually we're using things like Perhaps a equivalent: numpydoc_type_regex = r'(?!=(or|of|instance|optional))\b[^\W\d]\w+\b'
numpydoc_type_split_regex = r'\W|\b(or|of|instance|optional|\d+)\b' |
The |
What glossary do you mean? Ideally maybe But regardless, |
https://docs.scipy.org/doc/numpy-1.12.0/glossary.html#term-array-like would be linked to with
or
in numpy docs. |
Despite the brevity of the split regex, it's much harder to express exceptional inclusions (like allowing array-like to be matched despite its punctuation), so an inclusion regex is probably better |
The other thing that needs to be handled is ignoring already-markedup terms |
Is there any resolution on the way forward? Here are lists of the unique field entries in numpy and scipy. |
No, but I think mostly someone needs to find time to make something reasonable work properly and we can iterate in subsequent PRs from there. (I haven't had time yet.) |
If it is okay with you I can takeover. |
Yep fine by me |
Closing for #150 |
It would be nice if the parameter list like:
Became this in Sphinx:
That would make it render properly and link to the proper class (with intersphinx), and for more complex types within a given module, it could nicely link to the proper classes.
The current implementation is not good, but shows something like what could be done eventually. Is this of interest to people?