-
Notifications
You must be signed in to change notification settings - Fork 57
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
Better handling of relative links #18
Comments
Sorry for taking too long to reply. Unfortunatelly, that link location is way too specific of rust doc and would required cargo-readme to do a lot more than it does today to properly handle that. If you know a better way to parse the doc strings and handle the link information, please let me know. |
Hmm, that's unfortunate, but it also makes sense. I feel like this will only become more common as people start taking advantage of RFC 1946. It's really handy to use this short-hand for documenting types and methods, and it'd be a shame if those links are then all broken in GitHub READMEs :/ I guess the ultimate solution would be to parse |
I've got a workaround hacking this together with a shell script, it just makes links that look like https://github.com/porglezomp/pixel-canvas/blob/develop/gen-readme.sh |
How about using comrak to parse the markdown and drop and relative links coming from rustdoc? (As a second step, one could make them absolute links with the correct base.) It seems their readme example could be modified to do this and then output with While possible, I don't think doing this as a post-processing step is as nice. The template file would also have its relative links stripped in this case (e.g. to files like the license or the code of conduct). |
I understand that parsing links as RFC 1946 won't be too easy, but how about just adding a command-line flag or similar that gets appended to every relative link? This way I could use GitHub/GitLab pages or similar tools to publish my documentation, and have cargo-readme prepend |
A really awful hack to do this is to |
tsunami
has a crate-local link (for a builder struct) in its top-level docs. While this works fine in generated documentation, that link is wrong when used inREADME.md
. It'd be great if relative links could be removed in the generated readme, or if they could be made absolute relative to, say,docs.rs
!The text was updated successfully, but these errors were encountered: