Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Also on Enterprise version "Adding “Edit Source” links on your Sphinx theme" #11007

Open
FriedrichBu opened this issue Jan 7, 2024 · 0 comments

Comments

@FriedrichBu
Copy link

“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:

  1. 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

  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant