Skip to content

Commit

Permalink
🚛
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Oct 7, 2024
1 parent 9f99e13 commit b53ae5a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ You can find your book's [ASIN](https://en.wikipedia.org/wiki/Amazon_Standard_Id

### Extract Kindle Book

Run `npx tsx src/extract-kindle-book.ts`
```sh
npx tsx src/extract-kindle-book.ts
```

- **This takes a few minutes to run.**
- This logs into your [Amazon Kindle web reader](https://read.amazon.com) using headless Chrome ([Playwright](https://playwright.dev)). It can be pretty fun to watch it run, though, so feel free to tweak the script to use `headless: false` if you want to understand what it's doing or debug things.
Expand All @@ -145,7 +147,9 @@ Run `npx tsx src/extract-kindle-book.ts`
### Transcribe Book Content

Run `npx tsx src/transcribe-book-content.ts`
```sh
npx tsx src/transcribe-book-content.ts
```

- **This takes a few minutes to run.**
- This takes each of the page screenshots and runs them through a vLLM (`gpt-4o` or `gpt-4o-mini`) to extract the raw text content from each page of the book.
Expand All @@ -154,10 +158,12 @@ Run `npx tsx src/transcribe-book-content.ts`

### Export Book as PDF

Run `npx tsx src/export-book-pdf.ts` to export your book as a PDF.
```sh
npx tsx src/export-book-pdf.ts
```

- This should run almost instantly.
- It uses [PDFKit](https://github.com/foliojs/pdfkit) under the hood.
- It uses [PDFKit](https://github.com/foliojs/pdfkit) under the hood to export your book as a PDF.
- It includes a valid table of contents for easy navigation.
- The result is stored to `out/${asin}/book.pdf`.

Expand Down

0 comments on commit b53ae5a

Please sign in to comment.