easy_rust icon indicating copy to clipboard operation
easy_rust copied to clipboard

epub version (How To)

Open bashfulrobot opened this issue 4 years ago • 4 comments

I am not sure of the best way to approach this (to officially support on your end or not), but I generated an epub for the book using https://github.com/Michael-F-Bryan/mdbook-epub.

Steps

  • Since I am on Ubuntu, I had to update the createBookFromReadme.sh to use the csplit command (search and replace).
  • On Ubuntu I had to search and replace mdBook with mdbook in the script as well.
  • Installed mdbook with cargo install mdbook --version 0.3.7 (the epub requires an older version)
  • installed mdbook-epub with cargo install mdbook-epub
  • Removed the data before "## Introduction" in the README.md due to a missing SVG file.
  • added [output.epub] to the bottom of book.toml
  • ran createBookFromReadme.sh - this results in the web preview having a 404, can ignore, and just ctrl-c to kill the script.
  • The epub should be in the book directory

I just wanted to share the process in case any others wanted to add the book to a reader, etc.

bashfulrobot avatar Jan 04 '21 21:01 bashfulrobot

PS, it's not perfect, could use some formatting cleanup, etc, but it is close enough for me (for now).

bashfulrobot avatar Jan 04 '21 21:01 bashfulrobot

How about to generate epub, fb2 (or bunch of another formats) just in next 3 simple steps?

  1. Open README.md in VSCode / VSCodium (with preliminary installed vscode-markdown-pdf extension),
  2. Right click, then Markdown PDF: Export (html),
  3. F="README" && pandoc $F.html --to=epub --output=$F.epub && ls -l $F.epub from CLI.

vitali2y avatar Jun 02 '21 02:06 vitali2y

If you want to using newer mdbook or mdbook-epub,

replace commands

  1. Installed mdbook with cargo install mdbook --version 0.3.7 (the epub requires an older version)
  2. installed mdbook-epub with cargo install mdbook-epub

with 3. cargo install mdbook 4. cargo install --version 0.4.15-beta mdbook-epub

  1. added [output.epub] to the bottom of book.toml

With mdbook-epub standalone mode, step 6 is not needed but generate epub after step 7 (run createBookFromReadme.sh) with command

mdbook-epub -s .   # "." indicate the path where `book.toml` located

dieterplex avatar Apr 28 '22 08:04 dieterplex

Anyone successfully produced the epub version. Would you like to share the output here?

azzamsa avatar Sep 07 '22 06:09 azzamsa