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

"Edit on GitHub" fails when docs are in a different repo (git submodules) #1802

Closed
ypid opened this issue Nov 1, 2015 · 4 comments
Closed
Labels
Feature New feature Needed: design decision A core team decision is required

Comments

@ypid
Copy link

ypid commented Nov 1, 2015

Check http://docs.debops.org/en/latest/debops/docs/getting-started.html

which points to: https://github.com/debops/docs/blob/master/docs/debops/docs/getting-started.rst
But it should point to: https://github.com/debops/debops/blob/master/docs/getting-started.rst

Repository which holds all the git submodules: https://github.com/debops/docs

Is there a way to fix the URL?

Related to: debops/docs#91

@ericholscher ericholscher added the Bug A bug label Nov 9, 2015
@stsewd
Copy link
Member

stsewd commented May 17, 2018

Hmm, I'm not sure how rtd can manage this since it only takes the repo url and the page name to built the edit url. We will need to inject the information about submodules in the theme context.

@stsewd
Copy link
Member

stsewd commented Nov 20, 2018

I was able to replicate this https://rtd-test-submodule.readthedocs.io/en/latest/, but as I mentioned, there is no way for rtd to guess what submodule each page belong to (in an easy way at least). A way of avoiding broken links could be hiding the links https://docs.readthedocs.io/en/latest/guides/remove-edit-buttons.html

Or you could change the github links in the template instead of hiding it https://github.com/rtfd/sphinx_rtd_theme/blob/4a3d790e61d7524baac698badee814cd286b1219/sphinx_rtd_theme/breadcrumbs.html#L37-L68. For the rtd footer, there isn't a way to change the links (well, probably it can be done with js).

Anyway, I think this should be handled by github, with a redirection. I'm changing this to a feature, isn't a bug.

@stsewd stsewd added Feature New feature Needed: design decision A core team decision is required and removed Bug A bug Needed: replication Bug replication is required labels Nov 20, 2018
@ypid
Copy link
Author

ypid commented Nov 20, 2018

@stsewd Hoping for GitHub could work.

Note that I implemented a workaround which you could use a staring point: debops/docs#210

@humitos
Copy link
Member

humitos commented Jun 5, 2024

I'm going to close this issue since it's not something we will be able to implement on Read the Docs itself.

Or you could change the github links in the template instead of hiding it rtfd/sphinx_rtd_theme@4a3d790/sphinx_rtd_theme/breadcrumbs.html#L37-L68.

If anything, it should be implemented in the theme (as @stsewd mentioned) by reading an environment variable (maybe) to detect if it's a submodule or not and behaves correctly.

Actually, I think that reading https://docs.readthedocs.io/en/stable/reference/environment-variables.html#envvar-READTHEDOCS_GIT_CLONE_URL should be enough to solve this problem. I'm happy to review a PR on the theme with a POC implementation if somebody wants to open it 👍🏼

@humitos humitos closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

4 participants