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

Single webpage / pdf / epub / mobi #218

Closed
hjr3 opened this issue Aug 23, 2016 · 27 comments
Closed

Single webpage / pdf / epub / mobi #218

hjr3 opened this issue Aug 23, 2016 · 27 comments
Labels
blocked upstream Blocked on a change that needs to happen in a different repo first Enhancement Online only
Milestone

Comments

@hjr3
Copy link

hjr3 commented Aug 23, 2016

Is there the possibility of having a version of the Book in a single web page or pdf format? I want to search across the chapters and having them be separate links makes this difficult to do so.

@carols10cents carols10cents added this to the No particular chapter milestone Aug 23, 2016
@carols10cents
Copy link
Member

There is https://github.com/killercup/trpl-ebook, but I'm not sure if @killercup has tried the scripts on the new book yet.

This would be nice to have, but we probably won't get to it until after we get the book printed... actually an ebook/pdf would probably be a side effect of that as well :)

But we'd love help getting @killercup's scripts or some other method to work in the meantime!

@carols10cents carols10cents modified the milestones: all, No particular chapter Dec 29, 2016
@carols10cents
Copy link
Member

@steveklabnik
Copy link
Member

Oh also, the print button in the upper right gives you a single page.

@carols10cents carols10cents added blocked upstream Blocked on a change that needs to happen in a different repo first and removed E-help-wanted labels Mar 22, 2017
@carols10cents
Copy link
Member

o.O Why did I link to mdbook issue #29... I should have linked to https://github.com/azerupi/mdBook/issues/88

@carols10cents carols10cents changed the title Single webpage / pdf Single webpage / pdf / epub / mobi Mar 27, 2017
@adamvoss
Copy link
Contributor

adamvoss commented Apr 7, 2017

Not a helpful final solution, but for anyone looking wanting something right now, I had decent success getting Calibre to convert the HTML to a book, though there were some manual steps. Here is a copy at 072e7d7.

The Rust Programming Language - 072e7d7ad8fe4e269455561da5d2bbf3bfa460b8 .epub.zip

@jasonwilliams
Copy link
Member

Whoever has done the single webpage / print long version (with the whole thing) thank you, i can now read it all without worrying about net connection for every chapter.

Is it possible to have the single page option not tied to print? So my tablet doesn't ask me if i want to print it out every time i press it?

Would love to see a generated PDF option now so i can download it.

@carols10cents
Copy link
Member

@Jayflux You'll want to follow https://github.com/azerupi/mdBook/issues/88 for progress on that, basically we're using mdBook so we're capable of doing whatever mdBook is, and mdBook doesn't have support just yet :)

@michelboaventura
Copy link

To read the book on my Kindle I've just build it and convert the print.html version to a mobi file using kindlegen. Works flawless.

@sorin-davidoi
Copy link

mdBook has support for building as epub in master.

@singalen
Copy link

singalen commented Dec 6, 2018

mdBook 0.2.2 didn't build an epub for me. mdbook-epub complained that it needs mdbook 0.1.0, but sees 0.2.2.

@sorin-davidoi are you sure standalone mdbook can generates epubs?

Here's what worked for me:

# add empty `[output.epub]` section to `book.toml`.
cargo install mdbook-epub
cargo install mdbook --vers "^0.1.0" --force
mdbook build

Profit!

Maybe mdbook-epub just needs to be recompiled with mdbook 0.2.2.

iBooks claimed the epub is invalid, but I was able to open it in a third-party reader.

@sorin-davidoi
Copy link

@singalen Looks like it can't generate them standalone, don't know why I had the impression that it did. Sorry for the confusion.

@rams3s
Copy link

rams3s commented Feb 26, 2019

Following on @singalen solution, here is what worked for me:

# add empty `[output.epub]` section to `book.toml`.
cargo install mdbook-epub
mdbook-epub --standalone

@salomvary
Copy link

@rams3s solution worked for me. I was confused a bit by the lack of output from mdbook-epub and the fact that is finishes so fast:) The epub book will be under book/epub. iBooks complains but it works fine with Calibre and Kindle.

@rams3s
Copy link

rams3s commented May 23, 2019

It's still WIP but I've recently been working on a project to generate epubs of all official rust documentation nightly. Here is the link: https://rams3s.github.io/rust-ebookshelf/

@kaizhang16
Copy link

kaizhang16 commented Oct 15, 2019

Hello everyone, I have generated the epub and pdf version by pandoc inspired by rust-lang/rust#20866 (comment). And here is the links:

Hope it helps.

@liuchong
Copy link

liuchong commented Oct 15, 2019

@josephmate
Copy link

@rams3s : I tried out the epub from your website but a lot of the code samples look like this once you get deeper into the book:

Copy and paste:

Filename: src/main.rs

{{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:all}}

Screenshot:
rust programming language rams3s epub issue

@mabl
Copy link

mabl commented Jun 11, 2020

Hello everyone, I have generated the epub and pdf version by pandoc inspired by rust-lang/rust#20866 (comment).

For everybody having issues with these:

@bs2kbs2k
Copy link

bs2kbs2k commented Aug 14, 2020

Hello everyone, I hacked together scripts to automatically convert the source .md files to a .epub ebook. Place the 3 files here in the src directory(filename matters) and excute the .sh file by bash make_epub.sh. The .epub file will appear at tmp/TRPL.epub. I think it'll work on other books but I'm not sure.
EDIT: The TOC is broken currently.
EDIT: It's fixed now.

@bs2kbs2k
Copy link

bs2kbs2k commented Aug 14, 2020

ADDITION: I hacked together a script to automatically setup the script and run it. just run

curl -L https://git.io/JJ5yS | bash -- /dev/stdin <insert arguments to pandoc here - I use "--toc --toc-depth=2">

@cdennison
Copy link

cdennison commented Nov 29, 2020

Here's what I've tried.

TLDR tried above and got this which was pretty good
https://github.com/cdennison/TRPL/blob/master/TRPL.epub

  1. Downloading existing book (ideal) but can't find anything up-to-date other than https://wherebooks.ga/share.php?q=The+Rust+Programming+Language+(Covers+Rust+2018)+-+Steve+Klabnik&i=https://m.media-amazon.com/images/I/81+7ai0wJ5L._AC_UY327_FMwebp_QL65_.jpg which recommends entering my CC into a fraudulent P2P sharing site.

  2. Use mdBook epub plugin which failed https://github.com/Michael-F-Bryan/mdbook-epub
    Error: Incompatible mdbook version, expected 0.3.7 but got 0.4.4

And 0.3.7 doesn't appear to be in available

cargo install mdbook-epub --vers 0.3.7
    Updating crates.io index
error: could not find `mdbook-epub` in registry `https://github.com/rust-lang/crates.io-index` with version `=0.3.7`
  1. Tried script above got the following error and a bunch of warnings but appeared to give a pretty good epub. Uploaded her for others https://github.com/cdennison/TRPL/blob/master/TRPL.epub
    File "../prep.py", line 22 print('failed processing',fname,file=sys.stderr)

@bs2kbs2k
Copy link

   `  File "../prep.py", line 22 print('failed processing',fname,file=sys.stderr)`

That looks like an issue with your system python being 2 rather than 3 - should be fixed now.

Also, I have made a new repo with a lot of rust books automatically generated - https://github.com/bs2kbs2k/RustBooks.

@miranquil
Copy link

miranquil commented Jan 28, 2021

Under macOS, open the official document(example) by Safari and press the print button on upper right, select PDF -> Save as PDF.

This exports the pages perfectly with all contents exported. The only shortage is lacking of the outline data.

@intjelic
Copy link

This thread is garbage. Full of comments promoting broken solutions and people not understanding the issue.

If conversion to PDF is claimed to be supported, the bare minimum would be to include the outline/toc at the beginning. Printing a book without it makes it impossible to navigate easily.

And yeah, you're not teaching anyone anything by saying you can convert an HTML page to PDF.

@carols10cents
Copy link
Member

carols10cents commented Jul 20, 2021 via email

@intjelic
Copy link

Agree. At least, the next reader is warned and won't waste time trying the non-solution of above.

@carols10cents
Copy link
Member

Thinking about this some more, this issue shouldn't even be open. This repo is MIT licensed, provided as-is. The print view provides the whole book on a single page that can be printed as PDF for free.

If you want a fully-featured PDF/mobi/epub of the book, nicely typeset and containing a table of contents and an index, you may purchase that at https://nostarch.com/Rust2018. In case you think I'm trying to make money, Steve and I donate all our profits from the book to Black Girls Code.

If you want to help us have PDF/mobi/epub support for free, and help all books using mdbook have that support for free, go help with mdbook. If a version of mdbook is released that has better PDF/mobi/epub support, we will upgrade and provide that.

Therefore, there's nothing left for this issue to address.

@rust-lang rust-lang locked as too heated and limited conversation to collaborators Jul 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked upstream Blocked on a change that needs to happen in a different repo first Enhancement Online only
Projects
None yet
Development

No branches or pull requests