aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-02 13:15:14 +0200
committerDanilo M. <danix@danix.xyz>2026-10-02 13:15:14 +0200
commitc5a0d1ca39a0ae61e03b0f38a30579b811b4b858 (patch)
tree3f2728f97c266867e5ffc54f292d5e0161cacfb3 /README.md
downloadbook-reader-c5a0d1ca39a0ae61e03b0f38a30579b811b4b858.tar.gz
book-reader-c5a0d1ca39a0ae61e03b0f38a30579b811b4b858.zip
Add book-reader: two-page image book viewer
Browser viewer for books stored as folders of page images: two-page spreads with a GPU-composited 3D page turn, keyboard/wheel/click navigation, fit-height and fit-width (scroll then flip) modes, a library of every image folder under the configured root, and per-book reading progress in localStorage. rc.book-reader serves it with python3 http.server on 127.0.0.1 from a runtime dir of symlinks, so the library is never written to. It can be copied to /etc/rc.d: started as root it re-executes itself as RUNAS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md82
1 files changed, 82 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5ad3942
--- /dev/null
+++ b/README.md
@@ -0,0 +1,82 @@
+# book-reader
+
+Browser viewer for books stored as folders of page images. Shows two pages
+side by side with a 3D page-turn animation, flips with keyboard, mouse wheel
+or click, and remembers where you stopped in each book.
+
+Every folder under the library that contains images is a book, named after
+the folder. Pages are sorted in natural order (`2.jpg` before `10.jpg`).
+
+## Usage
+
+Create `~/.config/book-reader.conf`:
+
+```sh
+LIBRARY="/path/to/collection"
+PORT=8642
+```
+
+Then:
+
+```sh
+./rc.book-reader start # prints the URL, e.g. http://127.0.0.1:8642/reader.html
+./rc.book-reader stop|restart|status
+```
+
+The server is Python's stdlib `http.server`, bound to 127.0.0.1. Its served
+root holds only symlinks to `reader.html` and the library, nothing is written
+into the library. Runtime files live in `/tmp/book-reader-$UID`.
+
+### Start at boot (Slackware)
+
+```sh
+cp rc.book-reader /etc/rc.d/ && chmod 755 /etc/rc.d/rc.book-reader
+```
+
+Set `RUNAS=` near the top of the copy to your user name, and add to the
+config the path of the viewer, since the copy no longer sits next to it:
+
+```sh
+READER="/path/to/book-reader/reader.html"
+```
+
+Then in `/etc/rc.d/rc.local`:
+
+```sh
+[ -x /etc/rc.d/rc.book-reader ] && /etc/rc.d/rc.book-reader start
+```
+
+and the same with `stop` in `/etc/rc.d/rc.local_shutdown`. Started as root,
+the script re-executes itself as `RUNAS`, so the server never runs as root and
+reads that user's config.
+
+Reading progress is kept in browser localStorage, which is per origin: keep
+`PORT` fixed or progress starts over.
+
+## Keys
+
+| Action | Keys |
+|---|---|
+| Next spread | Right, Space, PgDn (scroll first in fit-width), `l`, wheel down, click right half |
+| Previous spread | Left, PgUp, Shift+Space, Backspace, `h`, wheel up, click left half |
+| First / last | Home / End |
+| Toggle cover-alone offset | `c` |
+| Fit width / fit height | `w` (fit-width scrolls, wheel flips at the end of a spread) |
+| Library | `b` (Esc closes) |
+| Fullscreen | `f` |
+
+## License
+
+Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License version 2, as published by the
+Free Software Foundation. See [LICENSE](LICENSE).
+
+## Development Approach
+
+This project is developed using AI-assisted tools. Code is generated with the help of AI based on human-provided specifications, design decisions, and iterative feedback.
+
+All contributions are reviewed, tested, and curated by the maintainer before being included in the codebase. AI is used as a productivity and exploration tool, while human oversight remains central to all decisions.
+
+The goal is to combine the flexibility of AI-assisted development with standard open-source practices such as transparency, review, and accountability.