2017-10-25 06:06:45 +00:00
|
|
|
# global configuration for every documentation added at the end
|
2017-10-06 11:53:58 +00:00
|
|
|
|
2018-03-05 19:05:01 +00:00
|
|
|
import os, sys, datetime
|
2018-02-03 10:39:36 +00:00
|
|
|
|
2018-11-26 21:23:53 +00:00
|
|
|
import sphinx_rtd_theme
|
|
|
|
|
2018-02-03 10:39:36 +00:00
|
|
|
dir_path = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
sys.path.insert(0, os.path.abspath(dir_path + '/_ext'))
|
2018-03-05 19:05:01 +00:00
|
|
|
now = datetime.datetime.now()
|
2018-02-03 10:39:36 +00:00
|
|
|
|
2023-03-22 06:10:10 +00:00
|
|
|
extensions = ['sphinx_rtd_theme']
|
2017-10-06 11:53:58 +00:00
|
|
|
|
|
|
|
# General information about the project.
|
2018-03-05 19:05:01 +00:00
|
|
|
copyright = str(now.year) + ' Nextcloud GmbH'
|
2017-10-06 11:53:58 +00:00
|
|
|
|
|
|
|
# The version info for the project you're documenting, acts as replacement for
|
|
|
|
# |version| and |release|, also used in various other places throughout the
|
|
|
|
# built documents.
|
|
|
|
#
|
|
|
|
# The short X.Y version.
|
2018-11-26 21:23:53 +00:00
|
|
|
version = 'latest'
|
2017-10-06 11:53:58 +00:00
|
|
|
# The full version, including alpha/beta/rc tags.
|
2018-11-26 21:23:53 +00:00
|
|
|
release = version
|
|
|
|
|
|
|
|
# RTD theme options
|
|
|
|
html_theme_options = {
|
|
|
|
'logo_only': True,
|
|
|
|
'style_external_links': True,
|
|
|
|
'display_version': False,
|
|
|
|
}
|
|
|
|
|
|
|
|
# relative path to subdirectories
|
|
|
|
html_logo = "../_shared_assets/static/logo-white.png"
|
2017-10-06 11:53:58 +00:00
|
|
|
|
|
|
|
# substitutions go here
|
|
|
|
rst_epilog = '.. |version| replace:: %s' % version
|
|
|
|
|
2018-11-26 21:23:53 +00:00
|
|
|
# building the versions list
|
2023-05-22 09:37:00 +00:00
|
|
|
version_start = 25 # THIS IS THE SUPPORTED VERSION NUMBER
|
|
|
|
version_stable = 27 # INCREASE THIS NUMBER TO THE LATEST STABLE VERSION NUMBER
|
2022-11-11 14:24:43 +00:00
|
|
|
|
|
|
|
# Also search for "TODO ON RELEASE" in the rst files
|
|
|
|
|
2018-11-26 21:23:53 +00:00
|
|
|
def generateVersionsDocs(current_docs):
|
|
|
|
versions_doc = []
|
2018-11-28 17:09:00 +00:00
|
|
|
for v in range(version_start, version_stable + 1):
|
2018-11-26 21:23:53 +00:00
|
|
|
url = 'https://docs.nextcloud.com/server/%s/%s' % (str(v), current_docs)
|
|
|
|
versions_doc.append(tuple((v, url)))
|
2018-11-28 17:09:00 +00:00
|
|
|
versions_doc.append(tuple(('stable', 'https://docs.nextcloud.com/server/%s/%s' % ('stable', current_docs))))
|
|
|
|
versions_doc.append(tuple(('latest', 'https://docs.nextcloud.com/server/%s/%s' % ('latest', current_docs))))
|
2018-11-26 21:23:53 +00:00
|
|
|
return versions_doc
|
2022-05-02 13:11:00 +00:00
|
|
|
|
2018-11-28 18:56:33 +00:00
|
|
|
if version.isdigit():
|
|
|
|
github_branch = 'stable%s' % version
|
|
|
|
else:
|
|
|
|
github_branch = 'master'
|
2018-11-26 21:23:53 +00:00
|
|
|
|
2017-10-06 11:53:58 +00:00
|
|
|
html_context = {
|
2018-11-26 21:23:53 +00:00
|
|
|
'current_version': version,
|
|
|
|
'READTHEDOCS': True,
|
2018-11-28 18:56:33 +00:00
|
|
|
'extra_css_files': ['_static/custom.css'],
|
|
|
|
|
|
|
|
# force github plugin
|
|
|
|
'display_github': True,
|
|
|
|
'github_user': 'nextcloud',
|
|
|
|
'github_repo': 'documentation',
|
|
|
|
# If current version is an int, use the stablexxx branches, otherwise, edit on master
|
|
|
|
'theme_vcs_pageview_mode': 'edit/%s/' % github_branch, # to be completed by each individual conf.py
|
2017-10-06 11:53:58 +00:00
|
|
|
}
|
2018-02-03 10:39:36 +00:00
|
|
|
|
|
|
|
edit_on_github_project = 'nextcloud/documentation'
|
|
|
|
edit_on_github_branch = 'master'
|