Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-docs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vincent Sellier
swh-docs
Commits
75869847
Commit
75869847
authored
2 years ago
by
Antoine Lambert
Browse files
Options
Downloads
Patches
Plain Diff
sphinx: Migrate page source display from Phabricator to GitLab
parent
e2308580
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/_templates/breadcrumbs.html
+2
-2
2 additions, 2 deletions
docs/_templates/breadcrumbs.html
swh/docs/sphinx/conf.py
+1
-1
1 addition, 1 deletion
swh/docs/sphinx/conf.py
swh/docs/sphinx/view_in_gitlab.py
+4
-4
4 additions, 4 deletions
swh/docs/sphinx/view_in_gitlab.py
with
7 additions
and
7 deletions
docs/_templates/breadcrumbs.html
+
2
−
2
View file @
75869847
...
@@ -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 %}
This diff is collapsed.
Click to expand it.
swh/docs/sphinx/conf.py
+
1
−
1
View file @
75869847
...
@@ -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
"
,
...
...
This diff is collapsed.
Click to expand it.
swh/docs/sphinx/view_in_
phabricator
.py
→
swh/docs/sphinx/view_in_
gitlab
.py
+
4
−
4
View file @
75869847
# 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/s
ource
/
{
repository
}
"
f
"
https://
gitlab
.softwareheritage.org/s
wh/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:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment