Skip to content

Commit 3c48beb

Browse files
[Docs] moved to docusaurus for the docs migration (#37)
1 parent 8746640 commit 3c48beb

117 files changed

Lines changed: 19559 additions & 391 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/deploy.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: npm
27+
28+
- run: npm ci
29+
- run: npm run build
30+
31+
- uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: build
34+
35+
deploy:
36+
needs: build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
steps:
42+
- id: deployment
43+
uses: actions/deploy-pages@v4

‎.gitignore‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,13 @@
55

66
# Context files (local only)
77
.context/
8+
9+
# Node dependencies
10+
node_modules/
11+
12+
# This project uses npm (package-lock.json); reject yarn lockfiles
13+
yarn.lock
14+
15+
# Docusaurus generated files
16+
.docusaurus/
17+
build/

‎AGENTS.md‎

Lines changed: 103 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,126 @@
11
# AGENTS.md
22

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.
44

55
## Quick Orientation
66

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)
1215

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
1717

1818
```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
2023
```
2124

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
2338

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)
2748
```
2849

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
3092

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
3798

38-
## Editing Rules Of Thumb
99+
## Deployment
39100

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
46105

47-
## Validation
106+
## Build Warnings to Expect
48107

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)
53110

54-
## Things That May Surprise You
111+
## Editing Rules
55112

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
59119

60120
## Good First Checks For Any Task
61121

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

‎Dockerfile‎

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
1-
# Use Node.js official image
1+
# Development-only Dockerfile for local preview
22
FROM node:20-alpine
33

4-
# Set working directory
54
WORKDIR /app
65

7-
# Install Mintlify CLI (pinned to a verified working version)
8-
RUN npm install -g mint@4.2.516
6+
COPY package.json package-lock.json* ./
7+
RUN npm ci
98

10-
# Create a user and group with specific UID and GID so kubernetes knows
11-
# it's not a root user. Alpine images ship with /bin/sh by default.
12-
RUN addgroup -g 1001 centml && adduser -D -s /bin/sh -u 1001 -G centml centml
13-
14-
# Copy all documentation files
159
COPY . .
1610

17-
# Change ownership of the app directory to centml user
18-
RUN chown -R centml:centml /app
19-
20-
# Switch to non-root user
21-
USER 1001:1001
22-
23-
# Expose port 3000 (default Mintlify dev port)
2411
EXPOSE 3000
25-
26-
# Command to run Mintlify dev server
27-
CMD ["mint", "dev"]
12+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)