Documentation management system: Markdown to searchable books, PDFs, and web docs.
  • Rust 68.4%
  • HTML 23.3%
  • TypeScript 5.3%
  • CSS 0.9%
  • JavaScript 0.7%
  • Other 1.4%
Find a file
Scott Yeager 9a3a0fc7d7
Some checks failed
auto-update-devbooks / update (push) Failing after 2m58s
Test / test (push) Successful in 11m6s
Test / integration (push) Successful in 5m57s
lab release / release (push) Successful in 1h3m27s
Merge development_freeze into development: freeze macros at known-good pre-migration state (revert in-progress migration; old-stack pins, blueprint-free)
2026-06-10 21:22:20 +00:00
.forgejo/workflows ci: canonical lab-release (cargo check + multi-arch + hero.releaser) 2026-06-10 19:43:33 +02:00
.hero chore: add hero_builder artifacts, update Cargo deps, remove tracked node_modules 2026-05-10 14:49:21 +02:00
crates fix(service.toml): drop spurious inter-service dependencies so a fresh tester's books stack starts 2026-05-31 23:18:22 -04:00
deploy/single-vm chore: align hero_books with hero_sockets and simplify the README (#97) 2026-04-21 07:34:57 +00:00
docs chore: align repo structure with hero_compute 2026-04-27 20:21:52 +03:00
specs chore: clean up specs/ — drop stale planning docs, keep runtime artifacts 2026-04-27 20:35:52 +03:00
tests/e2e fix: update E2E tests for unified library tree book names 2026-02-13 13:00:35 -05:00
.env.example chore: align hero_books with hero_sockets and simplify the README (#97) 2026-04-21 07:34:57 +00:00
.gitignore refactor: simplify Makefile — move all logic to scripts 2026-03-02 10:57:43 +02:00
Cargo.lock development_freeze: freeze codegen era byte-for-byte onto pristine macros_previous mirrors (frozen_d7aa082e + frozen_d31c7b63); blueprint-free, builds green; OSIS migration deferred 2026-06-09 19:02:36 +00:00
Cargo.toml development_freeze: freeze codegen era byte-for-byte onto pristine macros_previous mirrors (frozen_d7aa082e + frozen_d31c7b63); blueprint-free, builds green; OSIS migration deferred 2026-06-09 19:02:36 +00:00
Cargo.toml.hero_builder_backup chore: add hero_builder artifacts, update Cargo deps, remove tracked node_modules 2026-05-10 14:49:21 +02:00
LICENSE Initial commit: AtlasServer Rust implementation 2026-01-19 09:05:23 +01:00
PURPOSE.md rename hero_books_ui → hero_books_web; drop Makefile and shell scripts 2026-05-07 21:56:39 +02:00
README.md rename hero_books_ui → hero_books_web; drop Makefile and shell scripts 2026-05-07 21:56:39 +02:00
rust-toolchain.toml fix(toolchain): bump rust-toolchain.toml 1.95 → 1.96 to match workspace rust-version + herolib deps 2026-06-03 12:55:01 +02:00
SKILL.md Sync: 8 files changed, 503 insertions(+), 1 deletion(-) 2026-03-07 19:45:09 +01:00

Hero Books

A documentation management and publishing system built in Rust. Turns collections of Markdown into searchable books, PDFs, and web-served documentation with AI-powered Q&A extraction and semantic search.

New here? Read the Core Concepts guide for the full picture — DocTrees, Collections, Books, and how they relate.

How It Works

  1. Write Markdown in folders marked with a .collection file ("collections").
  2. Define a book with a TOML or HeroScript config that picks pages from collections.
  3. Run the server — it scans, validates, exports, and serves the books over JSON-RPC.
  4. Browse via the reader UI, generate PDFs, or query the OpenRPC API.

Optional: hero_embedder adds semantic search and Q&A extraction. Without it, Hero Books runs in degraded mode — reader UI, PDF, and Markdown browsing still work.

Requirements

  • Rust toolchain (1.93+) to build from source
  • bun (only if you generate Docusaurus sites via hero_docs or docs.* RPC)
  • hero_proc process supervisor (must be running)
  • hero_embedder for vector search, Q&A, and semantic retrieval (optional — see degraded mode)

Quick Start

Recommended (Hero-native install path via hero_skills):

service embedder install ; service embedder start
service books    install ; service books    start

Everything is installed, sockets wired, and supervised by hero_proc.

Or download the pre-built binaries:

service books install --download
service books start

Service Architecture

Hero Books is supervised by hero_proc via the hero_skills nu service scripts.

Binary Purpose
hero_books_server JSON-RPC 2.0 daemon (Unix socket only)
hero_books_web User-facing reader UI over HTTP
hero_books_admin Admin dashboard
hero_docs Generate Docusaurus sites from HeroScript ebook directories

All binaries install to ~/hero/bin/.

Sockets

All services bind Unix domain sockets only — no TCP. Sockets live under $HERO_SOCKET_DIR/hero_books/ (default: ~/hero/var/sockets/hero_books/), following the hero_sockets convention.

Binary Socket Protocol
hero_books_server rpc.sock JSON-RPC 2.0 / OpenRPC
hero_books_web web.sock HTTP (reader UI)
hero_books_admin admin.sock HTTP (admin dashboard)

Dependency socket: $HERO_SOCKET_DIR/hero_embedder/rpc.sock.

Every socket exposes GET /health and GET /.well-known/heroservice.json. The RPC socket additionally exposes POST /rpc and GET /openrpc.json.

Service Commands

Use Nushell service scripts from hero_skills:

service books install        # build and install all binaries
service books start          # register with hero_proc and start
service books stop           # stop and unregister
service books status         # show service status
service books install --download   # download pre-built binaries
service books start --update       # pull latest code, rebuild, restart

Environment Variables

Follows the env_secrets convention — source your env file before running.

Variable Required Purpose
GROQ_API_KEY Yes Groq API for Q&A extraction
OPENROUTER_API_KEY Yes OpenRouter API for LLM fallback
SAMBANOVA_API_KEY No Additional LLM provider
GIT_TOKEN No Personal access token for private repos
HEROBOOKS_PASSWORD No HTTP Basic Auth (user: hero)
HERO_EMBEDDER_URL No Override embedder endpoint
HERO_SECRET No JWT secret for hero_auth
HERO_AUTH_URL No Hero Auth server URL
HERO_SOCKET_DIR No Override socket root (default: ~/hero/var/sockets)

Troubleshooting

  • WARN Cannot persist state (hero_embedder unavailable): ...hero_embedder is not running. Hero Books is in degraded mode; reader UI and PDF still work. Start hero_embedder and restart hero_books to enable search and Q&A.
  • Failed to bind Unix socket at ... — another hero_books process is already using the socket. Run service books stop (or kill the stale process) and try again.
  • Socket path questions — see the Sockets section and hero_sockets convention.

Documentation

Full documentation lives under docs/:

Crate-level docs:

License

Apache-2.0