question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intersphinx cross-referencing does not work naively

See original GitHub issue

I am improving CuPy’s documentation and hit this issue…

Let’s say I want to reference arange from the array API. Ideally, I would expect this should work out of box:

# conf.py
# ...
intersphinx_mapping = {
    ...
    'array_api': ('https://data-apis.org/array-api/2021.12/', None),
    ...
}
# ...

and in anywhere (rst files or docstrings) I could just do

:func:`array_api.arange`

to link to arange. Unfortunately, this does not work, nor does the global version (removing the array_api prefix). Instead I must do this following due to this repo’s structure:

:func:`signatures.creation_functions.arange`

This is quite confusing and counter-intuitive. I could work with it, but I am wondering if we could do better, say re-organizing the Python stub files such that array_api.arange works, so opening this issue to collect feedbacks and suggestions.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kgrytecommented, May 23, 2022

@leofang Yes, this should be possible. Will see what I can do.

1reaction
leofangcommented, May 10, 2022

Also in __init__.py we need to import all functions to provide a flat namespace (except for the extension modules).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inventory for external cross-reference not found #10425
This message is emitted when intersphinx can't find the inventory settings named "target". So please check your configuration. It might be ...
Read more >
Sphinx Documentation - Release 1.4.4 Georg Brandl
Intersphinx also works for some other domains' roles including :ref: , however it doesn't work for :doc: as that is non-domain role.
Read more >
How to Link to Other Documentation Projects With Intersphinx
Intersphinx allows you to use all cross-reference roles from Sphinx with objects in other projects. That is, you could use the :ref: role...
Read more >
Sphinx Documentation
This is the documentation for the Sphinx documentation builder. Sphinx is a tool that translates a set of reStructuredText1 source files ...
Read more >
Documentation generation - Python - GitHub Pages
Since many open source EDA projects and CLIs are written in Python, Sphinx is ... For instance, intersphinx allows cross-referencing content across sites, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found