easy_rust
easy_rust copied to clipboard
epub version (How To)
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
withmdbook
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 ofbook.toml
- ran
createBookFromReadme.sh
- this results in the web preview having a 404, can ignore, and justctrl-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.
PS, it's not perfect, could use some formatting cleanup, etc, but it is close enough for me (for now).
How about to generate epub, fb2 (or bunch of another formats) just in next 3 simple steps?
- Open README.md in VSCode / VSCodium (with preliminary installed vscode-markdown-pdf extension),
- Right click, then Markdown PDF: Export (html),
-
F="README" && pandoc $F.html --to=epub --output=$F.epub && ls -l $F.epub
from CLI.
If you want to using newer mdbook or mdbook-epub,
replace commands
- Installed mdbook with
cargo install mdbook --version 0.3.7
(the epub requires an older version)- installed mdbook-epub with
cargo install mdbook-epub
with
3. cargo install mdbook
4. cargo install --version 0.4.15-beta mdbook-epub
- added
[output.epub]
to the bottom ofbook.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
Anyone successfully produced the epub version. Would you like to share the output here?