https://github.com/mawkler/rust-book-to-epub
Rust Book to EPUB converter
https://github.com/mawkler/rust-book-to-epub
cli converter epub rust
Last synced: about 1 year ago
JSON representation
Rust Book to EPUB converter
- Host: GitHub
- URL: https://github.com/mawkler/rust-book-to-epub
- Owner: mawkler
- License: mit
- Created: 2024-06-19T13:21:11.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-20T12:16:16.000Z (almost 2 years ago)
- Last Synced: 2025-05-12T05:44:01.994Z (about 1 year ago)
- Topics: cli, converter, epub, rust
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust Book To EPUB Converter
CLI tool to conveert a Rust book to EPUB based on the book's URL.
## Installation
Clone this repo, and then run `npm install` from inside the repo.
## Usage
```
Usage: convert [options]
Convert Rust book to EPUB format
Arguments:
url URL of the Rust book
Options:
-V, --version output the version number
-o, --output EPUB filename
-h, --help display help for command
Example usage:
./convert.js https://doc.rust-lang.org/stable/book/
```
### To download multiple books at once
You can use the UNIX command [parallel](https://linux.die.net/man/1/parallel) to download multiple books at once:
```sh
echo 'https://rust-unofficial.github.io/patterns/
https://rust-hosted-langs.github.io/book
https://wubingzheng.github.io/build-lua-in-rust/en/' | parallel ./convert.js
```
Make sure to not have any blank lines. Note the placement of `'`s.
## Credit
I built this script from [this Gist](https://gist.github.com/peterbartha/54708ae739478a45b52612311d49717c) and a lot of proompting. Thanks to https://github.com/peterbartha for creating the original gist! Compared to the original, this version also downloads images and embeds them into the EPUB as well.