1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
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>`_.
|