Sphinx is a great documentation tool, and one of it’s built-in extensions is sphinx.ext.intersphinx. It simply takes your objects references for other projects and converts to links in the other project’s documentation.
In sphinx-quickstart command, it asks if you want to add this extension. If so, It adds this code to your conf.py file:
extensions = ['sphinx.ext.intersphinx']
intersphinx_mapping = {'http://docs.python.org/dev': None}
As you can see, it comes integrated with python documentation by default. But what I want is to integrate with Django documentation. So I changed the code a little bit:
extensions = ['sphinx.ext.intersphinx']
intersphinx_mapping = {
'http://docs.python.org/dev': None,
'http://docs.djangoproject.com/en/dev': 'http://docs.djangoproject.com/en/dev/_objects',
}
Sphinx looks for default for the file name objects.inv inside the documentation root, but django doesn’t provide such a file. Since ticket #10315 they provided a file like objects.inv but with a different URL: http://docs.djangoproject.com/en/dev/_objects/.
Now, all you have to do is reffer to classe or any kind of objects inside django: :class:. It will refference the User documentation inside django’s docs.django.contrib.auth.models.User
