summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/2395.doc.1.rst1
-rw-r--r--docs/conf.py16
2 files changed, 16 insertions, 1 deletions
diff --git a/changelog.d/2395.doc.1.rst b/changelog.d/2395.doc.1.rst
new file mode 100644
index 00000000..14a95cf1
--- /dev/null
+++ b/changelog.d/2395.doc.1.rst
@@ -0,0 +1 @@
+Added a ``:user:`` role to Sphinx config -- by :user:`webknjaz`
diff --git a/docs/conf.py b/docs/conf.py
index 673b6ba5..d5111391 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -10,9 +10,18 @@ import os
cwd=os.path.join(os.path.dirname(__file__), os.path.pardir),
)
+# -- Project information -----------------------------------------------------
+
+github_url = 'https://github.com'
+github_sponsors_url = f'{github_url}/sponsors'
+
# -- General configuration --
-extensions = ['jaraco.packaging.sphinx', 'rst.linker']
+extensions = [
+ 'sphinx.ext.extlinks', # allows to create custom roles easily
+ 'jaraco.packaging.sphinx',
+ 'rst.linker',
+]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -27,6 +36,11 @@ exclude_trees = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
+# -- Options for extlinks extension ---------------------------------------
+extlinks = {
+ 'user': (f'{github_sponsors_url}/%s', '@'), # noqa: WPS323
+}
+
# -- Options for HTML output --
# The theme to use for HTML and HTML Help pages. Major themes that come with