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

Hints to add offline documentation suggestions #1501

Closed
Wilker-uwu opened this issue Apr 28, 2023 · 7 comments
Closed

Hints to add offline documentation suggestions #1501

Wilker-uwu opened this issue Apr 28, 2023 · 7 comments

Comments

@Wilker-uwu
Copy link

hi! thank you for making this a thing, i appreciate it <3

i just wanted to ask if it would be good to make available commands and text to make the hints and similar text to be completely accessible offline, possibly all with cargo doc [...] --open too. it would help me a lot since i will be without an internet connection very soon.

thank you for the attention ^^

@shadows-withal
Copy link
Member

After you've completed the installation, everything should be available offline. rustlings hint <exercise> will work regardless of whether you have an internet connection or not.

If you're asking about other materials, for example the book, that can be accessed offline by running rustup doc.

@Wilker-uwu
Copy link
Author

that i do know, but the problem is that there are several hints linking to online resources instead, rather than offering commands or link for offline ones. see for example errors2:
ALT: screenshot of a terminal log, showing the output of the command rustlings hint errors2, with a highlighted text to a link for a page in The Rust Programming Language.

it would be better if it instead¹ pointed to an equivalent page in the book linked by rustup doc (¹ or *additionally to, since there's also the chance where one could be running Rustlings in a place where files like these aren't as easily accessible.)

@XiaoZiShan
Copy link

XiaoZiShan commented May 1, 2023

Thank for you good idea, how implements your suggestions? @Wilker-uwu

This is my rust offline book file url.
file:///Users/${username}/.rustup/toolchains/stable-x86_64-apple-darwin/share/doc/rust/html/book/ch03-02-data-types.html#data-types

1.get your username and your rust version.
2.dynamic replacement info.toml all online url about "hint" field, get offline read features.
3.check boundary items list

  1. some user not install offline book.
  2. CodeSpace user and Gitpod user feel
  3. user version is older, not found new features file
  4. user browser not support file protocol.
  5. ...

I thinking this a trouble. maybe you can deploy port 443 https://github.com/rust-lang/book, then edit hosts file replace your own deploy offline book IP, after open online rust book equals open offline.

Finally, simple way is replacing your info.toml hint field, but this project not only has one online url (https://doc.rust-lang.org/std https://doc.rust-lang.org/nomicon ...).

that i do know, but the problem is that there are several hints linking to online resources instead, rather than offering commands or link for offline ones. see for example errors2: ALT: screenshot of a terminal log, showing the output of the command rustlings hint errors2, with a highlighted text to a link for a page in The Rust Programming Language.

it would be better if it instead¹ pointed to an equivalent page in the book linked by rustup doc (¹ or *additionally to, since there's also the chance where one could be running Rustlings in a place where files like these aren't as easily accessible.)

@shadows-withal
Copy link
Member

Yeah, trying to somehow dynamically replace those points in the hints is a misendeavour, I think, given the different kinds of environments people use Rustlings in. I see two possible ways to improve the situation here:

  • Replace or amend the book links with "See the Book, Chapter X, etc etc" so that it's easier for offline users to cross-reference the book
  • Add a paragraph somewhere (intro exercises? readme?) hinting at the existence of rustup doc, since not a lot of people know about it, and even if you're not offline, it may be more comfortable to use because of the significantly faster page load speed

@Wilker-uwu
Copy link
Author

what if there was instead a way to implement in Rustup itself a way to open a given indexed section of the book or doc? maybe it would be easier to approach this issue if it was implemented on Rustup's side?

@shadows-withal
Copy link
Member

Definitely! Feel free to open an issue on Rustup's side for that, if that does get implemented I'd be happy to add support for it here.

@mo8it
Copy link
Contributor

mo8it commented Jul 7, 2024

I will close this issue because there is nothing Rustlings can do right now. It would be nice if rustup could take a link and open its offline equivalent. If this gets implemented, feel free to open an issue to add a hint in the introduction message :)

@mo8it mo8it closed this as completed Jul 7, 2024
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