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 42 43 44 45 46 47 48 49 50 51
|
From: Sebastian Ramacher <sramacher@debian.org>
Date: Sun, 24 Jan 2021 23:58:10 +0100
Subject: 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.
---
docs/conf.py | 19 +++++++++++++++----
docs/license.rst | 4 ++--
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index f592a10..733cc80 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -175,7 +175,18 @@ extlinks = {
"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]
+ )
+)
diff --git a/docs/license.rst b/docs/license.rst
index 2178e22..597390c 100644
--- 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>`_.
|