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

Add 'next' links to pages of TRPL book #20835

Closed
nstoddard opened this issue Jan 9, 2015 · 4 comments
Closed

Add 'next' links to pages of TRPL book #20835

nstoddard opened this issue Jan 9, 2015 · 4 comments

Comments

@nstoddard
Copy link

Since the pages in the "The Basics" section are intended to be read in order, there should be a link to the next page at the bottom (and possibly also at the top) of each page. Links to the previous page might be helpful too. The chapters in the intermediate and advanced sections can be read in any order, so I'm not sure if they should have next/previous links or not.

@nstoddard nstoddard changed the title Add 'next' link to pages of TRPL book Add 'next' links to pages of TRPL book Jan 9, 2015
@steveklabnik
Copy link
Member

👍 for the Basics.

@stevencrockett
Copy link
Contributor

Links would be very helpful. The menu is great for getting to specific sections quickly, but I find it slightly annoying if I just want to get to the next page, as I have to think about the name of the page I'm on before locating it in the menu.

I'd say links throughout the whole book would be helpful. While the pages in the first section are intended to be in order, the self-contained topics in the other sections have an implicit order from the way they are arranged in the menu. Without links, I also think the chapter introductions also appear a bit strange to me (too sparse) (example).

Additionally, some of the topics seem to flow anyway, such as the Generics section leading into Traits. Either way, for someone like me who is excited about Rust, but has yet to dig in properly, I would want to go through all the sections if possible and read everything. I suspect there will be many more people like me as Rust approaches the 1.0 beta and final releases. In this case, links are a great convenience, while everyone still has menu navigation available to use if they so wish.

I've been playing around with markdown, but am not completely sure how to make these links look nice. Things like alignment don't seem to be possible in normal markdown, though on GitHub at least I'm able to embed some simple html. I'm not sure if this works for rustbook however.

Anyway to give an example, I've considered appending something like this to the end of each page:


next: Standard Input
previous: Strings

The specific text could change depending on the context of the page. (e.g. "next section: Intermediate Rust" or "next topic: Pointers").

It would be nice actually if this insertion and naming of links could be done programatically by rustbook. It would leave the markdown files clean for any tool that builds an ePub (see #20866), and avoids the need to keep manually changing the links if pages are reordered/added/deleted/renamed. While the summary doesn't provide information for a "next topic" style link, it certainly provides enough for the "next" and "next section" links, and rustdoc seems to use this information already to generate the menu.

For now though, I don't mind doing this manually as a temporary solution until something automated can be put into place, assuming my suggestion is good in the first place.

@steveklabnik
Copy link
Member

Additionally, some of the topics seem to flow anyway,

I originally wrote it to be ordered, but now it's moving towards unordered. Next and prev really make sense for Basics, but not for the other parts.

I wouldn't mind adding them manually. While it'd be nice to have them generated by Rustbook, since I don't think that it's always appropriate, we'd have to find some notation to indicate if this needs links or not, and that's too complicated.

barosl added a commit to barosl/rust that referenced this issue Jan 27, 2015
Added javascript code to insert next/prev links in the rust book.
Related Issue - rust-lang#20835
alexcrichton added a commit to alexcrichton/rust that referenced this issue Jan 30, 2015
Added javascript code to insert next/prev links in the rust book.
Related Issue - rust-lang#20835
@steveklabnik
Copy link
Member

With #21494 merged this is fixed.

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

3 participants