Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#10315 closed Uncategorized (fixed)

objects.inv not available for intersphinx

Reported by: awatts Owned by: jacob
Component: Documentation Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm writing documentation for my Django app, and I'm using Sphinx with the intersphinx extension. I'd like to be able to cross-reference Django modules, but http://docs.djangoproject.com/en/dev/objects.inv either doesn't exist or is not served. Currently I'm making my own ad hoc inventory file, but it would be nice if I could reference the real one.

See http://docs.python.org/objects.inv as an example of a site that does provide the cross-referencing information.

Change History (5)

comment:1 Changed 6 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jacob
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by jacob

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [10069]) [djangoproject.com] Expose objects.inv for intersphinx links. Fixes #10315.

comment:4 Changed 6 years ago by ben

It might also be worth mentioning here that you'll need to download this and stick it in your sphinx source directory (as django.inv in the conf.py example below). Then you need something in conf.py like this:

intersphinx_mapping = {
  'http://docs.djangoproject.com/en/dev': 'django.inv',
  }

This doesn't guarantee that your link to a django object will be picked up. If you get something like this:

Exception occurred: 60%] index                                           
  File ".../writers/html.py", line 478, in unknown_visit
    raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
NotImplementedError: Unknown node: pending_xref
The full traceback has been saved in /tmp/sphinx-err-z5XcJy.log, if you want to report the issue to the author.

Then check that it's in the inv file.

comment:5 Changed 3 years ago by guettli

  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized
  • UI/UX unset

Here is a working sphinx config.py snippet:

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ["sphinx.ext.intersphinx"]
intersphinx_mapping = {
    'python': ('http://docs.python.org/2.7', None),
    'sphinx': ('http://sphinx.pocoo.org/', None),
    'django': ('http://docs.djangoproject.com/en/dev/', 'http://docs.djangoproject.com/en/dev/_objects/'),
}
Note: See TracTickets for help on using tickets.
Back to Top