-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
"Edit on GitHub" fails when docs are in a different repo (git submodules) #1802
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
Comments
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. |
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 Hoping for GitHub could work. Note that I implemented a workaround which you could use a staring point: debops/docs#210 |
I'm going to close this issue since it's not something we will be able to implement on Read the Docs itself.
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 👍🏼 |
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
The text was updated successfully, but these errors were encountered: