Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ This project was 90% vibe coded just to illustrate how one can very easily [read

## Usage

The project uses [uv](https://docs.astral.sh/uv/). So for example, download [Dracula EPUB3](https://www.gutenberg.org/ebooks/345) to this directory as `dracula.epub`, then:
The project uses [uv](https://docs.astral.sh/uv/). So for example, download [Dracula EPUB3](https://www.gutenberg.org/ebooks/345) to this directory as `books/dracula.epub`, then:

```bash
uv run reader3.py dracula.epub
uv run reader3.py
```

This creates the directory `dracula_data`, which registers the book to your local library. We can then run the server:
Expand Down
Empty file added __init__.py
Empty file.
Empty file added books/.gitkeep
Empty file.
17 changes: 17 additions & 0 deletions delete_data_folders.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
import shutil

BOOKS_DIR = "books"

def delete_data_folders():
count = 0
for item in os.listdir(BOOKS_DIR):
item_path = os.path.join(BOOKS_DIR, item)
if item.endswith("_data") and os.path.isdir(item_path):
print(f"Deleting {item_path} ...")
shutil.rmtree(item_path)
count += 1
print(f"Deleted {count} data folders.")

if __name__ == "__main__":
delete_data_folders()
Loading