Skip to content

Instantly share code, notes, and snippets.

@viteo
Last active October 19, 2023 13:28
Show Gist options
  • Save viteo/38ea7e21cc8c5aa287b3dde5cfae6dbb to your computer and use it in GitHub Desktop.
Save viteo/38ea7e21cc8c5aa287b3dde5cfae6dbb to your computer and use it in GitHub Desktop.
Rust book generate EPUB

Source: atc0005/notes#20 (comment)

Directions:

  1. cargo install mdbook
  2. cargo install mdbook-epub
  3. git clone https://github.com/rust-lang/book rust-book or any other rust-book
  4. cd rust-book
  5. Modify book.toml (add "[output.epub]" at the end)
  6. mdbook build
  7. ls -lh book/epub/
  8. exit

Modifications to book.toml

--- a/book.toml
+++ b/book.toml
@@ -5,3 +5,6 @@ author = "Steve Klabnik and Carol Nichols, with Contributions from the Rust Comm
 [output.html]
 additional-css = ["ferris.css", "theme/2018-edition.css"]
 additional-js = ["ferris.js"]
+
+[output.epub]
+

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment