From 92206e9529c563a070fd6cf902707f6d006c91c0 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Tue, 10 Mar 2026 15:12:29 +0300 Subject: Update README --- README.md | 77 +++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 22 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 728cd86..9267be4 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,27 @@ local `epub_root/`. - **HTML link rewriting during zip**: - Converts absolute O'Reilly API URLs (e.g., `/api/v2/epubs/.../files/images/foo.jpg`) to **relative paths** inside the -EPUB so images/styles render correctly offline. +EPUB so images/styles render correctly. +- Accelerated file downloads via parallelization. -## Requirements +## Installation + +### Ready-to-use binaries + +You can find binaries for major Operating Systems at +[GitHub releases](https://github.com/Farzat07/oreilly-epub/releases). \ +For portable Linux releases (`musl` or `ARM64`), check the +[GitLab releases](https://gitlab.com/Farzat07/oreilly-epub/-/releases). + +Just plug-in and use. + +### Manual build + +#### Build requirements - **Rust** (stable, 1.75+ recommended) with Cargo. -- A **`cookies.json`** file for `learning.oreilly.com` (see below). -- Network access to O'Reilly's API while running the tool. -## Installation +#### Build instructions ```bash git clone @@ -40,9 +52,35 @@ cargo build --release The binary will be at `target/release/oreilly-epub`. -## Cookies setup (`cookies.json`) +## Usage + +```txt +oreilly-epub [OPTIONS] + +Arguments: + The Book digits ID that you want to download + +Options: + --cookies Path to the cookies.json file. + --skip-download If files already downloaded in a previous run. + --parallel Number of files to download in parallel. +``` + +**Example:** + +```bash +oreilly-epub 9781787782204 --cookies ./cookies.json +``` + +Requires: + +- A **`cookies.json`** file for `learning.oreilly.com` (see below). +- Network access to O'Reilly's API while running the tool. + +### Cookies setup (`cookies.json`) -Place a `cookies.json` file in the project root (or pass `--cookies `). \ +Place a `cookies.json` file in the current working directory or config directory +(or pass `--cookies `). \ The file is a **flat JSON object**: cookie name → cookie value. **Example:** @@ -64,21 +102,15 @@ The file is a **flat JSON object**: cookie name → cookie value. JSON.stringify(document.cookie.split(";").map(c=>c.split("=")).reduce((r,[k,v])=>({...r,[k.trim()]:v?.trim()}),{})) ``` -## Usage - -```bash -# Basic: -oreilly-epub - -# With a custom cookies file: -oreilly-epub --cookies /path/to/cookies.json -``` +### Config directory -**Example:** +This depends on the platform, as below: -```bash -target/release/oreilly-epub 9781787782204 --cookies ./cookies.json -``` +|Platform|Value|Example| +|--------|-----|-------| +|Linux|`$XDG_CONFIG_HOME`/oreilly-epub or `$HOME`/.config/oreilly-epub|/home/alice/.config/oreilly-epub| +|macOS|`$HOME`/Library/Application Support/oreilly-epub|/Users/Alice/Library/Application Support/oreilly-epub| +|Windows|`{FOLDERID_LocalAppData}`\oreilly-epub|C:\Users\Alice\AppData\Local\oreilly-epub| ## Notes & Limitations @@ -97,7 +129,7 @@ included and linked properly (cross-check chapters endpoint vs files list). - [ ] **License**: add copyright notice to each file and specify it in Cargo.toml. - [x] **XDG directories**: use XDG‑compatible defaults for config and the download root. -- [ ] **Concurrency**: implement parallel downloads with a configurable limit. +- [x] **Concurrency**: implement parallel downloads with a configurable limit. - [ ] **Progress reporting**: display per‑file and overall progress (bytes and/or file counts). - [x] **Richer metadata**: add metadata such as description to the OPF. @@ -105,5 +137,6 @@ and/or file counts). raw strings. - [x] **Low‑memory zip**: stream files to the archive in chunks to reduce peak memory. -- [ ] **CI/CD**: add a basic pipeline (build, fmt, clippy, test, release +- [x] **CI/CD**: add a basic pipeline (build, fmt, clippy, test, release artifact). +- [ ] **Tests**: write actual tests to run in the CI pipeline. -- cgit v1.2.3-70-g09d2