From 72e08ca04a3033cc7c41922649aae0c1b06a618f Mon Sep 17 00:00:00 2001 From: shettygururaj <gururaj.shetty@huawei.com> Date: Fri, 19 Mar 2021 23:37:42 +0530 Subject: [PATCH] Edit botton for all source file. Fixes Issue #30 Signed-off-by: shettygururaj <gururaj.shetty@huawei.com> --- _templates/breadcrumbs.html | 11 +++++++++++ conf.py | 10 +++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 _templates/breadcrumbs.html diff --git a/_templates/breadcrumbs.html b/_templates/breadcrumbs.html new file mode 100644 index 0000000..65aae2a --- /dev/null +++ b/_templates/breadcrumbs.html @@ -0,0 +1,11 @@ +{%- extends "sphinx_rtd_theme/breadcrumbs.html" %} + +{% block breadcrumbs_aside %} +{% if display_gitlab_local %} + <li class="wy-breadcrumbs-aside"> + {% if hasdoc(pagename) and pagename != "search" and pagename != "genindex" %} + <a href="https://{{ gitlab_local_host|default("gitlab.com") }}/{{ gitlab_local_repo }}/{{ theme_vcs_pageview_mode|default("blob") }}/{{ gitlab_local_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a> + {% endif %} + </li> +{% endif %} +{% endblock %} \ No newline at end of file diff --git a/conf.py b/conf.py index 67b7337..033c06d 100644 --- a/conf.py +++ b/conf.py @@ -54,7 +54,15 @@ exclude_patterns = [] # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" + +html_context = { + "gitlab_local_host": "git.ostc-eu.org", + "display_gitlab_local": True, # Integrate Gitlab + "gitlab_local_repo": "OSTC/OHOS/docs", # Repo name + "gitlab_local_version": "master", # Version + "conf_py_path": "/", # Path in the checkout to the docs root +} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, -- GitLab