Documentation management system: Markdown to searchable books, PDFs, and web docs.
  • Rust 65.8%
  • HTML 25.5%
  • TypeScript 5.8%
  • CSS 1%
  • JavaScript 0.8%
  • Other 1.1%
Find a file
mik-tf 647db71dc2
Some checks failed
Test / test (push) Failing after 2m37s
Test / integration (push) Has been skipped
lab publish / publish (push) Failing after 8m27s
auto-update-devbooks / update (push) Failing after 9m17s
ci(lab-publish): publish latest from main, latest-dev from development
Match the canonical pattern so development publishes the latest-dev prerelease
tag instead of overwriting the stable latest release. Pick the release tag by
branch (main -> latest, development -> latest-dev, v* -> ref name).

See lhumina_code/home#268

Signed-by: mik-tf <mik-tf@noreply.invalid>
2026-06-07 17:35:49 -04:00
.forgejo/workflows ci(lab-publish): publish latest from main, latest-dev from development 2026-06-07 17:35:49 -04:00
.hero chore: rename HERO_SOCKET_DIR → PATH_SOCKET and prune stale env declarations 2026-05-26 12:27:12 +02:00
crates chore: rename herolib_derive → herolib_macros across workspace 2026-06-06 21:29:33 +02:00
deploy/single-vm chore: rename HERO_SOCKET_DIR → PATH_SOCKET and prune stale env declarations 2026-05-26 12:27:12 +02:00
docs chore: rename HERO_SOCKET_DIR → PATH_SOCKET and prune stale env declarations 2026-05-26 12:27:12 +02:00
specs chore: rename HERO_SOCKET_DIR → PATH_SOCKET and prune stale env declarations 2026-05-26 12:27:12 +02:00
tests/e2e fix: update E2E tests for unified library tree book names 2026-02-13 13:00:35 -05:00
.gitignore chore: remove Cargo.lock and update gitignore 2026-06-06 08:05:25 +02:00
Cargo.toml chore: rename herolib_derive → herolib_macros across workspace 2026-06-06 21:29:33 +02:00
Cargo.toml.hero_builder_backup chore: add Cargo.toml.hero_builder_backup snapshot 2026-06-01 12:57:46 +02:00
LICENSE Initial commit: AtlasServer Rust implementation 2026-01-19 09:05:23 +01:00
PURPOSE.md chore: rename HERO_SOCKET_DIR → PATH_SOCKET and prune stale env declarations 2026-05-26 12:27:12 +02:00
README.md chore: rename HERO_SOCKET_DIR → PATH_SOCKET and prune stale env declarations 2026-05-26 12:27:12 +02:00
rust-toolchain.toml chore: bump toolchain to 1.96, normalize rust-version fields, add builder backups 2026-06-01 07:35:54 +02:00
SKILL.md chore: rename HERO_SOCKET_DIR → PATH_SOCKET and prune stale env declarations 2026-05-26 12:27:12 +02: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 $PATH_SOCKET/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: $PATH_SOCKET/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
PATH_SOCKET 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