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

HTML print output does not include chapter numbers #4027

Open
dilyanpalauzov opened this issue Sep 7, 2024 · 1 comment
Open

HTML print output does not include chapter numbers #4027

dilyanpalauzov opened this issue Sep 7, 2024 · 1 comment

Comments

@dilyanpalauzov
Copy link

When I click on https://doc.rust-lang.org/book/ → Printer icon 🖶 in the right upper corner, this page loads https://doc.rust-lang.org/book/print.html. I print the output. All the hyperlinks are now gone.

The printout speaks on several places about chapters using numbers, e. g. on page 587 “Valid pattern syntax in macro definitions is different than the pattern syntax covered in Chapter 18 because macro patterns are matched against Rust code structure rather than values.”

The problem report is, that when the file is printed, there is no “Chapter 18”: the chapters are labelled only by names, not by numbers.

  • Include in the output the chapter numbers, before the chapter names. E.g on page 44 replace “Common Programming Concepts” with “3. Common Programming Concepts”.
@chriskrycho chriskrycho changed the title Prented book references chapter numbers, but does not number chapters HTML print output does not include chapter numbers Sep 12, 2024
@chriskrycho
Copy link
Contributor

Thanks for the feedback. This is mostly a limitation of mdBook, rather than an issue with this text directly. I updated the title so it’s clearer for us what the issue is going forward, particularly because we normally mean the NoStarch physical copy when we refer to “the print(ed) book”. If we include the chapter numbers directly, we would end up with rendered output looking like this:

Outline rendering

That is obviously quite undesirable. That said, I also agree that it would be better if we did have those numbers present when you print out the HTML version the way you did! I’ll check for an upstream issue, and create it if it does not exist, and link it back here either way.

As regards links being stripped out: well, yeah, it’s just printing HTML! The links are actually still “present”, but they do not do you much good. However, we could look into updating the print stylesheet to include those as text; I will create a new issue tracking that.

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

2 participants