Skip to content

Commit e8610fa

Browse files
committed
docs: add how to edit
1 parent 11caf7b commit e8610fa

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
Photon Docs
1+
# Photon Docs
22

3-
AI-assisted writing
3+
The documentation site at [photon.codes](https://photon.codes/), built with [Mintlify](https://mintlify.com/) and driven by [vellum](https://github.com/photon-hq/vellum). Vellum extracts type information from installed npm packages and renders `.mdx.vel` templates into the `.mdx` files Mintlify ships.
44

5-
Set up your AI coding tool to work with Mintlify:
5+
## How to edit
66

7-
```bash
8-
npx skills add https://mintlify.com/docs
9-
```
7+
1. **Edit the source, not the output.** Sources live in [`docs-src/`](docs-src/) as `.mdx.vel` files. The rendered `.mdx` files at the repo root are build artifacts — gitignored on `main`, only present on the `dist` branch. Don't edit them directly; they get overwritten on every deploy.
108

11-
This command installs Mintlify's documentation skill for your configured AI tools like Claude Code, Cursor, Windsurf, and others. The skill includes component reference, writing standards, and workflow guidance.
9+
2. **Render and preview locally:**
1210

13-
See the [AI tools guides](/ai-tools) for tool-specific setup.
11+
```bash
12+
pnpm install
13+
pnpm docs:generate # vellum: .mdx.vel -> .mdx
14+
mint dev # preview at http://localhost:3000
15+
```
1416

15-
Development
17+
If you don't have the Mintlify CLI: `npm i -g mint`.
1618

17-
Install the [Mintlify CLI](https://www.npmjs.com/package/mint) to preview your documentation changes locally. To install, use the following command:
19+
3. **Verify before opening a PR:**
1820

19-
```
20-
npm i -g mint
21-
```
21+
```bash
22+
pnpm lint
23+
pnpm typecheck:docs
24+
```
2225

23-
Run the following command at the root of your documentation, where your `docs.json` is located:
26+
4. **Open the PR against `main`.** Don't commit rendered `.mdx` files — they're regenerated by CI.
2427

25-
```
26-
mint dev
27-
```
28+
## How deployment works
2829

29-
View your local preview at `http://localhost:3000`.
30+
Push to `main`[.github/workflows/deploy-dist.yml](.github/workflows/deploy-dist.yml) runs `pnpm docs:generate` and force-pushes the rendered tree to the `dist` branch → Mintlify rebuilds from `dist`.
3031

31-
Publishing changes
32+
The Spectrum API reference is generated from a remote OpenAPI spec configured in [docs.json](docs.json), fetched at build time, so every rebuild picks up the latest API surface without a docs commit.
3233

33-
Install our GitHub app from your [dashboard](https://dashboard.mintlify.com/settings/organization/github-app) to propagate changes from your repo to your deployment. Changes are deployed to production automatically after pushing to the default branch.
34+
## Auto-updates from SDK releases
3435

35-
Need help?
36+
When a connected SDK ships a release (e.g., [`spectrum-ts`](https://github.com/photon-hq/spectrum-ts), [`advanced-imessage-ts`](https://github.com/photon-hq/advanced-imessage-ts)), its release workflow calls [`photon-hq/buildspace/.github/workflows/update-docs.yaml`](https://github.com/photon-hq/buildspace/blob/main/.github/workflows/update-docs.yaml). That workflow uses Claude Code to draft a `docs/update-{sdk}-v{version}` PR here, bumping the package and updating any prose or types that drifted. Older PRs for the same SDK are auto-closed by [.github/workflows/close-stale-version-prs.yml](.github/workflows/close-stale-version-prs.yml).
3637

37-
Troubleshooting
38+
To enroll a new SDK, add `.github/workflows/update-docs.yaml` to its repo following the pattern in [advanced-imessage-ts](https://github.com/photon-hq/advanced-imessage-ts/blob/main/.github/workflows/update-docs.yaml).
3839

39-
If your dev environment isn't running: Run `mint update` to ensure you have the most recent version of the CLI.
40-
If a page loads as a 404: Make sure you are running in a folder with a valid `docs.json`.
40+
## Troubleshooting
4141

42-
Resources
43-
44-
Mintlify documentation](https://mintlify.com/docs)
42+
- **`mint dev` shows 404s:** make sure you're running it at the repo root where `docs.json` lives, and that `pnpm docs:generate` completed without errors first.
43+
- **CLI behaves oddly:** `mint update`.
44+
- **OpenAPI looks stale on the live site:** trigger the docs rebuild so Mintlify re-fetches the spec — push any commit to `main`, or fire the `repository_dispatch` from the relevant backend release.

0 commit comments

Comments
 (0)