-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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' should link to the page, not the project #269
Comments
Yup that'd be much better. |
Is this just for the Readthedocs theme? At least for me (using one of the Bootstrap themes), I'd find it strange for "Edit on GitHub" to get higher billing than a link to the project's main page on GitHub. As a user, I think I'd be a lot more likely to want to go to GitHub to download a tarball than I would be to edit the docs. |
@jimporter Yup, that's correct, it is only in the read the docs theme at the moment. |
👍, yeah otherwise people click on the edit button and just bail out because there's nothing to edit. Finding the correct |
I got this working by changing the following line in the breadcrumbs.html from
|
Neat, I didn't expect it to be this easy - we should mabe come up with a nicer method tho and add a property to the current_page and remove the stripping. |
👍 would be great to have this in ! |
@laserb Did you change your repo_url to point to the docs directory? That's the only way I can get this to work and that seems a little odd. Otherwise I have to do something like:
|
Incidently, @laserb you can replace |
In my opinion the 'Github' link on the bottom left (in the readthedocs template) should link to the repository and the 'Edit on Github' should link to the page itself to edit. But that might be just in my case, since we committed the docs inside a '/docs/content' folder in the repository (so it's available together with the software). Maybe a second variable in the configuration to specify the path of the docs inside the repository might be a good addition, empty by default, but gets added to the repo path when configured. Something like :
|
@d0ugal Thank you for the simplification. I was looking for something like that, but couldn't find it. As the button text is "Edit on Github" I would expect it pointing to the edit page. Otherwise the button should be called "View on Github" @Mopster I agree, an additional variable would help. |
@d0ugal is this something where you want a patch to make this move forward? Or is this something you're planning on handling soon? Much gratitude, Asheesh. |
@paulproteus Yeah, essentially, if somebody can come up with a patch to make this work well generally that would be ideal. It is something I had planned to do soonish, but no promises. I have been super busy, I hope to find time for MkDocs again very shortly after a deadline is out of the way. |
I discovered the same need to have true-editing "Edit on GitHub" links, and have a patch in the works, but not sure how to handle the BitBucket case. I'm unable to figure out how to generate a direct link to a given file for BitBucket, as they appear to stick a guid in the middle (for viewing as well as for editing). Looks like BitBucket would have to stay with a link that takes you to the repository root. Given that, would it be better to have unequal treatment (github's link is a direct edit, while bitbucket's is a top-of-repo view), or provide "view" options for both, and additionally "edit" just for github? It would mean an extra config parameter, something like "repo_link: view|edit". Another option is to keep the "Edit on ..." link name, and just have github take you to the file, but not in edit mode (the user can then click the edit pen); while bitbucket would continue going to the repo root. This is simplest / least change, and still useful to me. |
I think unequal treatment is better, for what it's worth -- doing the
best-available thing for each platform is great IMHO.
I'm not a big member of the project, so don't trust my opinion for very
much though!
|
It looks like the GUID is actually the latest sha, so just changing that to the branch name (or any other valid reference) will work. This is an hg repo for example:
So, it looks like the |
Not having a BitBucket repo to play with, I can't validate that it will work in all cases, is the "default" branch guaranteed to be there (like "master" is for git)? Is there a bitbucket user around who could weigh in? |
Okay, so to formalise this. This is the way forward for this issue described here and in the related comments: #752 (comment) |
I would like to see support for this edit function that works with GitLab as well as GitHub and BitBucket. |
Hi, Is there any progress on this feature? I read through the whole discussion, with the related PR (#752) and links, and it seems the feature was planned for a 0.15.x release, but then was left out from all the existing releases (so far). Just wanted to ask if this feature is still considered to be in an upcoming 0.15.x release, and if we can help with anything as we would love to use this feature in our docs. Thanks! |
@viktorbenei the PR was rejected in favor of the approach described in this comment. However, no one has actually done the work to implement that. Until someone does, its not going to be added. Truth be told, I forgot about it, so I just added it to the 0.16 milestone which should ensure its not forgotten again. |
all right, thank you @waylan , I'll try to make some time to send a PR :) |
This patch adds support for a configuration option `edit_uri` that is used to generate a link directly to an individual page in the source repository. Fixes mkdocs#269
This patch adds support for a configuration option `edit_uri` that is used to generate a link directly to an individual page in the source repository. Fixes mkdocs#269
This patch adds support for a configuration option `edit_uri` that is used to generate a link directly to an individual page in the source repository. Fixes mkdocs#269
This patch adds support for a configuration option `edit_uri` that is used to generate a link directly to an individual page in the source repository. Fixes mkdocs#269
This patch adds support for a configuration option `edit_uri` that is used to generate a link directly to an individual page in the source repository. Fixes mkdocs#269
This patch adds support for a configuration option `edit_uri` that is used to generate a link directly to an individual page in the source repository. Fixes mkdocs#269
This patch adds support for a configuration option `edit_uri` that is used to generate a link directly to an individual page in the source repository. Fixes mkdocs#269
Hrm, one oddity I just noticed with this. The default MkDocs theme now links to the edit page with the "GitHub" link on the top right. I find that really unexpected - I think we should just update the theme to link to the repo address. It would be nice to add an "edit on github" link to this theme, but I can't think of a good place to put it. re-opening this issue so I don't forget. |
Unlike the readthedocs theme, the wording isn't "edit on .." or similar. Taking users to the edit page is therefore confusing. Fixes mkdocs#269
IMO, the Github link should be smartened so that its text is 'Edit on Github' and the hyperlink points to the current page. For example, see the link in upper right of http://read-the-docs.readthedocs.org/en/latest/builds.html
PIP docs do this well
The text was updated successfully, but these errors were encountered: