docs/README.md
This directory contains the assets required to build and update the Sui documentation. The directory is split between content and site.
If you are an AI agent, coding assistant, or LLM parsing this repository, start here.
llms.txtThe Sui documentation build generates an llms.txt file at https://docs.sui.io/llms.txt. Use it as your entry point for understanding the documentation structure and locating specific topics.
A condensed, machine-readable version of the Sui Documentation Style Guide is available as a skill file at SUI_STYLE_GUIDE_SKILL.md. This file contains all style rules from the full style guide in a format optimized for agent ingestion. Use it when writing or revising any documentation for this repository.
docs/
├── content/ # All documentation source files (.mdx)
│ ├── concepts/ # Sui architecture, objects, transactions, cryptography
│ ├── guides/ # Developer guides, tutorials, app examples
│ ├── references/ # API references, framework docs, CLI reference, contribution guides
│ ├── standards/ # Sui standards (Closed-Loop Token, DeepBook, Kiosk, Wallet)
│ └── sidebars.js # Navigation structure / page hierarchy
├── site/ # Docusaurus site configuration, plugins, and build output
│ ├── src/ # Custom components, plugins, utilities
│ ├── docusaurus.config.js
├── snippets/ # Reusable code snippets referenced by ImportContent
docs/content/sidebars.js: Defines the full navigation tree. Parse this to understand page hierarchy and relationships.docs/SUI_STYLE_GUIDE_SKILL.md: Condensed style guide rules. Ingest before writing or editing documentation.docs/content/references/contribute/style-guide.mdx: The full human-readable style guide source.docs/content/references/contribute/mdx-components.mdx: Reference for all custom MDX components and Docusaurus plugins.Several sections are auto-generated during the build and must not be edited directly:
/references/framework): Generated from cargo-doc Markdown in /sui/crates./references/sui-api/sui-graphql): Generated from the GraphQL schema..mdx files with YAML frontmatter (title, description, keywords).:::info, :::tip, :::caution, :::danger) for callouts.<ImportContent> component when possible, rather than copied inline. See the MDX Components page for component reference.index.mdx page using link.type: 'doc'To run docs.sui.io locally, open the site directory in a terminal or console. Use a package manager to install the required modules:
pnpm install
Run a full build to generate all required assets and compile the static site:
pnpm build
A full build is necessary after a fresh clone because it downloads specification files and generates content that the site depends on. The build script performs the following steps before compiling:
generate-import-context.js).grpc-download.js).graphql-to-doc), then removes entries without descriptions.getopenrpcspecs.js).massagegraphql.js).docusaurus build to compile the static site into site/build.llms.txt for LLM consumption.content directory.The build fails on errors like bad internal links or missing imports, and displays the cause of the error in the console.
If you get an error about missing open-rpc specs when running the site locally, run pnpm build first. It downloads and prepares the required files.
After a successful build, use the following command to start a development preview at localhost:3000:
pnpm start
The development server watches for changes to files in the content directory and site source files, and updates the UI to match any saves you make. The development preview ignores some errors (like broken internal links) to provide a faster feedback loop.
Run pnpm build again before submitting your changes for review, as the full build catches errors that the development preview does not.
Several sections of the documentation are auto-generated during the build and should not be edited directly.
Framework reference (/references/framework): Generated by the framework plugin, which imports cargo-doc Markdown from /sui/crates and transforms it into documentation pages. The build script removes this directory before each build and regenerates it from source. See the components documentation for details.
GraphQL reference (/references/sui-api/sui-graphql): Generated by the graphql-to-doc Docusaurus plugin, then cleaned by remove-no-desc.mjs. These pages are generated from the GraphQL schema and should not be manually edited.
OpenRPC and gRPC specifications: Downloaded during the build by utility scripts in src/utils/.
Sui uses Vercel to host its documentation site. Vercel builds a preview of the documentation for every pull request submitted to the Sui repo. You can find a link to this preview in the PR comment section from the Vercel bot. Click the Visit Preview link for the sui-core project to verify your changes behave as you expect.
To view the Vercel preview before your changes are ready for review, mark your PR as a draft.
All documentation contributions must follow the Sui Documentation Style Guide. A machine-readable version is available in SKILL.md at the root of this directory. Key requirements include:
The Sui documentation uses shared components from the ML Shared Docusaurus repo and Sui-specific components. For a complete reference of all custom components and plugins, see the MDX Components page.
The Sui documentation is distributed under the CC BY 4.0 license.