-
Notifications
You must be signed in to change notification settings - Fork 3.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
Support branch relative links in README.md on root of repo #84
Comments
I would like this as well so I can write documentation that references the code. |
I've been just looking for similar feature, trying to use SHA or branch or repo links in my README.md. |
+1. relative links from a concise readme.md file to, let's say, a more detailed building-from-source.md allows for keeping such documentation in sync with the code instead of relying on the wiki. |
We tried adding a |
@technoweenie any other comments? This was a feature request / not a bug. Github already sports its own "Github Flavored Markdown", and since github has special relative paths - it makes sense to make these work in the github sense. http://github.github.com/github-flavored-markdown/ Or, are you saying, "No, we will not entertain this feature request"? And basically, we're only talking about the README.md here- which is also specific to github in that it displays the read me as the project index. |
Is there any chance you reopen this issue? Why not rewrite the relative URLs in .md files with the absolute ones (only for the HTML rendering)? |
There are also some other creative options. Could use iframe for the preview of the .md, and relative links would work. You could also potentially leverage the HTML base tag ( http://www.w3schools.com/tags/tag_base.asp ). Could write some JS code that identifies links in the .md preview and alters based on the current/default branch. |
@technoweenie Can't you please try again? There is always some solution. This request is a very important one because without it, the whole process of "pull requests" gets really messy when it comes to documentation. URLs for snapshots etc. have to be rewritten and there is no way to do a clean merge out of the pull request. Please reconsider & try a different approach. |
+1, this is super painful for open-sourcing wiki-like content |
+1 |
The problem is readmes can be viewed on multiple URLs. Every solution requires a pile of hacks:
One solution works great: use absolute URLs. Don't assume your README will always be read on GitHub. Hit up support@github.com if you want to talk about GitHub issues. This is out of scope of this small OSS library. |
@technoweenie I feel your pain, but maybe you could fix the 75% scenario? Each markdown file is truly located in one place, the real URL is something like https://github.com/dblock/mongoid-cached-json/blob/master/README.md - so why not add a substitution like link - every ./ would be replaced by the real location of the file? Sorry if I keep discussing the issue here, already hit support. Wil stop now. |
That's exactly what I'd like to avoid - hard-coding absolute links to the GitHub website instead of using relative ones to link to files in the same directory. That way if you're reading it outside GitHub you get a link to the local copy of the file. I'll email that same thing to support@github.com as you said. Cheers |
+1 |
completely agree with odalet, but that made me think... Cheers |
I first tried to use some relative URL, but this does not work reliable (see github/markup#84).
+1 - no go? |
Can we get some kind of feature to alleviate this pain? Even if its a repository setting, a callback script, or something we can set somewhere that will allow us to rewrite certain links depending on the branch that README/doc is in? Something, anything, throw us a bone here, please! |
+1 |
+1 |
+1 |
2 similar comments
+1 |
+1 |
+1 relative links should work seamlessly, that would allow generated docs to use the same links as github |
I would appreciate working relative links too, though I agree a GitHub based feature outside of the library might make the most sense. |
github should just put wiki under the project directory like Google Code. Then you can link what you want. |
+1 Thanks for the new feature "Contributing Guidelines"! However, when trying to link from the README.md to the new CONTRIBUTING.md I ran into this relative link issue. Would be great if this could be fixed :) Thanks! |
I agree with my predecessors that this is a major pain point for writing decent docs that do not end up being a 1000-line README.md. Another use case @davejamesmiller already touched as well: When in my repo I have
If you guys found a way to fix this, documentation for any given point in time would remain consistent when browsing the docs on github as well as anywhere else, and that would be greatly appreciated! |
I see. Actually I think the blog post example is somewhat badly picked as it only refers to items at the root level. Something like |
What I understand in the blog, if you had docs/foo/bar/baz/README.md you need to change it to just README.md. I will investigate how it works. If docs/foo/bar/baz/README.md worked and the link was calculated to match the proper branch, it would be brilliant. |
From what I reckon that was the purpose of this whole excercise :) |
It was and that is why I was disappointed after reading the blog. :) |
- all tools that were there are now in that wiki, so I removed them from that section - fixed list of transforms wiki link (relative links not working: github/markup#84)
- all tools that were there are now in that wiki, so I removed them from that section - fixed list of transforms wiki link (relative links not working: github/markup#84)
+1 to variables support (branch, etc) |
+1 it should use relative links in issues/pullrequests/comments in pull requests Example:wherei write something in a comment of a pull request whati would like to write currentit matches to:
expectedit should be matched to this:
|
@timofonic news about what? This feature is implemented long ago. |
@avodonosov in pull requests its still not implemented |
@avodonosov ok i will open a new issue for this here is the number: #576 |
Did this ever get fixed/implemented? |
+1 to variables support (username/repo) as CI build plaques/links are a source of pain in forked repos |
This idea lives again in #913! |
This was reported as fixed in 2013 but it appears to be broken again. |
It seems it has been fixed no? I came to this from: |
+1 |
@mamadOuologuem does your |
The original link results in 404 error and seems to refer to a non-existent branch. New link goes to master branch of source repo. (Forks also link to source repo's master branch; based on github/markup#84 relative links only appear to work for actual files in the repo.)
See github/markup#84 for background.
Relative html anchor links work great from one .md file to another, however they do not work from the README.md if it is in the root of the repo. By default, github renders the README.md file in the webapp, and all relative links in there are relative to the URL (which does not include any branch name). It would be sweet if you added logic to this special case to create anchors so they included the current branch.
I have written up a detailed explanation of the problem and an example here:
http://stackoverflow.com/questions/7653483/github-relative-link-in-markdown-file
The text was updated successfully, but these errors were encountered: