docs: update all docs with SQLite, API, content_hash, reader features
This commit is contained in:
1 parent
c1421665c0
commit
e62c50c616
5 files changed
+458
-199
No files matched your search
@@ -1,8 +1,8 @@
|
||||
# 📚 Bookish
|
||||
|
||||
**Convertitore e reader di ebook self-hostato** — Flask, Pandoc, WeasyPrint.
|
||||
**Convertitore e reader di ebook self-hostato** — Flask, Pandoc, WeasyPrint, SQLite.
|
||||
|
||||
Carica un ebook in qualsiasi formato, convertilo in un altro, o leggilo direttamente nel browser con un reader completo.
|
||||
Carica un ebook in qualsiasi formato, convertilo in un altro, o leggilo direttamente nel browser con un reader completo. I segnalibri e la posizione di lettura sono persistenti su database SQLite, identificati univocamente dal contenuto del file (SHA256).
|
||||
|
||||
---
|
||||
|
||||
@@ -28,17 +28,20 @@ Carica un ebook in qualsiasi formato, convertilo in un altro, o leggilo direttam
|
||||
### 📖 Reader
|
||||
- **EPUB** via [epub.js](https://github.com/futurepress/epub.js)
|
||||
- **PDF** via [pdf.js](https://mozilla.github.io/pdf.js/)
|
||||
- **Testo/Markdown/DOCX/FB2/HTML** convertiti e renderizzati
|
||||
- **Testo/Markdown/DOCX/FB2/HTML** renderizzati come HTML
|
||||
|
||||
Caratteristiche reader:
|
||||
- Zoom e regolazione font
|
||||
- Temi: chiaro, scuro, seppia
|
||||
- Ricerca full-text
|
||||
- Indice navigabile
|
||||
- Segnalibri e salvataggio posizione
|
||||
- Vista singola/doppia pagina
|
||||
- Navigazione tastiera
|
||||
- Fullscreen
|
||||
- Ricerca full-text con risultati navigabili
|
||||
- Indice navigabile (TOC) per EPUB e PDF
|
||||
- **Segnalibri** persistenti su SQLite con sync server + localStorage
|
||||
- **Salvataggio posizione** lettura (server + localStorage)
|
||||
- **Slider larghezza** area di lettura (40–100%)
|
||||
- **Aiuto contestuale** con scorciatoie da tastiera
|
||||
- Pulsante 🔖 con feedback visivo (toast + pulse)
|
||||
- Navigazione tastiera (← →) e schermo intero
|
||||
- Temi: chiaro, scuro, seppia
|
||||
|
||||
### ⚙️ Motore di conversione
|
||||
- **Pandoc** come motore primario (decine di formati)
|
||||
@@ -46,6 +49,12 @@ Caratteristiche reader:
|
||||
- **python-docx** per DOCX con stili
|
||||
- **BeautifulSoup** per post-processing HTML/tabelle
|
||||
|
||||
### 🗄️ Archiviazione persistente
|
||||
- **SQLite** (`bookish.db`) per segnalibri e posizioni di lettura
|
||||
- **Content Hash** (SHA256) come identificatore univoco del libro
|
||||
- **localStorage** come fallback offline
|
||||
- Stessi segnalibri anche su PC diverso (stessa LAN)
|
||||
|
||||
---
|
||||
|
||||
## Requisiti
|
||||
@@ -72,7 +81,7 @@ pip install -r requirements.txt
|
||||
./run.sh 8080
|
||||
```
|
||||
|
||||
L'app cerca automaticamente una porta libera a partire da quella specificata.
|
||||
L'app cerca automaticamente una porta libera a partire da quella specificata. Il database SQLite (`bookish.db`) viene creato automaticamente al primo avvio.
|
||||
|
||||
Apri il browser su `http://localhost:5000` (o la porta assegnata).
|
||||
|
||||
@@ -86,15 +95,18 @@ bookish/
|
||||
├── config.py # Configurazioni
|
||||
├── requirements.txt
|
||||
├── run.sh
|
||||
├── bookish.db # SQLite (creato al primo avvio)
|
||||
├── bookish/
|
||||
│ ├── __init__.py # Flask factory
|
||||
│ ├── __init__.py # Flask factory + init DB
|
||||
│ ├── routes/
|
||||
│ │ ├── convert.py # Upload, SSE progress, download
|
||||
│ │ └── reader.py # Reader view
|
||||
│ │ ├── reader.py # Reader view + content_hash
|
||||
│ │ └── api.py # API REST bookmarks + positions
|
||||
│ ├── services/
|
||||
│ │ ├── converter.py # Conversione Pandoc + pipeline
|
||||
│ │ ├── sse_manager.py # SSE progress manager
|
||||
│ │ └── formatter.py # PDF/HTML post-processing
|
||||
│ │ ├── formatter.py # PDF/HTML post-processing
|
||||
│ │ └── database.py # SQLite manager
|
||||
│ ├── templates/
|
||||
│ │ ├── base.html # Layout base
|
||||
│ │ ├── index.html # Convertitore
|
||||
@@ -102,7 +114,7 @@ bookish/
|
||||
│ └── static/
|
||||
│ ├── css/style.css
|
||||
│ ├── js/main.js # Frontend convertitore
|
||||
│ ├── js/reader.js # Frontend reader
|
||||
│ ├── js/reader.js # Frontend reader (oltre 800 righe)
|
||||
│ └── logo.svg
|
||||
├── uploads/ # File caricati (temporanei)
|
||||
├── converted/ # File convertiti (temporanei)
|
||||
@@ -113,6 +125,26 @@ Vedi [docs/architecture.md](docs/architecture.md) per dettagli.
|
||||
|
||||
---
|
||||
|
||||
## API Endpoints
|
||||
|
||||
| Metodo | Path | Descrizione |
|
||||
|--------|------|-------------|
|
||||
| POST | `/upload` | Carica file e avvia conversione |
|
||||
| GET | `/progress/<task_id>` | SSE stream progresso |
|
||||
| GET | `/download/<filename>` | Scarica file convertito |
|
||||
| GET | `/formats?input=<ext>` | Formati disponibili per input |
|
||||
| GET | `/reader` | Pagina reader |
|
||||
| GET | `/reader/<filename>` | Reader per file specifico |
|
||||
| GET | `/reader/serve/<filename>` | Serve il file al reader |
|
||||
| GET | `/reader/formats` | Formati supportati dal reader |
|
||||
| GET | `/api/bookmarks/<hash>` | Segnalibri di un libro |
|
||||
| POST | `/api/bookmarks` | Aggiunge segnalibro |
|
||||
| DELETE | `/api/bookmarks/<id>` | Elimina segnalibro |
|
||||
| GET | `/api/position/<hash>` | Posizione di lettura |
|
||||
| PUT | `/api/position/<hash>` | Salva posizione di lettura |
|
||||
|
||||
---
|
||||
|
||||
## Deployment
|
||||
|
||||
Adatto per Proxmox LXC, Docker o VM leggera. Vedi [docs/deploy.md](docs/deploy.md).
|
||||
|
||||
Reference in new issue
Block a user