Description: Sphinx documentation tweaks
 Instead of including the license verbatim in the documentation, link to
 /usr/share/doc/python-libdiscid-doc/copyright. Also use intersphinx-mappings
 installed locally.
Author: Sebastian Ramacher <sramacher@debian.org>
Forwarded: not-needed
Last-Update: 2013-07-04

--- a/docs/conf.py
+++ b/docs/conf.py
@@ -182,7 +182,16 @@
   'musicbrainz': ('http://musicbrainz.org/doc/%s', ''),
 }
 
-intersphinx_mapping = {
-  'python': ('http://docs.python.org/', None),
-  'pydiscid': ('https://python-discid.readthedocs.org/en/latest/', None),
-}
+
+def check_object_path(key, url, path):
+  if os.path.isfile(path):
+    return {key: (url, path)}
+  return {}
+
+intersphinx_mapping = {}
+intersphinx_mapping.update(
+    check_object_path('python',
+                      'http://docs.python.org/',
+                      '/usr/share/doc/python%d.%d/html/objects.inv' % \
+                       sys.version_info[:2]))
+
--- a/docs/license.rst
+++ b/docs/license.rst
@@ -3,5 +3,5 @@
 License
 -------
 
-.. include:: ../LICENSE
-   :literal:
+The license is available `here
+</usr/share/doc/python-libdiscid-doc/copyright>`_.
