|
1 | 1 | # AGENTS.md |
2 | 2 |
|
3 | | -This repository is a Mintlify documentation site for NVIDIA CCluster. Future agents should optimize for safe documentation edits, fast local preview, and minimal assumptions about unpublished content. |
| 3 | +This repository is a Docusaurus 3 documentation site for NVIDIA CCluster. Agents should optimize for safe documentation edits, correct CSS overrides, and working builds. |
4 | 4 |
|
5 | 5 | ## Quick Orientation |
6 | 6 |
|
7 | | -- The docs site is configured by [docs.json](docs.json). |
8 | | -- Most content is written as `.mdx` files under [home/](home), [apps/](apps), [clients/](clients), [resources/](resources), and [examples/](examples). |
9 | | -- Shared MDX helpers currently live in [snippets/components.mdx](snippets/components.mdx). |
10 | | -- Static assets live in [images/](images). |
11 | | -- The local preview environment is containerized via [Dockerfile](Dockerfile) and [docker-compose.yml](docker-compose.yml). |
| 7 | +- **Framework:** Docusaurus 3 with `@docusaurus/preset-classic` |
| 8 | +- **Config:** [docusaurus.config.js](docusaurus.config.js) (site settings, navbar, footer) |
| 9 | +- **Sidebar:** [sidebars.js](sidebars.js) (page order, icons, grouping) |
| 10 | +- **Custom CSS:** [src/css/docs.css](src/css/docs.css) (all Infima/layout overrides) |
| 11 | +- **Icons:** [src/theme/DocSidebarItem/Link/icons.js](src/theme/DocSidebarItem/Link/icons.js) (lucide-react icon map) |
| 12 | +- **Content:** MDX files in [docs/](docs/) with `routeBasePath: '/'` |
| 13 | +- **Static assets:** [static/](static/) (images, CNAME, favicon) |
| 14 | +- **Deployment:** GitHub Pages via [.github/workflows/deploy.yml](.github/workflows/deploy.yml) |
12 | 15 |
|
13 | | -## Known Good Local Setup |
14 | | - |
15 | | -- The Dockerfile pins the Mintlify CLI to `mint@4.2.516`. |
16 | | -- Preferred preview command: |
| 16 | +## Local Development |
17 | 17 |
|
18 | 18 | ```bash |
19 | | -docker compose up --build |
| 19 | +npm start # dev server with hot-reload |
| 20 | +docker compose up # containerized dev server |
| 21 | +npm run build # production build → build/ |
| 22 | +npx docusaurus serve # serve production build locally |
20 | 23 | ``` |
21 | 24 |
|
22 | | -- Direct local CLI is acceptable, but keep it on the same version: |
| 25 | +## Repo Shape |
| 26 | + |
| 27 | +- [docs/home/](docs/home/) — getting started pages (introduction, quickstart) |
| 28 | +- [docs/deployments/](docs/deployments/) — LLM serving, inference, compute |
| 29 | +- [docs/clients/](docs/clients/) — SDK/client usage docs |
| 30 | +- [docs/resources/](docs/resources/) — operational and supporting guides |
| 31 | +- [docs/examples/](docs/examples/) — example pages and nested example groups |
| 32 | +- [src/theme/](src/theme/) — swizzled Docusaurus components |
| 33 | +- [src/css/](src/css/) — custom CSS overrides |
| 34 | + |
| 35 | +## CSS Architecture |
| 36 | + |
| 37 | +### Layout hierarchy |
23 | 38 |
|
24 | | -```bash |
25 | | -npm install -g mint@4.2.516 |
26 | | -mint dev |
| 39 | +``` |
| 40 | +body |
| 41 | + └── .navbar (padding zeroed; .navbar__inner handles gutters) |
| 42 | + └── .navbar__inner (max-width: 1440px, margin: auto, padding: 0 2rem) |
| 43 | + └── .main-wrapper (width: 100%, max-width: 1440px, margin: auto, padding: 0 2rem) |
| 44 | + └── [docSidebarContainer] (width: 220px, margin-right: 2rem) |
| 45 | + └── .row |
| 46 | + └── .col [docItemCol] (main content) |
| 47 | + └── .col.col--3 (TOC column) |
27 | 48 | ``` |
28 | 49 |
|
29 | | -## Repo Shape |
| 50 | +### Critical CSS variable |
| 51 | + |
| 52 | +```css |
| 53 | +:root { --doc-sidebar-width: 252px; } |
| 54 | +``` |
| 55 | + |
| 56 | +This syncs Docusaurus's internal layout calculation with actual sidebar width (220px + 32px margin). Without it, dead space appears beside the content. |
| 57 | + |
| 58 | +### Key rules and why they exist |
| 59 | + |
| 60 | +| Rule | Reason | |
| 61 | +|------|--------| |
| 62 | +| `.main-wrapper { width: 100% }` | Parent is flex with shrink:0; without this, content sets wrapper width → horizontal overflow | |
| 63 | +| `.navbar { padding-left: 0; padding-right: 0 }` | Zeroes Infima default so `.navbar__inner` padding aligns logo with sidebar | |
| 64 | +| `[class*='docItemCol'] { min-width: 0 }` | Flex items default to `min-width: auto`, preventing shrink below content size | |
| 65 | +| `.markdown { overflow-wrap: anywhere }` | Prevents long inline code from causing horizontal scroll | |
| 66 | +| `.table-of-contents:has(> li:only-child) { visibility: hidden }` | Hides TOC when only one heading (mirrors old Mintlify behavior), preserves column space | |
| 67 | + |
| 68 | +### Fixing horizontal overflow |
| 69 | + |
| 70 | +1. Ensure `.main-wrapper` has `width: 100%` |
| 71 | +2. Ensure `[class*='docItemCol']` has `min-width: 0` |
| 72 | +3. Ensure `.markdown` has `overflow-wrap: anywhere` |
| 73 | +4. For specific overflowing elements: `max-width: 100%; overflow-x: auto` |
| 74 | + |
| 75 | +### Changing sidebar width |
| 76 | + |
| 77 | +Update both values together: |
| 78 | +```css |
| 79 | +[class*='docSidebarContainer'] { width: Xpx; min-width: Xpx; } |
| 80 | +:root { --doc-sidebar-width: calc(Xpx + 32px); } |
| 81 | +``` |
| 82 | + |
| 83 | +## Sidebar Icons |
| 84 | + |
| 85 | +- `sidebars.js` assigns icon names via `customProps: { icon: 'icon-name' }` |
| 86 | +- `src/theme/DocSidebarItem/Link/index.js` — swizzled component rendering sidebar links |
| 87 | +- `src/theme/DocSidebarItem/Link/icons.js` — maps icon names → lucide-react components |
| 88 | + |
| 89 | +To add a new icon: import from `lucide-react`, add to `ICON_MAP` with key matching `customProps.icon`. |
| 90 | + |
| 91 | +## Content Editing |
30 | 92 |
|
31 | | -- [home/](home): entry-point pages |
32 | | -- [apps/](apps): product capability pages |
33 | | -- [clients/](clients): SDK/client usage docs |
34 | | -- [resources/](resources): operational and supporting guides |
35 | | -- [examples/](examples): example pages and nested example groups |
36 | | -- [endpoints/](endpoints): API-related files not currently exposed in navigation |
| 93 | +- Frontmatter: `title`, `description`, optional `sidebar_label` |
| 94 | +- Images: wrap in `<Frame>` component for bordered screenshots |
| 95 | +- Image paths: `/images/filename.png` (stored in `static/images/`) |
| 96 | +- For tall images, add inline style: `maxHeight: '360px', width: 'auto', margin: '0 auto'` |
| 97 | +- Hero card image height: controlled by `.ccluster-docs-hero-card__img { aspect-ratio: 5/2 }` in CSS |
37 | 98 |
|
38 | | -## Editing Rules Of Thumb |
| 99 | +## Deployment |
39 | 100 |
|
40 | | -- Treat [docs.json](docs.json) as the source of truth for page order and visibility. |
41 | | -- A file existing on disk does not mean it is published in the nav. |
42 | | -- Prefer local image references like `/images/file.png` for assets stored in this repo. |
43 | | -- Preserve existing MDX style and frontmatter keys such as `title`, `description`, `icon`, and optional `sidebarTitle` or `mode`. |
44 | | -- Reuse shared snippet components before introducing one-off duplicated UI blocks. |
45 | | -- Keep docs changes scoped; this repo does not appear to include general application code. |
| 101 | +- **Production:** GitHub Pages, triggered on push to `main` |
| 102 | +- **Custom domain:** `docs.centml.ai` (configured via `static/CNAME`) |
| 103 | +- **TLS:** automatic via GitHub (Let's Encrypt) |
| 104 | +- **Workflow:** `.github/workflows/deploy.yml` runs `npm ci` → `npm run build` → deploy-pages |
46 | 105 |
|
47 | | -## Validation |
| 106 | +## Build Warnings to Expect |
48 | 107 |
|
49 | | -- Primary validation is a working Mintlify preview. |
50 | | -- There is no obvious test or lint command checked into the repository today. |
51 | | -- For navigation changes, verify both the rendered page and the sidebar placement. |
52 | | -- For image changes, verify the asset path and rendering in preview. |
| 108 | +- `onBrokenMarkdownLinks` deprecation warning (harmless, Docusaurus v4 migration path) |
| 109 | +- Broken links to `/resources/cli` and `/resources/sdk` (pages not yet created) |
53 | 110 |
|
54 | | -## Things That May Surprise You |
| 111 | +## Editing Rules |
55 | 112 |
|
56 | | -- The current [README.md](README.md) is repo-specific and should stay aligned with the repository’s Mintlify workflow. |
57 | | -- The repository contains some content and assets that are not currently referenced from navigation. |
58 | | -- There is a local `node_modules/` directory in the working tree environment, but it is not tracked by git and should not be relied on as repository metadata. |
| 113 | +- `sidebars.js` is the source of truth for page order and visibility |
| 114 | +- A file existing on disk does not mean it is in the nav |
| 115 | +- Prefer local image references `/images/file.png` |
| 116 | +- Preserve existing MDX style and frontmatter keys |
| 117 | +- Keep docs changes scoped; this repo is docs-only, no application code |
| 118 | +- Test with `npm run build` before pushing — catches broken links and build errors |
59 | 119 |
|
60 | 120 | ## Good First Checks For Any Task |
61 | 121 |
|
62 | | -1. Read [README.md](README.md) and [docs.json](docs.json). |
63 | | -2. Inspect the target page and any shared snippet it imports. |
64 | | -3. Confirm whether the page is navigation-backed or just present in the repo. |
65 | | -4. Use the Docker preview if anything about Mintlify versioning seems uncertain. |
| 122 | +1. Read this file and [docusaurus.config.js](docusaurus.config.js) |
| 123 | +2. Run `npm run build` to verify nothing is broken |
| 124 | +3. Inspect the target page's MDX and any component it uses |
| 125 | +4. Confirm whether the page is in `sidebars.js` or just exists on disk |
| 126 | +5. Check `src/css/docs.css` before adding new style rules — the override may already exist |
0 commit comments