From 40d24ae3a5cc67daa116666018d0d2c5f2b8ba41 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 8 Mar 2024 10:16:41 -0500 Subject: [PATCH 1/8] fix(admin): Eliminate duplicate version string from HTML title Signed-off-by: Josh --- admin_manual/conf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/admin_manual/conf.py b/admin_manual/conf.py index 1a469042aa5..f6ead43e532 100644 --- a/admin_manual/conf.py +++ b/admin_manual/conf.py @@ -53,7 +53,8 @@ #release = '12' # General information about the project. -project = u'Nextcloud %s Administration Manual' % (version) +#project = u'Nextcloud %s Administration Manual' % (version) + #copyright = u'2012-2017, The Nextcloud developers' @@ -109,10 +110,10 @@ # } # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +html_title = "%s Administration Manual" % (project) # A shorter title for the navigation bar. Default is the same as html_title. -html_short_title = "Server Admin Manual" +#html_short_title = "Server Admin Manual" # The name of an image file (relative to this directory) to place at the top # of the sidebar. From 1f6465819d4d2ac86bb8451df9e05cb22b07bf3a Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 8 Mar 2024 10:18:33 -0500 Subject: [PATCH 2/8] enh(sphinx): Add global project title Signed-off-by: Josh --- conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conf.py b/conf.py index 591c21bf0c0..9c3b4297b68 100644 --- a/conf.py +++ b/conf.py @@ -22,6 +22,9 @@ # The full version, including alpha/beta/rc tags. release = version +# General information about the project. +project = u'Nextcloud Server (%s)' % (version) + # RTD theme options html_theme_options = { 'logo_only': True, From 1bf42ae2881c2653ac9d659267dd5f17867a69d9 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 8 Mar 2024 10:26:30 -0500 Subject: [PATCH 3/8] enh(sphinx): Automatically determine version string Signed-off-by: Josh --- conf.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 9c3b4297b68..c084170bd69 100644 --- a/conf.py +++ b/conf.py @@ -1,6 +1,7 @@ # global configuration for every documentation added at the end import os, sys, datetime +from subprocess import Popen, PIPE import sphinx_rtd_theme @@ -8,6 +9,16 @@ sys.path.insert(0, os.path.abspath(dir_path + '/_ext')) now = datetime.datetime.now() +def get_version(): + + pipe = Popen('git branch | grep \*', stdout=PIPE, shell=True, universal_newlines=True) + version = pipe.stdout.read() + + if version: + return version[:2] + else: + return 'unknown' + extensions = ['sphinx_rtd_theme', 'sphinx_rtd_dark_mode'] # General information about the project. @@ -18,7 +29,7 @@ # built documents. # # The short X.Y version. -version = 'latest' +version = get_version().strip() # The full version, including alpha/beta/rc tags. release = version From 8d7822a32835d0ca77557044a2464ff8819aea23 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 8 Mar 2024 10:30:10 -0500 Subject: [PATCH 4/8] fix(dev): Eliminate duplicate version string from HTML title Signed-off-by: Josh --- developer_manual/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developer_manual/conf.py b/developer_manual/conf.py index a0fa8cfb09e..bcc58bb1e27 100644 --- a/developer_manual/conf.py +++ b/developer_manual/conf.py @@ -44,7 +44,7 @@ master_doc = 'index' # General information about the project. -project = u'Nextcloud %s Developer Manual' % (version) +#project = u'Nextcloud %s Developer Manual' % (version) #copyright = u'2012-2017, The Nextcloud developers' # The version info for the project you're documenting, acts as replacement for @@ -109,7 +109,7 @@ # } # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +html_title = "%s Developer Manual" % (project) # A shorter title for the navigation bar. Default is the same as html_title. html_short_title = "Developer Manual" From 0b770293670e68740942aefb7ea3db473328f0f1 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 8 Mar 2024 10:31:55 -0500 Subject: [PATCH 5/8] fix(user): Eliminate duplicate version string from HTML title Signed-off-by: Josh --- user_manual/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_manual/conf.py b/user_manual/conf.py index 5d0b341fa6b..3f6003ebaa3 100644 --- a/user_manual/conf.py +++ b/user_manual/conf.py @@ -53,7 +53,7 @@ #release = '12' # General information about the project. -project = u'Nextcloud %s User Manual' % (version) +#project = u'Nextcloud %s User Manual' % (version) #copyright = u'2012-2017, The Nextcloud developers' # The language for content autogenerated by Sphinx. Refer to documentation @@ -109,7 +109,7 @@ # } # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +html_title = "%s User Manual" % (project) # A shorter title for the navigation bar. Default is the same as html_title. html_short_title = "User Manual" From f76bae93a7255ef5fd39f90a8a15c7e43c54175f Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 8 Mar 2024 16:54:02 +0000 Subject: [PATCH 6/8] Tweak get_version --- conf.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/conf.py b/conf.py index c084170bd69..be696c84fd4 100644 --- a/conf.py +++ b/conf.py @@ -14,10 +14,15 @@ def get_version(): pipe = Popen('git branch | grep \*', stdout=PIPE, shell=True, universal_newlines=True) version = pipe.stdout.read() - if version: - return version[:2] + null, version = version.split("*",1) + version = version.strip() + + if version == "master": + return "upcoming" + if version[:6] == "stable": + return version[-2:] else: - return 'unknown' + return "%s" % (version) extensions = ['sphinx_rtd_theme', 'sphinx_rtd_dark_mode'] @@ -29,7 +34,7 @@ def get_version(): # built documents. # # The short X.Y version. -version = get_version().strip() +version = get_version() # The full version, including alpha/beta/rc tags. release = version @@ -47,7 +52,7 @@ def get_version(): html_logo = "../_shared_assets/static/logo-white.png" # substitutions go here -rst_epilog = '.. |version| replace:: %s' % version +#rst_epilog = '.. |version| replace:: %s' % version # building the versions list version_start = 26 # THIS IS THE SUPPORTED VERSION NUMBER From ff1c01e80426dde828e7add59cddc1e1257aa942 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 8 Mar 2024 17:11:38 +0000 Subject: [PATCH 7/8] Adjust titles --- user_manual/index.rst | 6 +++--- user_manual/whats_new.rst | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/user_manual/index.rst b/user_manual/index.rst index 53b60925396..18d1addaa64 100644 --- a/user_manual/index.rst +++ b/user_manual/index.rst @@ -1,8 +1,8 @@ .. _index: -============================================ -Nextcloud |version| user manual introduction -============================================ +============ +Introduction +============ **Welcome to Nextcloud: A safe home for all your data.** diff --git a/user_manual/whats_new.rst b/user_manual/whats_new.rst index 43ed61bda3c..18f85b9004d 100644 --- a/user_manual/whats_new.rst +++ b/user_manual/whats_new.rst @@ -1,6 +1,6 @@ -=========================================== -What's new for users in Nextcloud |version| -=========================================== +========== +What's new +========== 1. Easier way to select a new app: From f8ee0260732f0eacb3653d2d26984a21dfd0f2d2 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 8 Mar 2024 18:05:00 +0000 Subject: [PATCH 8/8] Adjust logic for clarity --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index be696c84fd4..f78f45c15b7 100644 --- a/conf.py +++ b/conf.py @@ -19,7 +19,7 @@ def get_version(): if version == "master": return "upcoming" - if version[:6] == "stable": + elif version[:6] == "stable": return version[-2:] else: return "%s" % (version)