Skip to content

"Go to latest version" should try to go to the corresponding sub-page of the latest version #200

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
Boscop opened this issue May 3, 2018 · 18 comments

Comments

@Boscop
Copy link

Boscop commented May 3, 2018

"Go to latest version" should try to go to the corresponding sub-page that one is currently on, not to the crate doc's index page of the latest version.
Going to the index should only be done as a fallback if the current sub-page doesn't exist in the new version's docs.

@jyn514
Copy link
Member

jyn514 commented Sep 28, 2019

How would I get started on fixing this? I've run into this quite a lot.

@Boscop
Copy link
Author

Boscop commented Oct 6, 2019

@jyn514 Each doc page is associated with a symbol name (ident). In a new version, the symbols are sometimes in different modules but still named the same. To find the right doc page, search through all doc pages of the new version to find the one associated with the symbol of the page you're on now (the doc of the old version).

@daboross
Copy link

daboross commented Oct 7, 2019

How about just trying out the same module/symbol name as an attempt, and then landing the users on the search page for the ident if it fails?

I'd be hesitant to unconditionally search for other things with the same name, mostly because struct names are never guaranteed to be unique and having the same name in different packages can sometimes be a positive pattern, as with Error structs.

@jyn514
Copy link
Member

jyn514 commented Oct 9, 2019

When I try to build docs.rs with vagrant up, I get the following error:

    default: Running
    default:  
    default: `/home/cratesfyi/docs.rs/target/debug/cratesfyi build add-essential-files`
    default: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
    default: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

The panic is coming from the following line in src/bin/cratesfyi.rs: let mut builder = RustwideBuilder::init().unwrap();.

Any idea what's going wrong?

@jyn514
Copy link
Member

jyn514 commented Oct 11, 2019

Took this to discord, currently writing a docker backend since Vagrant is very out of date -https://github.com/jyn514/docs.rs/tree/docker-in-docker

@pickfire
Copy link
Contributor

@jyn514 I have that issue as well and no idea what went wrong? It took me one hour to get to that point and it failed, vagrant is really slow even a startup takes 1-5 minutes.

@jyn514
Copy link
Member

jyn514 commented Oct 16, 2019

Yes, I was told on discord the Vagrantfile was never updated in the switch to rustwide. This is a problem on the project's end, try running some of the steps from the Dockerfile in the pull request I made.

@jyn514
Copy link
Member

jyn514 commented Oct 16, 2019

The reason you need a new user is because the server automatically downloads and builds all the crates on crates.io (!!) which involves running arbitrary code.

@pickfire
Copy link
Contributor

I don't want it to build all the crates on crates.io, I just want to develop and fix #413. What should I do? I tried reproducing locally but there are too many steps.

@jyn514
Copy link
Member

jyn514 commented Oct 16, 2019

I am not the right person to ask. Try asking in Discord under Ops -> docs-rs: https://discord.gg/fbTR4VA

@daboross
Copy link

Another suggestion to tack onto this issue: we should probably retain the platform choice, as well as the current page.

For instance, the link at https://docs.rs/winconsole/0.10.0/x86_64-pc-windows-msvc/winconsole/errors/enum.WinError.html goes to https://docs.rs/winconsole/0.11.0/winconsole/, not https://docs.rs/winconsole/0.11.0/x86_64-pc-windows-msvc/winconsole.

@jyn514
Copy link
Member

jyn514 commented Oct 28, 2019

I have a local version of this mostly working except for redirecting to search on URLs that break in a new version. Remind me to push it this weekend if I haven't gotten around to it.

@jyn514
Copy link
Member

jyn514 commented Oct 28, 2019

Does anyone have an example of a crate on crates.io that removed or renamed an item between versions?

@jyn514
Copy link
Member

jyn514 commented Oct 28, 2019

Another suggestion to tack onto this issue: we should probably retain the platform choice, as well as the current page.

Which link do you mean? All the links I see on that page go to the platform except for the very top one with the text 'winconsole-0.10.0'.

@daboross
Copy link

Which link do you mean? All the links I see on that page go to the platform except for the very top one with the text 'winconsole-0.10.0'.

Specifically, if I click on the link "Go to latest version" at the top of the page https://docs.rs/winconsole/0.10.0/x86_64-pc-windows-msvc/winconsole/errors/enum.WinError.html, I am then taken to https://docs.rs/winconsole/0.11.0/winconsole/, which does not have the platform information.

Does anyone have an example of a crate on crates.io that removed or renamed an item between versions?

Searching around, I found these:

For removal: https://docs.rs/rand/0.6.5/rand/rngs/struct.JitterRng.html was removed in https://docs.rs/rand/0.7.2/ (latest version).

For moving: https://docs.rs/pyo3/0.2.7/pyo3/exc/struct.ArithmeticError.html was moved to https://docs.rs/pyo3/0.8.2/pyo3/exceptions/struct.ArithmeticError.html (latest version).

@jyn514
Copy link
Member

jyn514 commented Oct 29, 2019

Ah gotcha, yeah I keep the platform choice in my PR.

Searching around, I found these

Thank you!

jyn514 added a commit to jyn514/docs.rs that referenced this issue Nov 5, 2019
Addresses rust-lang#200

If the page does not exist on the latest version, searches for a page
with that title.
@jyn514
Copy link
Member

jyn514 commented Nov 12, 2019

Fixed in #454

@jyn514 jyn514 closed this as completed Nov 12, 2019
@jyn514
Copy link
Member

jyn514 commented Nov 12, 2019

@daboross I used your strategy of searching for missing pages, thought you'd want to know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants