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
No related merge requests found
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
{# Overrides RTD's default "View page source" link formatting, which {# 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 forces the full page name in the link; but we don't want it because
page names include the repo, eg. "swh-model/index". 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" ".../source/swh-model/browse/master/docs/index"
#} #}
{%- block breadcrumbs_aside %} {%- block breadcrumbs_aside %}
<li class="wy-breadcrumbs-aside"> <li class="wy-breadcrumbs-aside">
{%- if hasdoc(pagename) and display_vcs_links %} {%- 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 %} {% endif %}
</li> </li>
{%- endblock %} {%- endblock %}
...@@ -35,7 +35,7 @@ extensions = [ ...@@ -35,7 +35,7 @@ extensions = [
"myst_parser", "myst_parser",
"sphinx.ext.todo", "sphinx.ext.todo",
"sphinx_reredirects", "sphinx_reredirects",
"swh.docs.sphinx.view_in_phabricator", "swh.docs.sphinx.view_in_gitlab",
# swh.scheduler inherits some attribute descriptions from celery that use # swh.scheduler inherits some attribute descriptions from celery that use
# custom crossrefs (eg. :setting:`task_ignore_result`) # custom crossrefs (eg. :setting:`task_ignore_result`)
"sphinx_celery.setting_crossref", "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 # See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version # License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information # 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): ...@@ -22,8 +22,8 @@ def html_page_context(app, pagename, templatename, context, doctree):
repository = "swh-docs" repository = "swh-docs"
path = pagename path = pagename
source_url = ( source_url = (
f"https://forge.softwareheritage.org/source/{repository}" f"https://gitlab.softwareheritage.org/swh/devel/{repository}"
f"/browse/master/docs/{path}" f"/-/blob/master/docs/{path}"
) )
# Set a variable that can be used by swh-docs/docs/_templates/breadcrumbs.html: # 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