Engine

The materialization layer that transforms ciderpress.config.ts into a Rspress-compatible documentation site.

Overview

The engine reads a declarative config, discovers markdown files via globs, resolves the information architecture (sidebar, nav, landing pages), and writes everything into .ciderpress/content/. Rspress only consumes the engine's output in .ciderpress/content/.

Key Concepts

  • Config-driven -- The config defines the entire information architecture. No separate sidebar or nav config files.
  • Glob-driven discovery -- Patterns auto-discover files without manual entry per page.
  • Virtual pages -- Landing pages and home pages are generated as MDX at sync time.
  • Multi-sidebar -- Root entries share /, isolated sections use distinct namespaces (e.g., /apps/api/).
  • Incremental -- Mtime checks, content hashes, and config hashes skip unchanged work between syncs.

Build vs Dev

Build (ciderpress build) runs a single sync pass:

loadConfig() --> sync() --> createRspressConfig() --> rspress build() --> .ciderpress/dist/

Dev (ciderpress dev) runs sync then enters a watch loop:

loadConfig() --> sync() --> createRspressConfig() --> rspress dev() --> watcher

After initial sync, the watcher monitors the repo and triggers incremental resyncs. See Dev Mode for how the watch loop works.

Topics

TopicWhat it covers
PipelineThe sync pipeline, page transformation, entry resolution, multi-sidebar
Incremental SyncMtime-based skipping, content hashing, structural change detection
OpenAPI SyncSpec dereferencing, MDX generation, sidebar building
Dev ModeFile watching, debouncing, HMR, config reload, concurrency

References