Skip to content

Commit a0f8dc4

Browse files
committed
Show source text on GitLab projects
1 parent 56874cb commit a0f8dc4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/sphinx_book_theme/header_buttons/source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def add_source_buttons(app, pagename, templatename, context, doctree):
5555
# Use plain=1 to ensure the source text is shown, not rendered
5656
source_url = edit_url.replace("/edit/", "/blob/") + "?plain=1"
5757
elif provider.lower() == "gitlab":
58-
source_url = edit_url.replace("/edit/", "/blob/")
58+
source_url = edit_url.replace("/edit/", "/blob/") + "?plain=1"
5959
elif provider.lower() == "bitbucket":
6060
source_url = edit_url.replace("?mode=edit", "")
6161

tests/test_build/header__source-buttons--gitlab.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
https://gitlab.com/gitlab-org/gitlab
22
<i class="fab fa-gitlab"></i>
3-
https://gitlab.com/gitlab-org/gitlab/-/blob/main/section1/ntbk.ipynb
3+
https://gitlab.com/gitlab-org/gitlab/-/blob/main/section1/ntbk.ipynb?plain=1
44
<i class="fas fa-code"></i>
55
https://gitlab.com/gitlab-org/gitlab/-/edit/main/section1/ntbk.ipynb
66
<i class="fas fa-pencil-alt"></i>

tests/test_build/header__source-buttons--gitlab_manual.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
https://mywebsite.com/gitlab/gitlab-org/gitlab
22
<i class="fab fa-gitlab"></i>
3-
https://mywebsite.com/gitlab/gitlab-org/gitlab/-/blob/main/section1/ntbk.ipynb
3+
https://mywebsite.com/gitlab/gitlab-org/gitlab/-/blob/main/section1/ntbk.ipynb?plain=1
44
<i class="fas fa-code"></i>
55
https://mywebsite.com/gitlab/gitlab-org/gitlab/-/edit/main/section1/ntbk.ipynb
66
<i class="fas fa-pencil-alt"></i>

0 commit comments

Comments
 (0)