You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
“Edit Source” when running GitHub and GitLab on Enterprise Resources
I found that users of GitHub Enterprise (GHE) can add the “Edit Source” links on their Sphinx theme as well. However, according the current state of the documentation this does not seem to be possible.
a. Add hyperlinks to sources of the html code blocks. I assume they are from this breadcrumbs.html
b. Updating the content of the html code blocks. E.g. the Github code now contains "href="github_host|default("github.com")..." and not only "href="https://github.com/...." any more
Extend the documentation by:
a. Adding the key xyz_host to the dict html_context in next line after display_xyz:
- The dict can also contain the key github_host to overwrite the default value github.com
- For gitlab the key gitlab_host should be working in the same way (default gitlab.com).
- For Bitbucket this change does not seem applicable as “https://bitbucket.org/” is hard-coded in the breadcrumbs.html (no default value set). Maybe it makes sense to update the code there in the same logic to have devault values as for github and gitlab
b. Adding the key theme_vcs_pageview_mode to the dict html_context
- Default is blob, also possible: edit or raw to open page in raw or edit mode.
The text was updated successfully, but these errors were encountered:
“Edit Source” when running GitHub and GitLab on Enterprise Resources
I found that users of GitHub Enterprise (GHE) can add the “Edit Source” links on their Sphinx theme as well. However, according the current state of the documentation this does not seem to be possible.
Concretely, GHE Server does not run on https://github.com/, but runs on someenterprise infrastructure. Thus, the URL would require adaption to, e.g., https://github.saobby.my.eu.orgpany-name.com/
Without further adaption the hyperlink will always lead to https://github.com/
The same applies for bitbucket and gitlab. For example, some universities run Gitlab on their own infrastructure: https://git.rwth-aachen.de/
It would be great if the documentation states these possiblities.
Suggested change
I suggest two adaptions of the documentation on the page Adding “Edit Source” links on your Sphinx theme:
In the html code-blocks:
a. Add hyperlinks to sources of the html code blocks. I assume they are from this breadcrumbs.html
b. Updating the content of the html code blocks. E.g. the Github code now contains "href="github_host|default("github.com")..." and not only "href="https://github.com/...." any more
Extend the documentation by:
a. Adding the key
xyz_host
to the dicthtml_context
in next line afterdisplay_xyz
:- The dict can also contain the key
github_host
to overwrite the default valuegithub.com
- For gitlab the key
gitlab_host
should be working in the same way (defaultgitlab.com
).- For Bitbucket this change does not seem applicable as “https://bitbucket.org/” is hard-coded in the breadcrumbs.html (no default value set). Maybe it makes sense to update the code there in the same logic to have devault values as for github and gitlab
b. Adding the key
theme_vcs_pageview_mode
to the dicthtml_context
- Default is
blob
, also possible:edit
orraw
to open page in raw or edit mode.The text was updated successfully, but these errors were encountered: