No description
  • JavaScript 48.1%
  • Go 29.7%
  • CSS 11%
  • HTML 9.9%
  • Makefile 1.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Matjaz Debelak 6aef9a819a
Ignore OS and editor files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 10:55:49 +01:00
cmd/remote-bible Add Remote Bible: offline reader/picker with single remote view 2026-11-15 22:15:40 +01:00
docs/screenshots Add make dist cross-builds and README screenshots 2026-11-19 10:54:53 +01:00
internal Add Remote Bible: offline reader/picker with single remote view 2026-11-15 22:15:40 +01:00
third_party Add Remote Bible: offline reader/picker with single remote view 2026-11-15 22:15:40 +01:00
tools/convert Add Remote Bible: offline reader/picker with single remote view 2026-11-15 22:15:40 +01:00
web Add Remote Bible: offline reader/picker with single remote view 2026-11-15 22:15:40 +01:00
.gitignore Ignore OS and editor files 2026-11-19 10:55:49 +01:00
.gitmodules Add Remote Bible: offline reader/picker with single remote view 2026-11-15 22:15:40 +01:00
go.mod Add Remote Bible: offline reader/picker with single remote view 2026-11-15 22:15:40 +01:00
Makefile Add make dist cross-builds and README screenshots 2026-11-19 10:54:53 +01:00
README.md Add make dist cross-builds and README screenshots 2026-11-19 10:54:53 +01:00

Remote Bible

A Bible reader with a verse picker on one half of the screen and the text on the other. It works fully offline once loaded. A single Go binary serves it, and you can optionally connect exactly one remote screen (for example an iPad) that shows the Bible text and follows the picker.

Screenshots

Main view, no remote connected. The picker is on the left and the reader on the right; the selected verse is underlined. The UI follows the system theme, or you can set light or dark yourself.

Light Dark
Main view, light Main view, dark

While a remote is connected, the text pane becomes a scaled preview of the remote. Remote settings (placement, font size, highlight, dark remote) appear under the picker.

Main view (remote: full screen) Remote (1180×820 iPad)
Preview, full layout Remote, full layout
Main view (remote: right half) Remote
Preview, right half Remote, right half

With a half layout, the preview shows only the text half; the empty half of the remote is left out.

Run

make            # fetch submodule (shallow), convert all 32 versions, build ./remote-bible
./remote-bible  # http://localhost:8080  (prints the LAN URL for the remote)

Flags:

flag default
-addr :8080 listen address
-remote true -remote=false turns off /remote and the sync endpoints (reader only)

Use make dist to build release binaries in dist/ for macOS (arm64), Windows (amd64) and Linux (amd64). They are static, need no runtime, and are about 46 MB each.

Use make BIBLES=nb1930,kjv to embed only some versions. All 32 versions give a binary of about 51 MB; one version gives about 10 MB.

Main view (/)

  • Picker (left by default; the ⇄ button swaps sides): search box, version select, breadcrumb (book › chapter › verse) and a grid.
    • Search: joh 3:16, joh 3.16, joh 3>16, joh 3 16, 1 mos 1,1, sal 23, joh 3:16-18. Local book names and abbreviations work, and English names and OSIS codes always work.
    • Kapittel og vers field: 1.34, 1>23, 1 45, 1:34. Any non-digit works as the separator, and just 3 means chapter 3. Typing a digit anywhere jumps to this field.
    • Keys: ↑/↓ (or ←/→) previous/next verse, Shift+PgUp/PgDn previous/next chapter, / search, Esc clear highlight. Tapping the highlighted verse again clears it.
  • Text pane: a normal reader when no remote is connected (A−/A+ for its font size).
    • While a remote is connected it becomes the remote preview. The preview has exactly the remote's text region (with a half layout, only that half), the same font size, and is scaled to fit. Zoom with Fit / 100 % / − / + or a pinch.
    • Scrolling the preview scrolls the remote.
    • Click a verse in the reader or preview to select it, the same as the verse grid. The view does not jump, because the verse is already on screen. Clicking the highlighted verse again clears it.
  • Remote settings (shown while a remote is connected): placement left half / right half / full, font size, highlight (underline / background / off), dark or light remote.
  • Saved locally: all settings and the position are remembered in localStorage. That covers version, chapter, verse, scroll position, remote settings, UI theme, reader font, picker side and preview zoom.

Remote view (/remote)

  • Content: always just the Bible text. It reacts to no input except the fullscreen button, which fades out after 3 s. Tap the top-right corner to bring the button back, then tap again to toggle fullscreen.
  • One remote only: a second screen gets "already in use" and can choose Ta over (take over). The same device reconnecting, for example after the iPad wakes up, replaces its own old connection automatically.
  • iPad: Safari's fullscreen support varies. For a guaranteed chrome-free screen use Share → Add to Home Screen and open it from there; the remote has its own manifest with display: fullscreen. A Wake Lock keeps the screen on where supported.

Offline

A service worker caches the app and every Bible version you have opened. Alle offline downloads all versions (about 42 MB). After that, the main view works with the server stopped and shows "Ingen kontakt med serveren" ("no contact with the server"). The remote needs the server running.

Data and licenses

Texts come from midvash/bible-data, a git submodule at third_party/bible-data.

  • tools/convert turns them into compact gzipped JSON in internal/bibles/data/. That directory is generated and not committed; it is embedded with go:embed.
  • Norwegian, Swedish and German versions get local book names (tools/convert/booknames.go). The others use English names.
  • Hebrew and Arabic render right-to-left.

Licenses: each version's license is in its metadata.json and is shown as a tooltip in the version list. Several, including nb1930, are marked sourceVerified: false: the public-domain status of the Norwegian 1930 translation is not confirmed. Check before using a version publicly.

Layout

cmd/remote-bible/   server: static app, /data/*.json (pre-gzipped), /api/info, sync hub
internal/hub/       SSE + POST hub: N controllers, max 1 remote (tests included)
internal/bibles/    go:generate + go:embed of converted data
tools/convert/      bible-data → compact JSON (+ local book names)
web/                index.html (main), remote.html, sw.js, css/, js/
  js/render.js      shared renderer for reader, remote and preview (same DOM + CSS ⇒ identical wrapping)
web/test/           node tests for the reference parser

The sync protocol uses Server-Sent Events plus JSON POSTs, with no external Go dependencies. Scroll position is synced as a verse + fraction anchor. Because the preview and the remote share the same box size, font and CSS, they wrap identically, and the anchor maps to the exact same pixel.

Test

make test   # go test ./... + node --test web/test/*.mjs