FictionBook Editor — Go + Wails port of classic FBE for macOS and Linux https://github.com/dimgord/fbe-go/releases/latest
  • Svelte 39%
  • Go 31.9%
  • TypeScript 27.9%
  • Shell 0.6%
  • Nix 0.6%
Find a file
Dmitry Gordiyevsky 3673b26517
Merge dev → main — v1.0.5 (Rev 91)
Rev 91 (1.0.5) — Edit XML feature:
  * CodeMirror 6 editor in the validation panel (XmlEditor.svelte) with
    line numbers, fold, history, XML syntax highlight, light/dark theme.
  * Apply commits user-edited XML through a strict round-trip guard
    (parse → re-serialize → element-count diff) so a typo like
    <autho> instead of <author> is rejected with a focused
    "Unknown element <X> at line N — likely a typo" message instead
    of silently destroying the document.
  * One-deep Apply Undo — structuredClone of fb snapshotted pre-Apply,
    restorable via an in-panel "Undo Apply" banner.
  * UX polish: error banner moved out of the global header into the
    panel; Done/× exit unconditionally (Wails WKWebView silently drops
    window.confirm); xmlApplyError clears on editMode transitions and
    Apply attempts but NOT on keystroke (context preserved while user
    types the fix); xmlDirty wired into isCurrentlyDirty() so global
    Cmd-Q guard catches unapplied CM6 edits.
2026-06-07 13:02:16 -04:00
.github ci: tighten dependabot — group minor+patch, ignore major 2026-04-28 12:39:34 -04:00
build Rev 69: Linux hotfix — 512x512 icon for linuxdeploy 2026-04-23 00:11:48 -04:00
cmd/fbe Rev 15 (0.0.15): HTML export — Go walker replaces FBE's 493-line XSLT 2026-04-21 05:33:51 -04:00
docs docs: announcement drafts with real screenshots 2026-04-29 19:19:57 -04:00
frontend Rev 91 (1.0.5): Edit XML feature — CodeMirror 6 + safe Apply + Undo 2026-06-07 13:01:10 -04:00
internal/fb2 Rev 89 (1.0.3): drag-n-drop + macOS maximize + XSD coverpage + resize 2026-06-05 23:41:37 -04:00
packaging Rev 85 (1.0.0-rc5): Linux AppImage — adopt full community excludelist 2026-04-26 01:13:39 -04:00
scripts Rev 51 (0.1.12): check-theme-hygiene.sh lint + --backdrop palette var 2026-04-22 18:59:09 -04:00
testdata Rev 4 (0.0.4): writer round-trip + custom polymorphic marshalers 2026-04-21 04:05:52 -04:00
.gitignore Add build dir to git ignore list. 2026-05-19 13:20:47 -04:00
app.go Rev 91 (1.0.5): Edit XML feature — CodeMirror 6 + safe Apply + Undo 2026-06-07 13:01:10 -04:00
CHANGELOG.md Rev 88 (1.0.2): unsaved-changes guard 2026-04-29 02:20:51 -04:00
CLAUDE.md docs: refresh CLAUDE.md for 1.0 RC + release plumbing 2026-04-25 20:06:45 -04:00
flake.lock Rev 26 (0.0.26): Nix flake with cross-platform dev shell (Linux + macOS) 2026-04-22 00:01:22 -04:00
flake.nix Rev 59 (0.1.20): font discovery on NixOS — extend xdg.FontDirs + flake XDG_DATA_DIRS 2026-04-22 21:06:29 -04:00
go.mod Bump the gomod-minor-patch group across 1 directory with 2 updates 2026-05-12 16:23:49 +00:00
go.sum Bump the gomod-minor-patch group across 1 directory with 2 updates 2026-05-12 16:23:49 +00:00
LICENSE Rev 42 (0.1.3): MIT LICENSE + NOTICE.md + credits 2026-04-22 16:51:38 -04:00
main.go Rev 89 (1.0.3): drag-n-drop + macOS maximize + XSD coverpage + resize 2026-06-05 23:41:37 -04:00
NOTICE.md Rev 80: docs polish for 1.0 — README + CHANGELOG + About + NOTICE 2026-04-24 18:28:01 -04:00
PROGRESS.md Rev 91 (1.0.5): Edit XML feature — CodeMirror 6 + safe Apply + Undo 2026-06-07 13:01:10 -04:00
README.md docs: link to sopds-go in Related projects (sister project) 2026-05-10 14:56:44 -04:00
version.go Rev 91 (1.0.5): Edit XML feature — CodeMirror 6 + safe Apply + Undo 2026-06-07 13:01:10 -04:00
wails.json Rev 91 (1.0.5): Edit XML feature — CodeMirror 6 + safe Apply + Undo 2026-06-07 13:01:10 -04:00

fbe-go

A Go + Wails port of the classic FictionBook Editor (FBE) — a desktop editor for FB2 (FictionBook 2.x) documents.

Original FBE is Windows-only (C++/WTL + embedded MSHTML + MSXML). This project re-implements the core in pure Go and moves the editor surface from MSHTML contentEditable to a web-based editor (ProseMirror) hosted in a system webview via Wails v2.

Target platforms: macOS + Linux. Windows is out of scope — the original C++ FBE remains the Windows story. Platform-native components (thumbnailer, QuickLook) may use Rust or C where Go is awkward.

Project status

Feature-complete for 1.0. Phases 05 of the roadmap are closed:

  • Editing: every FB2 structural operation (clone / merge / insert cite / poem / table / section / epigraph / annotation / empty-line …), inline marks, paragraph styles, and save/validate cycle — worked through docs/OPERATIONS.md row-by-row.
  • Round-trip fidelity: unknown FB2 elements survive the parse → PM → serialize loop unchanged (see the "Lossless fallback invariant" section of CLAUDE.md). Corpus-tested on real-world files with fidelityBroken == 0 as the gating invariant.
  • Description form: full metadata editor — title-info, src-title-info, publish-info, document-info, plus a ProseMirror-in-a-dialog rich annotation editor with the same marks as the body editor.
  • Binary manager: upload / rename / delete / cover-badge, with inline <image> rendering in the editor body.
  • Search / Replace: Cmd-F / Cmd-H inline bar with regex, case-sensitivity, whole-word (Unicode-aware), and follow-active-match scrolling.
  • Configurable hotkeys: Settings → Shortcuts tab, per-action keystroke capture, conflict detection, reset-to-defaults. Bindings are stored in the standard OS config file and migrate forward automatically when new actions are added.
  • Platform polish: code-signed + notarized macOS universal DMG (arm64 + x86_64); Linux x86_64 AppImage with .desktop, GNOME thumbnailer, and shared-MIME registration; native-webview spellcheck per document <lang>.
  • Auto-update notify: in-app banner surfaces newer GitHub Releases; one-click opens the Release page in the OS browser.
  • HTML export: Go text/template renderer (internal/fb2/export/html).
  • XSD validation: read-only XML-source panel with clickable line-highlighted errors; libxml2 via -tags xsd.

Not shipping in 1.0 — each documented with rationale in docs/PHASES.md:

  • Windows — explicitly out of scope. The C++ FBE remains the Windows story.
  • Scripts compatibility (FBE's .js macro surface) — deferred post-1.0. Hundreds of user-authored macros make this a separate-project-scale effort; revisit on concrete user demand.
  • Hunspell CGo speller — native webview spellcheck handles dictionaries on both platforms; CGo path is stubbed behind -tags speller_hunspell for a future opt-in build.
  • QuickLook .appex preview extension — deferred pending hardware refresh.
  • Linux arm64 — deferred; GitHub's hosted runners are x86_64-only.

See PROGRESS.md for the per-revision development log, CHANGELOG.md for the user-facing release history, docs/PHASES.md for the roadmap, and docs/OPERATIONS.md for the full list of FB2 operations and their ProseMirror equivalents.

Linux runtime requirements (AppImage users)

The Linux AppImage does not bundle WebKit — it uses the system copy. Install your distro's webkit2gtk-4.1 package before launching:

Distro Package
Fedora / RHEL webkit2gtk4.1
Debian / Ubuntu libwebkit2gtk-4.1-0
Arch / Manjaro webkit2gtk-4.1
openSUSE libwebkit2gtk-4_1-0
NixOS enable programs.nix-ld or run via appimage-run / steam-run

Why: WebKit forks helper processes (WebKitNetworkProcess, WebKitWebProcess) from a path baked into libwebkit2gtk at compile time, with no runtime override. A bundled libwebkit built on Ubuntu crashes on every other distro. The system libwebkit always knows where its own helpers live, so this is the only portable approach. Same trade-off Tauri and most GTK-WebKit AppImages make.

Prerequisites

  • Go 1.25+
  • Node 20+ (for the frontend)
  • Wails v2 CLI: go install github.com/wailsapp/wails/v2/cmd/wails@latest
  • macOS: Xcode Command Line Tools (xcode-select --install)
  • Linux: libwebkit2gtk-4.1-dev, libgtk-3-dev
  • For XSD validation (-tags xsd): libxml2 (macOS: bundled in CLT; Linux: libxml2-dev)
  • For spellcheck: hunspell + dictionaries (CGo path, future)

Nix / NixOS

A flake.nix provides a cross-platform dev shell (Linux + macOS) with Go 1.25, Node 22, and all native deps wired up. Wails CLI is auto-installed into $GOPATH/bin on first entry:

nix develop                          # enter shell
wails build -tags 'xsd webkit2_41'   # or: wails dev -tags webkit2_41

webkit2_41 selects the webkit2gtk-4.1 ABI (default is still 4.0, not in modern nixpkgs). The tag is a no-op on macOS.

Works on x86_64-linux, aarch64-linux, x86_64-darwin, aarch64-darwin.

Layout

cmd/fbe/            — CLI (replaces FBV validator and covers batch ops)
internal/fb2/       — core library (parse/write/validate/zip/binary/thumb/search)
frontend/           — TypeScript + Svelte + ProseMirror editor surface
docs/               — architecture, operations catalog, roadmap
testdata/           — sample .fb2 files
build/              — Wails build artifacts (gitignored)

Build

# CLI (works standalone — validate, repack, extract thumbnail)
go build -o build/fbe ./cmd/fbe

# Desktop app (requires Wails CLI)
wails dev      # hot-reload dev mode
wails build    # production bundle

Docs

  • sopds-go — self-hosted OPDS catalog server. Same author, same FB2 ecosystem, complementary role: fbe-go edits books; sopds-go serves them. PostgreSQL-backed library scanner with FB2 → EPUB/MOBI conversion and optional GPU-accelerated TTS. Edit metadata in fbe-go, then point sopds-go at the directory and read them on any OPDS-capable e-reader app (Moon+ Reader, FBReader, Calibre).

License

Released under the MIT License — see LICENSE for the full text. Third-party components bundled or depended on are listed with their own licenses and attribution notices in NOTICE.md.

Legacy & acknowledgements

fbe-go is an independent rewrite, not a code-level port. The editor surface moved from MSHTML contentEditable to a ProseMirror view, the XML layer from MSXML to Go's encoding/xml + libxml2 for validation, and the host from C++/WTL to Go + Wails. No source from the original project was reused.

Thanks to:

  • Dmitry Gribov — the FictionBook 2.0 specification and XSD schemas (2004, BSD). Those schemas ship inside every fbe-go binary and are the ground truth the validator checks against.
  • evpobr and the classic FBE maintainers — their Windows-only FBE defined the operations catalog (clone / merge / insert cite / poem / table / …) that docs/OPERATIONS.md cross-references. Their UX is why fbe-go has the shape it has.
  • Wails v2 (Lea Anthony et al.) — Go desktop framework, why this app can ship macOS+Linux from one codebase.
  • ProseMirror (Marijn Haverbeke et al.) — the editor framework; FB2's mixed-content model fits its schema system almost perfectly.
  • libxml2 (Daniel Veillard) and lestrrat-go/libxml2 (Daisuke Maki) — XSD validation we rely on in -tags xsd builds.
  • Every upstream listed in NOTICE.md.