Skip to content
zaunchatPublic

About

Zaun documentation: guides, examples and API reference for zaun-community, zaun-client and zaun-bot. AI-friendly (llms.txt, Markdown pages).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Zaun documentation

Deploy

The documentation site for Zaun: running a host (zaun-community), building apps and external bots (zaun-client), and writing bots that run inside a host (zaun-bot). Live at https://zaunchat.github.io/docs/.

  • Guide: hand-written, step-by-step pages in src/content/docs/guide/.
  • Examples: complete programs, in src/content/docs/examples/.
  • Reference: generated from the code repositories on every deploy and every day.
  • For AI tools: /llms.txt, /llms-full.txt, every page as <page>.md, and /api/index.json.

Built with Astro and Starlight.

Run it locally

Node.js 22+ (.nvmrc pins the version CI uses).

npm ci
npm run dev            # http://localhost:4321/docs/

The guide works on its own. To include the generated reference:

npm run gen:fetch                       # clones zaun-community, zaun-client, zaun-bot into .cache/src
npm run gen:wit                         # the bot WIT interface pages
ZAUN_DOCS_SKIP_HEAVY=1 npm run gen:rust # rustdoc HTML + Markdown, without zaun-client (slow)
npm run build                           # dist/, then an offline link check
npm run preview

gen:fetch takes refs from ZAUN_COMMUNITY_REF, ZAUN_CLIENT_REF and ZAUN_BOT_REF (default main), or uses existing checkouts with ZAUN_SOURCES_DIR=.. (directories named after the repos). gen:rust needs Rust; each repository's rust-toolchain.toml picks the toolchain.

How the reference is generated

Part Source Tool Output
Rust (HTML) zaun-client, zaun-bot (wasm32-wasip2), zaun-community-protocol cargo doc --no-deps public/api/rust/<crate>/, served as /api/rust/<crate>/
Rust (pages) the same crates rustdoc JSON (RUSTC_BOOTSTRAP=1, or ZAUN_DOCS_JSON_TOOLCHAIN=nightly) → scripts/rustdoc-md.mjs one Markdown page per public item in src/content/docs/reference/rust/<crate>/
TypeScript (bots) zaun-bot sdk/js/src/index.ts (@zaun/bot) TypeDoc + starlight-typedoc src/content/docs/reference/js/zaun-bot/
JavaScript (client) zaun-client zaun/js/index.d.ts TypeDoc + starlight-typedoc src/content/docs/reference/js/zaun-client/
Bot WIT zaun-bot wit/*.wit scripts/gen-wit.mjs src/content/docs/reference/wit/

Generated files are git-ignored. A section that wasn't generated is simply absent from a local build; CI (ZAUN_DOCS_STRICT=1) requires all of them.

Deploying

.github/workflows/deploy.yml builds and deploys to GitHub Pages on every push to main, daily at 04:17 UTC, by hand, and when another repository asks:

gh api repos/zaunchat/docs/dispatches -f event_type=docs-update \
  -F 'client_payload[bot_ref]=main'

Pages must be set to "GitHub Actions" in the repository settings. For a custom domain, set DOCS_SITE and DOCS_BASE (for example https://docs.example.org and /) in the workflow.

Pull requests run .github/workflows/ci.yml: the same build, an offline check of every internal link, and a report of external links.

Licence

The site's code is MIT; the documentation's content is CC BY 4.0. See LICENSE and LICENSE-CONTENT.

About

Zaun documentation: guides, examples and API reference for zaun-community, zaun-client and zaun-bot. AI-friendly (llms.txt, Markdown pages).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages