-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Render the book to PDF and make it available for download #3863
Comments
Well, I don't know-- there already is the very nice eBook version available for purchase from No Starch Press, as well as using the "print" button and printing to PDF. This book is also integrated into the In other words, my questions are:
|
The PDF, that would be generated would be basically a cleaner version of the mdbook print output, converted with pandoc to pdf. It has a TOC and the code blocks are coloured: You can see the output here: https://github.com/max-heller/mdbook-pandoc/releases/latest/download/rendered-rust-book.pdf
I don't see a free pdf version available, only the 40+$ version? I searched the repository for *.pdf but didn't find anything, did I miss it? Otherwise, the availability is pretty limited to the online version and the print symbol, which doesn't take care of good layout. The pdf version and maybe the epub version in the future, are (IMHO) much cleaner and higher quality, e.g. for reading it on a tablet. Also, you get all the features of a pdf and epub (readers), basically. Bookmarks, comments, etc.
|
No, by "what's already available" I meant just the $ NoStarch version and print-to-PDF options. You've clarified that the difference in what you're proposing would be a table of contents and cleaner layout, thank you for the detail.
So here's where it gets complicated: as I mentioned, the book is included in rust-lang/rust's CI process, is shipped as part of Rust, and ends up on doc.rust-lang.org/book as part of Rust's release process. If this PDF process breaks, it breaks rust-lang/rust. I am not going to make the decision to add these things without buy-in from people who maintain those parts of rust-lang/rust. So if you're interested in continuing to explore this possibility, please open an issue over there (and link over here) to start a discussion with those folks. Thanks! |
For the record, trying to build the book with |
That's a good one-time data point, but how stable is this over time? |
|
I'm not sure, but it seems like the images for the book are in-repo: https://github.com/rust-lang/book/tree/main/src/img So this error category may not fully apply? |
Hey there,
@max-heller was a great help to
comprehensive-rust
andrust-patterns
as they helped us set up rendering to PDF. So what's your opinion on having the book available as a nice looking PDF?mdbook-pandoc
has some pre-rendered examples in also of Rust-by-example and the book: https://github.com/max-heller/mdbook-pandoc?tab=readme-ov-file#rendered-booksComprehensive Rust: https://google.github.io/comprehensive-rust/comprehensive-rust.pdf
Rust Design Patterns: https://rust-unofficial.github.io/patterns/rust-design-patterns.pdf
(At this point, I think it makes sense to write up a condensed tutorial how to add PDF support to an existing mdbook...)
Some Resources
Initial support PR: feat: render PDF version of book with
mdbook-pandoc
rust-unofficial/patterns#394Adding download icon to menu bar: rust-unofficial/patterns@d96de40
Line wrapping in code blocks: rust-unofficial/patterns@3dd157b
Readme of
mdbook-pandoc
: https://github.com/max-heller/mdbook-pandoc?tab=readme-ov-file#getting-startedThe text was updated successfully, but these errors were encountered: