Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

Core concepts

Understand projects, navigation, variants, static output, and the runtime, and all the configuration that follows becomes intuitive.

Rendering pipeline

A build starts by reading docs.yml and ends by writing a static directory. The whole process never executes any author code.

StagePackageWhat it does
Parse@bitidocs/coreLoads and validates docs.yml (docs.json is read too), resolves navigation, parses MDX into a syntax tree, and safely evaluates props
API@bitidocs/openapiParses, upgrades (Swagger 2 / OAS 3.0 → 3.1), and dereferences OpenAPI, and generates examples and code snippets in 9 languages
Build@bitidocs/builderPre-highlights every code block with Shiki (light / dark themes), renders each page, and writes HTML, Markdown, llms.txt, the sitemap, and the Pagefind search index
Render@bitidocs/uiReact server rendering (renderToStaticMarkup) that outputs zero-hydration static HTML
Browser@bitidocs/clientA tiny entry script: client-side navigation, theme switching, interactive components; heavy overlays like search, Ask AI, and the playground load on demand
Runtime@bitidocs/runtimeStatic file serving plus dynamic endpoints, provided by the hosted platform

Site model

Navigation has three layers:

Tabs

Top-level entries shown in the header, such as this site's "Guides", "Components", "API Reference", and "Changelog". Declare them under tabs: in docs.yml and reference them in navigation: with - tab: <id>. A tab can have its own URL segment (slug) or omit it with skip-slug: true.

Sections

Groups in the sidebar, nestable to any depth. A section can have an overview page (path), can be collapsed by default (collapsed), and by default contributes a URL segment to the pages under it.

Pages and other nodes

page (one MDX file), link (an external or internal link), folder (generated automatically from a directory), api (a set of endpoint pages generated from OpenAPI), and changelog (a changelog generated from dated files).

See Navigation for the full syntax.

Variants: product × version × locale

The same navigation can be expanded into multiple variants. Each variant has its own URL prefix:

DimensionConfigExample URL prefixDefault
Localelanguages:/enThe default locale has no prefix
Productproducts:/sdkThe first product also has its own segment
Versionversions: (or versions: under a product)/v0The first version has no prefix

Prefixes are joined in the order basepath → locale → product → version. For example, on this site:

  • Chinese v1: /guides/get-started/quickstart
  • English v1: /en/guides/get-started/quickstart
  • Chinese v0: /v0/guides/get-started/quickstart

Pages that have the same tab id, section titles, and page title across variants are treated as the same page: the locale and version switchers jump straight to the corresponding page, and the builder uses this to output hreflang and canonical tags for older versions.

Static output and the runtime

Static output (always present)

  • One index.html and one .md per page
  • llms.txt and llms-full.txt (one per locale)
  • sitemap.xml, robots.txt, _redirects, 404.html
  • Pagefind search index, OpenAPI specs and the API catalog, skills
  • RSS for the changelog
  • Pre-compressed .br / .gz

Runtime

  • /_biti/ai/chat: Ask AI (SSE streaming answers)
  • /_mcp/server: the site's MCP server
  • /_biti/proxy: API playground proxy
  • /_biti/feedback: "Was this page helpful?"
  • /_biti/e: page analytics events
  • Returns Markdown for Accept: text/markdown, and Markdown 404s for missing pages

The static output handles browsing and search, and the runtime layers dynamic features on top. The hosted platform provides the runtime for every site.

Security model

ButterIX is a multi-tenant platform: docs uploaded by anyone are built on the same set of services. MDX therefore supports only a safe subset: you can use components and literal props, but you can't import arbitrary modules, write functions, or run scripts. See Safe subset for the reasons and details.

Site-level custom css / js (declared in docs.yml) still work. They're output to the page as plain <link /> and <script defer> tags and are unrelated to how doc content is parsed. The visual editor preview doesn't load custom scripts.