From d8e253c5d2f8029e0f265ead7f36d03e01000d61 Mon Sep 17 00:00:00 2001
From: Varac <varac@varac.net>
Date: Mon, 21 Feb 2022 12:00:56 +0100
Subject: [PATCH] Use sphinx-version-warning to warn about outdated doc

---
 docs/conf.py          | 10 +++++++++-
 docs/index.rst        |  5 -----
 docs/requirements.in  |  9 +++++----
 docs/requirements.txt | 13 ++++++++++---
 4 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index 5281ec571..bf46f1dbd 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -33,7 +33,8 @@ with open('../VERSION') as version_file:
 extensions = [
     'recommonmark',
     'sphinx.ext.autosectionlabel',
-    'sphinx_design'
+    'sphinx_design',
+    'versionwarning.extension'
 ]
 
 # Add any paths that contain templates here, relative to this directory.
@@ -80,3 +81,10 @@ autosectionlabel_prefix_document = True
 autosectionlabel_maxdepth = 5
 
 suppress_warnings = ['autosectionlabel.*']
+
+# https://github.com/humitos/sphinx-version-warning-example/blob/master/docs/conf.py
+versionwarning_messages = {
+    'v0.8-beta1': '''This is the documentation for current stable documentation.
+                     For the latest documentation based on the unrleased main branch see
+                     https://docs.stackspin.net/en/latest/index.html.'''
+}
diff --git a/docs/index.rst b/docs/index.rst
index e89fa769a..060977a64 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,8 +1,3 @@
-.. Stackspin documentation master file, created by
-   sphinx-quickstart on Wed Jul 31 15:18:33 2019.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
 Welcome to Stackspin's documentation!
 =====================================
 
diff --git a/docs/requirements.in b/docs/requirements.in
index 3eb3f1045..029152e40 100644
--- a/docs/requirements.in
+++ b/docs/requirements.in
@@ -5,7 +5,8 @@
 # Please add developer dependencies which are not needed to install
 # Stackspin to requirements-dev.txt!
 #
-recommonmark==0.7.1
-sphinx==4.4.0
-sphinx-design==0.0.13
-sphinx-rtd-theme==1.0.0
+recommonmark
+sphinx
+sphinx-design
+sphinx-rtd-theme
+sphinx-version-warning
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 28014d859..208b64988 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,5 +1,5 @@
 #
-# This file is autogenerated by pip-compile with python 3.10
+# This file is autogenerated by pip-compile with python 3.9
 # To update, run:
 #
 #    pip-compile
@@ -10,7 +10,7 @@ babel==2.9.1
     # via sphinx
 certifi==2021.10.8
     # via requests
-charset-normalizer==2.0.10
+charset-normalizer==2.0.12
     # via requests
 commonmark==0.9.1
     # via recommonmark
@@ -23,9 +23,11 @@ idna==3.3
     # via requests
 imagesize==1.3.0
     # via sphinx
+importlib-metadata==4.11.1
+    # via sphinx
 jinja2==3.0.3
     # via sphinx
-markupsafe==2.0.1
+markupsafe==2.1.0
     # via jinja2
 packaging==21.3
     # via sphinx
@@ -47,10 +49,13 @@ sphinx==4.4.0
     #   recommonmark
     #   sphinx-design
     #   sphinx-rtd-theme
+    #   sphinx-version-warning
 sphinx-design==0.0.13
     # via -r requirements.in
 sphinx-rtd-theme==1.0.0
     # via -r requirements.in
+sphinx-version-warning==1.1.2
+    # via -r requirements.in
 sphinxcontrib-applehelp==1.0.2
     # via sphinx
 sphinxcontrib-devhelp==1.0.2
@@ -65,3 +70,5 @@ sphinxcontrib-serializinghtml==1.1.5
     # via sphinx
 urllib3==1.26.8
     # via requests
+zipp==3.7.0
+    # via importlib-metadata
-- 
GitLab