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

DOC: Remove the links for True and False #16887

Merged
merged 2 commits into from
Jul 31, 2020
Merged

Conversation

takanori-pskq
Copy link

Related to #13114 .

@eric-wieser
Copy link
Member

eric-wieser commented Jul 17, 2020

I think changing const to data would fix this too. Looking at the python objects.invwith the sphobjinv package, True is definitely a linkable target:

DataObjStr(name='True', domain='py', role='data', priority='1', uri='library/constants.html#$', dispname='-')

@eric-wieser
Copy link
Member

Actually, :const:`True` should work just fine, the python docs do it: https://github.com/python/cpython/blob/323188360d61875bd68688ef41711bade298af50/Doc/library/decimal.rst#L610

I think it would be better to work out why these links do not work.

@takanori-pskq
Copy link
Author

const:`True` in the python docs works because there's the document of True in the python docs (https://github.com/python/cpython/blob/323188360d61875bd68688ef41711bade298af50/Doc/library/constants.rst, https://docs.python.org/3/library/constants.html#True). In the numpy docs, I think external link can be used to point the document of True in the python docs.

@eric-wieser
Copy link
Member

eric-wieser commented Jul 17, 2020

I was under the impression that intersphinx would automatically follow the link. Does :const:`python:True` work instead? Or perhaps :py:const:`True` , if the issue is these files are not using python

@takanori-pskq
Copy link
Author

:py:data:`True` seems to work correctly.

@eric-wieser
Copy link
Member

Does :py:const: work too?

@takanori-pskq
Copy link
Author

No, :py:const: doesn't work.

@eric-wieser
Copy link
Member

It may be worth opening an issue against sphinx.

@eric-wieser
Copy link
Member

Tried to fix the doc CI, but realized that won't work as CircleCI is silly - you'll need to rebase.

@mattip mattip merged commit 2d39e7f into numpy:master Jul 31, 2020
@mattip
Copy link
Member

mattip commented Jul 31, 2020

Thanks @takanori-pskq

@bskinn
Copy link

bskinn commented Nov 12, 2020

Yeah, intersphinx only knows how to wire cross-references together using the domain and role exactly as specified in the objects.inv.

Since True is present in the Python docs objects.inv as belonging to :py:data:, that's the only way you can successfully craft the reference.

As best I understand it, the :const: role is likely only ever going to work for cross-references made to targets within the same documentation set.

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.

5 participants