diff --git a/.gitignore b/.gitignore index 63ed8ce..b587a59 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ __pycache__/ uploads/ converted/ .venv.bak/ +.sisyphus/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..685e440 --- /dev/null +++ b/README.md @@ -0,0 +1,124 @@ +# πŸ“š Bookish + +**Convertitore e reader di ebook self-hostato** β€” Flask, Pandoc, WeasyPrint. + +Carica un ebook in qualsiasi formato, convertilo in un altro, o leggilo direttamente nel browser con un reader completo. + +--- + +## FunzionalitΓ  + +### πŸ”„ Convertitore +| Formato | Input | Output | +|---------|-------|--------| +| EPUB | βœ… | βœ… | +| PDF | βœ… | βœ… | +| DOCX | βœ… | βœ… | +| Markdown | βœ… | βœ… | +| Testo (TXT) | βœ… | βœ… | +| HTML | βœ… | βœ… | +| FB2 | βœ… | βœ… | +| MOBI | βœ… | ❌ | +| LaTeX | βœ… | βœ… | + +- Drag & drop upload +- Barra progresso in tempo reale (SSE) +- Download automatico del convertito + +### πŸ“– 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 + +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 + +### βš™οΈ Motore di conversione +- **Pandoc** come motore primario (decine di formati) +- **WeasyPrint** per PDF con layout avanzato +- **python-docx** per DOCX con stili +- **BeautifulSoup** per post-processing HTML/tabelle + +--- + +## Requisiti + +- Python 3.10+ +- Pandoc (incluso via pypandoc-binary) +- Librerie di sistema per WeasyPrint (libpango, libcairo) + +## Installazione + +```bash +git clone http://192.168.0.183:8085/truetype/bookish.git +cd bookish +python3 -m venv .venv +source .venv/bin/activate +pip install -r requirements.txt +``` + +## Avvio + +```bash +./run.sh +# oppure su porta specifica: +./run.sh 8080 +``` + +L'app cerca automaticamente una porta libera a partire da quella specificata. + +Apri il browser su `http://localhost:5000` (o la porta assegnata). + +--- + +## Architettura + +``` +bookish/ +β”œβ”€β”€ app.py # Entry point +β”œβ”€β”€ config.py # Configurazioni +β”œβ”€β”€ requirements.txt +β”œβ”€β”€ run.sh +β”œβ”€β”€ bookish/ +β”‚ β”œβ”€β”€ __init__.py # Flask factory +β”‚ β”œβ”€β”€ routes/ +β”‚ β”‚ β”œβ”€β”€ convert.py # Upload, SSE progress, download +β”‚ β”‚ └── reader.py # Reader view +β”‚ β”œβ”€β”€ services/ +β”‚ β”‚ β”œβ”€β”€ converter.py # Conversione Pandoc + pipeline +β”‚ β”‚ β”œβ”€β”€ sse_manager.py # SSE progress manager +β”‚ β”‚ └── formatter.py # PDF/HTML post-processing +β”‚ β”œβ”€β”€ templates/ +β”‚ β”‚ β”œβ”€β”€ base.html # Layout base +β”‚ β”‚ β”œβ”€β”€ index.html # Convertitore +β”‚ β”‚ └── reader.html # Reader +β”‚ └── static/ +β”‚ β”œβ”€β”€ css/style.css +β”‚ β”œβ”€β”€ js/main.js # Frontend convertitore +β”‚ β”œβ”€β”€ js/reader.js # Frontend reader +β”‚ └── logo.svg +β”œβ”€β”€ uploads/ # File caricati (temporanei) +β”œβ”€β”€ converted/ # File convertiti (temporanei) +└── docs/ # Documentazione +``` + +Vedi [docs/architecture.md](docs/architecture.md) per dettagli. + +--- + +## Deployment + +Adatto per Proxmox LXC, Docker o VM leggera. Vedi [docs/deploy.md](docs/deploy.md). + +--- + +## Licenza + +MIT diff --git a/bookish/static/css/style.css b/bookish/static/css/style.css index e216f40..76096b4 100644 --- a/bookish/static/css/style.css +++ b/bookish/static/css/style.css @@ -44,6 +44,14 @@ body { font-weight: 600; text-decoration: none; color: #1d1d1f; + display: flex; + align-items: center; + gap: 0.5rem; +} + +.nav-logo { + width: 28px; + height: 28px; } .nav-links { diff --git a/bookish/static/logo.svg b/bookish/static/logo.svg new file mode 100644 index 0000000..bf59d61 --- /dev/null +++ b/bookish/static/logo.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bookish/templates/base.html b/bookish/templates/base.html index f114285..6f5d7d3 100644 --- a/bookish/templates/base.html +++ b/bookish/templates/base.html @@ -4,13 +4,17 @@ {% block title %}Bookish{% endblock %} + {% block head %}{% endblock %}