rustlings
rustlings copied to clipboard
Hints to add offline documentation suggestions
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 ^^
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.
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:

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.)
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
- some user not install offline book.
- CodeSpace user and Gitpod user feel
- user version is older, not found new features file
- user browser not support file protocol.
- ...
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: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.)
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
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?
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.
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 :)