---
title: Core concepts
subtitle: Understand projects, navigation, variants, static output, and the runtime, and all the configuration that follows becomes intuitive.
description: The ButterIX rendering pipeline, the site model (tabs, sections, pages), variants (product × version × locale), and the split between static output and the dynamic runtime.
---

## Rendering pipeline

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

```mermaid
flowchart LR
  A["docs.yml<br/>pages/*.mdx<br/>openapi.yml"] --> B["@bitidocs/core<br/>config · navigation · MDX safe subset"]
  B --> C["@bitidocs/builder<br/>Shiki pre-highlighting · per-page rendering"]
  C --> D["@bitidocs/ui<br/>React server rendering → HTML"]
  D --> E["Static output<br/>HTML · .md · llms.txt<br/>sitemap · search index"]
  E --> F["Runtime<br/>Ask AI · MCP · playground proxy<br/>feedback · analytics"]
```

| Stage | Package | What it does |
|---|---|---|
| Parse | `@bitidocs/core` | Loads and validates `docs.yml` (`docs.json` is read too), resolves navigation, parses MDX into a syntax tree, and safely evaluates props |
| API | `@bitidocs/openapi` | Parses, upgrades (Swagger 2 / OAS 3.0 → 3.1), and dereferences OpenAPI, and generates examples and code snippets in 9 languages |
| Build | `@bitidocs/builder` | Pre-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/ui` | React server rendering (`renderToStaticMarkup`) that outputs zero-hydration static HTML |
| Browser | `@bitidocs/client` | A tiny entry script: client-side navigation, theme switching, interactive components; heavy overlays like search, Ask AI, and the playground load on demand |
| Runtime | `@bitidocs/runtime` | Static file serving plus dynamic endpoints, provided by the hosted platform |

## Site model

Navigation has three layers:

<AccordionGroup>
  <Accordion title="Tabs" icon="lucide:panels-top-left" defaultOpen>
    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`.
  </Accordion>
  <Accordion title="Sections" icon="lucide:list-tree">
    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.
  </Accordion>
  <Accordion title="Pages and other nodes" icon="lucide:file-text">
    `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).
  </Accordion>
</AccordionGroup>

See [Navigation](../configuration/navigation.mdx) for the full syntax.

## Variants: product × version × locale

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

| Dimension | Config | Example URL prefix | Default |
|---|---|---|---|
| Locale | `languages:` | `/en` | The default locale has no prefix |
| Product | `products:` | `/sdk` | The first product also has its own segment |
| Version | `versions:` (or `versions:` under a product) | `/v0` | The 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

<Columns cols={2}>
  <Column>
    ### 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`
  </Column>
  <Column>
    ### 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
  </Column>
</Columns>

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](../writing/safe-mdx.mdx) for the reasons and details.

<Note>
  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.
</Note>
