symbols missing from http://docs.python.org/objects.inv

Daniel Stutzbach avatarDaniel Stutzbach created an issue

I am trying to use intersphinx to reference http://docs.python.org/reference/expressions.html#notin

As I understand it, I should be able to do that using :ref:`comparisons` (assuming I have intersphinx set up correctly, of course). However, Sphinx complains that "comparisons" is an undefined label.

I decided to download http://docs.python.org/objects.inv and examine it. For the file reference/expressions.html, only four symbols are listed: the 4 generator methods (.send, .throw, .next, and .close).

It looks like Sphinx only generated symbols in objects.inv for references created by Sphinx implicitly (i.e., via method::) and not for any of the references created in other ways (.. _comparisons:).

I'm not sure if that's intentional or not. If it's intentional, would you consider adding support to include the other reference symbols in objects.inv?

Comments (6)

  1. Georg Brandl

    Reference labels are not part of the intersphinx inventories intentionally, since they are by no means unique (per project yes, but not between projects). In contrast, full Python object identifiers should be unique.

    However, I can see that it would be useful to have that. I will think about the right way to resolve conflicts for 1.0 or 1.1.

  2. Daniel Stutzbach

    You could borrow from the InterWiki concept and syntax, by allowing a colon to separate the project name from the index label. For example, :ref:`Comparisons <python:comparisons>`. To retain backward compatibility, you would probably need to create a separate index.inv file alongside the objects.inv file.

    For that matter, it would be pretty straightforward (I think) to also support InterWiki links as well. You could grab MoinMoin's interwiki.map file (http://moinmo.in/InterWikiMap) to serve as a default. For example, :ref:`CPython <Wikipedia:CPython>` would lik to http://en.wikipedia.org/wiki/Cpython. Sphinx users could extend/edit the interwiki.map if they wanted to use more InterWiki-style links.

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.