Skip to content

Set edit_uri option on Mkdocs projects for better integration #4827

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

Closed
marcelstoer opened this issue Oct 30, 2018 · 9 comments
Closed

Set edit_uri option on Mkdocs projects for better integration #4827

marcelstoer opened this issue Oct 30, 2018 · 9 comments
Labels
Needed: design decision A core team decision is required
Milestone

Comments

@marcelstoer
Copy link
Contributor

marcelstoer commented Oct 30, 2018

Details

Expected Result

The "Edit on GitHub" top right should take you to the page on GitHub on the selected branch and open it for editing (requires GH authentication).

Actual Result

For MkDocs projects

Regardless of which branch you selected it always links to the master branch - which might not even have that page. Examples:

For RTD itself

As far as I can tell there's only a problem with the "stable" alias. However, that might be because there are only stable and latest.

Side note

Similar issues have existed for the "branch selector" for quite some time (fly-out or dropdown bottom right) but there are other issues for that AFAIR.

@stsewd
Copy link
Member

stsewd commented Oct 30, 2018

As far as I can tell there's only a problem with the "stable" alias. However, that might be because there are only stable and latest.

That one was because of an old build I believe, we should just retrigger a new build on the stable docs.

@stsewd
Copy link
Member

stsewd commented Oct 30, 2018

A new build was triggered on the stable version of rtd, the url is correct now

@stsewd
Copy link
Member

stsewd commented Oct 30, 2018

I'll investigate about the mkdocs issue, not sure where the link is injected

@stsewd
Copy link
Member

stsewd commented Oct 30, 2018

We don't do anything with that, putting master is the default behavior from mkdocs https://www.mkdocs.org/user-guide/configuration/#edit_uri (read the note). But I think this would be a nice to have for the mkdocs integration, similar to #4820

@marcelstoer
Copy link
Contributor Author

Thanks for the super quick analysis! Now as I read that (again) I remember it to be vaguely familiar. Conclusion is that I could potentially fix that myself (by editing mkdocs.yml in the branches) - at least temporarily until e.g. the dev branch is merged to master.

So yes, support from RTD in an integration task would be greatly appreciated.

Otherwise, I'd have to resort to a JavaScript hack fixing the link URL on page load in the browser.

@stsewd
Copy link
Member

stsewd commented Oct 30, 2018

So, I have brought this to the team, I'd say we don't have a final decision yet, our main concern is that the mkdocs.yml could change that options, and we don't have a way to identify the mkdocs version that the users are running, so things can break. I'm changing the title to reflect the request and adding the design decision label.

@stsewd stsewd added the Needed: design decision A core team decision is required label Oct 30, 2018
@stsewd stsewd added this to the Mkdocs milestone Oct 30, 2018
@stsewd stsewd changed the title "Edit on GitHub" broken for MkDocs project and RTD itself Set edit_uri option on Mkdocs projects for better integration Oct 30, 2018
@stsewd
Copy link
Member

stsewd commented Oct 30, 2018

edit_uri has been from the 0.16.0 version of mkdocs https://www.mkdocs.org/about/release-notes/#other-changes-and-additions-to-version-0160

@humitos
Copy link
Member

humitos commented Mar 21, 2023

We are moving away of "magically" do things on behalf of the user for particular doctools. We are now going to expose some extra environment variables that doctool/theme authors could use to integrate properly with us. See #9423

@humitos
Copy link
Member

humitos commented Aug 26, 2023

I'm closing this issue since we don't plan to add more "magic manipulation" on our build process --in fact, we are removing as much as we can from it. The user should the environment variables passed to the build process https://docs.readthedocs.io/en/stable/reference/environment-variables.html#envvar-READTHEDOCS_GIT_CLONE_URL to define edit_uri as they prefer.

@humitos humitos closed this as completed Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

3 participants