File 0001-sphinx-4.0-Fix-sphinx.ext.extlinks.make_link_role-ca.patch of Package python-openstackdocstheme

From 6cfaeb438e8ca0103955351bc9b398f4931b2580 Mon Sep 17 00:00:00 2001
From: Stephen Finucane <sfinucan@redhat.com>
Date: Mon, 31 May 2021 15:27:48 +0100
Subject: [PATCH] sphinx 4.0: Fix sphinx.ext.extlinks.make_link_role call

Commit 93cf1a57d [1] added a new parameter, 'name', to this function.
Include that when we detect Sphinx 4.x in use.

[1] https://github.com/sphinx-doc/sphinx/commit/93cf1a57d

Change-Id: I3b05df39f701280052d8a0d4f261e8749669ca11
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
---
 openstackdocstheme/ext.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/openstackdocstheme/ext.py b/openstackdocstheme/ext.py
index 80d43e5..25265b4 100644
--- a/openstackdocstheme/ext.py
+++ b/openstackdocstheme/ext.py
@@ -19,6 +19,7 @@ import textwrap
 
 import dulwich.repo
 from pbr import packaging
+import sphinx
 from sphinx.ext import extlinks
 from sphinx.util import logging
 
@@ -298,7 +299,13 @@ def _setup_link_roles(app):
             role_name,
             url,
         )
-        app.add_role(role_name, extlinks.make_link_role(url, project_name))
+
+        if sphinx.version_info >= (4, 0, 0):
+            role = extlinks.make_link_role(project_name, url, project_name)
+        else:
+            role = extlinks.make_link_role(url, project_name)
+
+        app.add_role(role_name, role)
 
 
 def _find_setup_cfg(srcdir):
-- 
2.32.0

openSUSE Build Service is sponsored by