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 52 53 54 55 56
|
From: Tomasz Rybak <serpent@debian.org>
Date: Tue, 24 Sep 2024 21:12:38 +0200
Subject: Ensure reproducible documentation
Forwarded: not-needed
Last-Update: 2024-12-20
Do not fetch external Sphinx inventory but use one from Debian packages.
===================================================================
---
docs/conf.py | 9 ++++++---
docs/lib/libpq_docs.py | 4 +++-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index cf87980..31c3f3f 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -93,9 +93,12 @@ html_static_path = ["_static"]
default_role = "obj"
intersphinx_mapping = {
- "py": ("https://docs.python.org/3", None),
- "pg2": ("https://www.psycopg.org/docs/", None),
- "numpy": ("https://numpy.org/doc/stable/", None),
+ "py": ("file:///usr/share/doc/python3-doc/html/",
+ "/usr/share/doc/python3-doc/html/objects.inv"),
+ "pg2": ("file:///usr/share/doc/python-psycopg2-doc/html/",
+ "/usr/share/doc/python-psycopg2-doc/html/objects.inv"),
+ "numpy": ("file:///usr/share/doc/python-numpy/html/",
+ "/usr/share/doc/python-numpy/html/objects.inv"),
}
autodoc_member_order = "bysource"
diff --git a/docs/lib/libpq_docs.py b/docs/lib/libpq_docs.py
index 8bd098e..65dabda 100644
--- a/docs/lib/libpq_docs.py
+++ b/docs/lib/libpq_docs.py
@@ -8,6 +8,8 @@ Add the ``:pq:`` role, to create a link to a libpq function, e.g. ::
will link to::
+ file:///usr/share/doc/postgresql-doc-16/html/libpq-misc.html #LIBPQ-PQLIBVERSION
+previously to:
https://www.postgresql.org/docs/current/libpq-misc.html #LIBPQ-PQLIBVERSION
"""
@@ -80,7 +82,7 @@ class LibpqParser(HTMLParser):
func_id=self.varlist_id.upper(),
)
- _url_pattern = "https://www.postgresql.org/docs/{version}/{section}.html#{func_id}"
+ _url_pattern = "file:///usr/share/doc/postgresql-doc-{version}/html/{section}.html#{func_id}"
class LibpqReader:
|