Skip to content
Snippets Groups Projects
Commit 75869847 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

sphinx: Migrate page source display from Phabricator to GitLab

parent e2308580
No related branches found
No related tags found
1 merge request!305sphinx: Migrate page source display from Phabricator to GitLab
Pipeline #131 passed
......@@ -3,13 +3,13 @@
{# Overrides RTD's default "View page source" link formatting, which
forces the full page name in the link; but we don't want it because
page names include the repo, eg. "swh-model/index".
The view_in_phabricator.py extension sets swh_source_url to
The view_in_gitlab.py extension sets swh_source_url to
".../source/swh-model/browse/master/docs/index"
#}
{%- block breadcrumbs_aside %}
<li class="wy-breadcrumbs-aside">
{%- if hasdoc(pagename) and display_vcs_links %}
<a href="{{ swh_source_url }}{{ page_source_suffix }}">{{ _('View page source') }}</a>
<a href="{{ swh_source_url }}{{ page_source_suffix }}?plain=1">{{ _('View page source') }}</a>
{% endif %}
</li>
{%- endblock %}
......@@ -35,7 +35,7 @@ extensions = [
"myst_parser",
"sphinx.ext.todo",
"sphinx_reredirects",
"swh.docs.sphinx.view_in_phabricator",
"swh.docs.sphinx.view_in_gitlab",
# swh.scheduler inherits some attribute descriptions from celery that use
# custom crossrefs (eg. :setting:`task_ignore_result`)
"sphinx_celery.setting_crossref",
......
# Copyright (C) 2021 The Software Heritage developers
# Copyright (C) 2021-2023 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
"""
Shows a link 'View this page in Phabricator' on top of each page.
Shows a link 'View page source' on top of each page.
"""
......@@ -22,8 +22,8 @@ def html_page_context(app, pagename, templatename, context, doctree):
repository = "swh-docs"
path = pagename
source_url = (
f"https://forge.softwareheritage.org/source/{repository}"
f"/browse/master/docs/{path}"
f"https://gitlab.softwareheritage.org/swh/devel/{repository}"
f"/-/blob/master/docs/{path}"
)
# Set a variable that can be used by swh-docs/docs/_templates/breadcrumbs.html:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment