-
Notifications
You must be signed in to change notification settings - Fork 13.4k
It is hard to find arrays out in the TRPL #25535
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I think a "Quick intro to Rust" which covers all the types with links to reading more about them might help, actually |
Some additional feedback that I've originally posted to IRC:
|
Unofficial version, featuring single HTML as well as printable PDF: http://killercup.github.io/trpl-ebook/
I'm not sure this would be an improvement over CMD+F, but it'd be fantastic for the print version. (From a technical perspective, it's not very complicated to hack together: I'd probably just introduce some convention like "Put index terms in
Yes, we should definitely improve TRPL for non-sequential reading! I've never read a programming book from front to back and the only technical books I actually kept are those with extensive cross-section linking. In my opinion, we should probably aim to cross-link everything: There is no reason not to link every type and trait in code blocks to the docs! |
I was saying that because I was not sure if the full text search with JS is doable or feasible. (It has to be JS, as it is being distributed as HTML form.) A separate index would give an alternative way to implement search. By the way,
I'm much for this too, but less sure about how to implement that in the painless (or less painful) way. At the very least we need rustdoc support for an automatic link to items, which is rust-lang/rfcs#792. |
There are libraries that do that (such as Lunr), but I'm not sure how easy this is, too.
"The
I was actually just talking about Rust code blocks. Those are tested and compiled, so there is an AST at some place and time with all the necessary information about types and where they come from. Using that we can generate links to the std docs. (Similar to how each type and trait is linked in rustdoc's function pages, e.g. Iterator, FnMut and Result here.) |
Just an idea, i'm not sure how helpful / feasible that would be. But you could build a "search friendly" index when you build the docs and store that in a javascript friendly file (json?). |
That's how rustdoc search works already, so it's certainly feasable.
|
How hard would it be to make it more general and usable for rustbook ? |
I have no idea, but that would be the way forward, I'd imagine. |
In the new book, "array" is not a top-level header, but "data types" is http://rust-lang.github.io/book/ch03-02-data-types.html#Arrays |
I'm going to give this one a close; rustbook is gonna be replaced by mdbook, I'm not updating the current book text, and the next book isn't done yet. So this ticket is not going to be fixed, scheduled to be obsoleted, or maybe needs a request at mdbook's tracker. |
The table of contents does not mention anything about "arrays" (whatever does it mean). This, combined with the lack of full text search on the TRPL, means that the user has to read virtually everything til Chapter 5.3 to get the information about arrays, and yet he/she is confused about the lack of growable array (passing mention on Chapter 3.2, and fully explained on Chapter 5.17).
There are some recommendations I can think of:
rustbook
can be easily made to produce such thing out of plain markdown files.)The text was updated successfully, but these errors were encountered: