Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/documentation.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-11-28 21:56:33 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-11-28 22:10:29 +0300
commitf5129e52b20b25893d2e7cc3a9b4716d73c15d24 (patch)
tree4c5fdf89bd05e3a9dc614982fbe548533ba8c485 /conf.py
parent8b17471db88a9a469bd7fb32098251d024699b1d (diff)
Add edit-on-github functionality
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'conf.py')
-rw-r--r--conf.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/conf.py b/conf.py
index 402e4f9a3..b04f09ab5 100644
--- a/conf.py
+++ b/conf.py
@@ -8,7 +8,7 @@ dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.abspath(dir_path + '/_ext'))
now = datetime.datetime.now()
-extensions = ['edit_on_github']
+extensions = []
# General information about the project.
copyright = str(now.year) + ' Nextcloud GmbH'
@@ -36,9 +36,9 @@ html_logo = "../_shared_assets/static/logo-white.png"
rst_epilog = '.. |version| replace:: %s' % version
# building the versions list
+version_start = 13 # THIS IS THE SUPPORTED VERSION NUMBER
+version_stable = 15 # INCREASE THIS NUMBER TO THE LATEST STABLE VERSION NUMBER
def generateVersionsDocs(current_docs):
- version_start = 13 # THIS IS THE SUPPORTED VERSION NUMBER
- version_stable = 15 # INCREASE THIS NUMBER TO THE LATEST STABLE VERSION NUMBER
versions_doc = []
for v in range(version_start, version_stable + 1):
url = 'https://docs.nextcloud.com/server/%s/%s' % (str(v), current_docs)
@@ -46,11 +46,23 @@ def generateVersionsDocs(current_docs):
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))))
return versions_doc
+
+if version.isdigit():
+ github_branch = 'stable%s' % version
+else:
+ github_branch = 'master'
html_context = {
'current_version': version,
'READTHEDOCS': True,
- 'extra_css_files': ['_static/custom.css']
+ '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
}
edit_on_github_project = 'nextcloud/documentation'