Architecture
Build pipeline
Docsmithexposes the static and fluent API.Buildercollects configuration: versions, hub entries, LLM export, theme, Open Graph, and more.BuildConfigvalidates the source and output paths.SourceScannerdiscovers Markdown files and reads frontmatter. Versioned builds scan one source directory per version.CommonMarkRendererconverts Markdown to HTML through League CommonMark with GitHub-flavored Markdown extensions.SiteBuilderrenders pages with sidebar navigation, version pills, and the hub dropdown, and writes them to the output directory. It rewrites relative media references so images, videos, and downloads resolve from the built page locations.AssetPublisherpublishes CSS and JS assets, minifying them throughAssetMinifierbefore writing, and generatessearch-index.json,sitemap.xml,.nojekyll, and the LLM export files.MediaPublishercopies image, video, audio, and PDF files from the source tree into the output directory, preserving their relative structure (disable withpublishMedia(false)).
Remote source syncing lives in src/RemoteSources/ and runs before a build. It only writes local directories; the pipeline above never talks to the network.
Document model
Every discovered Markdown file becomes a Document object containing:
- source path
- relative path
- output path
- title
- raw Markdown
- rendered HTML