Skip to content
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

Link to examples on crates.io is incorrect #1106

Closed
focusaurus opened this issue Nov 13, 2017 · 3 comments
Closed

Link to examples on crates.io is incorrect #1106

focusaurus opened this issue Nov 13, 2017 · 3 comments
Labels
A-docs Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations E-easy Call for participation: Experience needed to fix: Easy / not much

Comments

@focusaurus
Copy link
Contributor

Affected Version of clap

  • 2.27.1

Expected Behavior Summary

Viewing docs on crates.io/clap, clicking hyperlinks to the git repo, specifically to the "examples/" directory takes me to the correct URL.

Actual Behavior Summary

Link is a broken 404 (due to the .git in the URL path).

How to Fix

I think if we change the Cargo.toml repository link from repository = "https://github.com/kbknapp/clap-rs.git" to repository = "https://github.com/kbknapp/clap-rs" that will fix it.


CC @kivikakk who contributed some of the relevant crates.io rendering code to consider whether it makes sense for crates.io to try to handle both situations directly.

@kbknapp
Copy link
Member

kbknapp commented Nov 13, 2017

Great catch thanks!

@kbknapp kbknapp added A-docs Area: documentation, including docs.rs, readme, examples, etc... D: easy E-easy Call for participation: Experience needed to fix: Easy / not much C-enhancement Category: Raise on the bar on expectations labels Nov 13, 2017
@kbknapp
Copy link
Member

kbknapp commented Nov 13, 2017

I'd venture that I'm not the only one affected by this, as it's anyone who uses the .git extension and relative links in their readme.

@kivikakk
Copy link

@kbknapp I'd venture you're right. I'll think about a proper solution for this on crates.io itself.

@focusaurus thank you for the CC! ❤️

bors-voyager bot added a commit to rust-lang/crates.io that referenced this issue Nov 29, 2017
1170: repository URLs sometimes end in .git in real-world usage r=carols10cents

And this is okay, because the major sites (BitBucket, GitHub, GitLab) all either directly support visiting the `.git`-suffixed URL of any repo, or redirect from it to the non-suffixed version. These all work fine as-is.

What they don't universally work for is letting you append any path onto that. (Which is to say, from my testing BitBucket doesn't mind, but GitHub and GitLab both 404.)  So we trim the suffix when manipulating relative paths.

See clap-rs/clap#1106 for where this came up with `clap`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations E-easy Call for participation: Experience needed to fix: Easy / not much
Projects
None yet
Development

No branches or pull requests

3 participants