Skip to content

Commit 2a6b547

Browse files
authored
Merge pull request #33 from heygen-com/docs/mintlify-setup
docs: add Mintlify documentation site
2 parents 20be2ea + 4328334 commit 2a6b547

26 files changed

Lines changed: 3932 additions & 2 deletions

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,31 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13+
changes:
14+
name: Detect changes
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 2
17+
outputs:
18+
code: ${{ steps.filter.outputs.code }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: dorny/paths-filter@v3
22+
id: filter
23+
with:
24+
filters: |
25+
code:
26+
- "packages/**"
27+
- "scripts/**"
28+
- "package.json"
29+
- "pnpm-lock.yaml"
30+
- "pnpm-workspace.yaml"
31+
- "tsconfig*.json"
32+
- "Dockerfile*"
33+
1334
build:
1435
name: Build
36+
needs: changes
37+
if: needs.changes.outputs.code == 'true'
1538
runs-on: ubuntu-latest
1639
timeout-minutes: 10
1740
steps:
@@ -28,6 +51,8 @@ jobs:
2851

2952
typecheck:
3053
name: Typecheck
54+
needs: changes
55+
if: needs.changes.outputs.code == 'true'
3156
runs-on: ubuntu-latest
3257
timeout-minutes: 10
3358
steps:
@@ -45,6 +70,8 @@ jobs:
4570

4671
test-core:
4772
name: "Test: core"
73+
needs: changes
74+
if: needs.changes.outputs.code == 'true'
4875
runs-on: ubuntu-latest
4976
timeout-minutes: 10
5077
steps:
@@ -61,6 +88,8 @@ jobs:
6188

6289
test-engine:
6390
name: "Test: engine"
91+
needs: changes
92+
if: needs.changes.outputs.code == 'true'
6493
runs-on: ubuntu-latest
6594
timeout-minutes: 10
6695
steps:
@@ -77,6 +106,8 @@ jobs:
77106

78107
test-runtime-contract:
79108
name: "Test: runtime contract"
109+
needs: changes
110+
if: needs.changes.outputs.code == 'true'
80111
runs-on: ubuntu-latest
81112
timeout-minutes: 10
82113
steps:

.github/workflows/docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Docs
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "docs/**"
7+
- "DOCS_GUIDELINES.md"
8+
push:
9+
branches: [main]
10+
paths:
11+
- "docs/**"
12+
13+
concurrency:
14+
group: docs-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
validate:
19+
name: Validate docs
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 5
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 22
28+
29+
- name: Validate build
30+
working-directory: docs
31+
run: npx mint validate
32+
33+
- name: Check broken links
34+
working-directory: docs
35+
run: npx mint broken-links

.github/workflows/regression.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,27 @@ on:
77
- main
88

99
jobs:
10+
changes:
11+
name: Detect changes
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 2
14+
outputs:
15+
code: ${{ steps.filter.outputs.code }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: dorny/paths-filter@v3
19+
id: filter
20+
with:
21+
filters: |
22+
code:
23+
- "packages/**"
24+
- "scripts/**"
25+
- "Dockerfile*"
26+
- "pnpm-lock.yaml"
27+
1028
regression-shards:
29+
needs: changes
30+
if: needs.changes.outputs.code == 'true'
1131
runs-on: ubuntu-latest
1232
timeout-minutes: 40
1333
strategy:
@@ -83,11 +103,15 @@ jobs:
83103
# Summary job — matches the required check name in branch protection
84104
regression:
85105
runs-on: ubuntu-latest
86-
needs: regression-shards
106+
needs: [changes, regression-shards]
87107
if: always()
88108
steps:
89-
- name: Check shard results
109+
- name: Check results
90110
run: |
111+
if [ "${{ needs.changes.outputs.code }}" != "true" ]; then
112+
echo "No code changes — skipping regression (auto-pass)"
113+
exit 0
114+
fi
91115
if [ "${{ needs.regression-shards.result }}" != "success" ]; then
92116
echo "One or more regression shards failed"
93117
exit 1

DOCS_GUIDELINES.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Documentation Guidelines
2+
3+
Standards for writing and maintaining Hyperframes documentation. Based on patterns from Remotion, Stripe, Tailwind CSS, and Astro.
4+
5+
## Core Principles
6+
7+
1. **One-sentence intro rule** — Every page opens with a single sentence telling the reader what this page helps them do or understand. No preamble, no history.
8+
9+
2. **Outcome before implementation** — Show what the code produces (rendered result, terminal output, file structure) before showing the code itself.
10+
11+
3. **Show, don't tell** — Use concrete examples with realistic values. Never use `foo`/`bar`/`baz`. Prefer a working HTML snippet over a description of what to write.
12+
13+
4. **Two content modes** — Guides build narratives with progressive complexity. References enable scanning with standardized structure. Never mix them.
14+
15+
5. **No dead ends** — Every page links forward (next steps), backward (prerequisites), and sideways (related concepts). Readers should never reach a page with nowhere to go.
16+
17+
## Page Structure
18+
19+
### Guides (concepts/, guides/)
20+
21+
```
22+
Title
23+
├── One-sentence purpose statement
24+
├── What this looks like (output, demo, or visual)
25+
├── Minimal working example
26+
├── Deeper explanation with progressive complexity
27+
├── Common patterns / best practices
28+
├── Warnings and pitfalls (sparingly)
29+
└── Next steps (cards or links to related pages)
30+
```
31+
32+
### Reference pages (reference/)
33+
34+
```
35+
Title
36+
├── One-sentence definition
37+
├── Complete attribute/API table
38+
├── Detailed section per item (type, default, description, example)
39+
├── Rules and constraints
40+
└── Related pages
41+
```
42+
43+
### Package pages (packages/)
44+
45+
```
46+
Title
47+
├── One-line description + install command
48+
├── When to use this package (and when NOT to)
49+
├── Key features list
50+
├── Minimal usage example with expected output
51+
├── Configuration reference
52+
└── Related packages
53+
```
54+
55+
## Writing Style
56+
57+
- **Second person, active voice, imperative mood**: "Use X to do Y." Not "The developer should consider using X."
58+
- **Present tense**: "The runtime manages media playback." Not "The runtime will manage..."
59+
- **Be direct**: "This breaks rendering." Not "This may potentially cause issues with the rendering pipeline."
60+
- **Prerequisites at point of need**: State requirements where they matter, not in a wall at the top.
61+
- **Conversational but precise**: Friendly tone, exact technical details.
62+
63+
## Code Examples
64+
65+
### Always annotate code blocks
66+
67+
```mdx
68+
```html index.html
69+
<div data-composition-id="root" ...>
70+
```​
71+
```
72+
73+
The filename after the language tag tells readers where the code goes.
74+
75+
### Use numbered comments for multi-step code
76+
77+
```javascript
78+
// 1. Create a paused timeline
79+
const tl = gsap.timeline({ paused: true });
80+
81+
// 2. Add animations
82+
tl.from("#title", { opacity: 0, y: -50, duration: 1 }, 0);
83+
84+
// 3. Register the timeline
85+
window.__timelines["my-video"] = tl;
86+
```
87+
88+
### Show expected output
89+
90+
After CLI commands, show what the user should see:
91+
92+
```bash
93+
npx hyperframes dev
94+
# ✓ Server running at http://localhost:3000
95+
# ✓ Watching for changes...
96+
```
97+
98+
### Use CodeGroup for multi-platform commands
99+
100+
```mdx
101+
<CodeGroup>
102+
```bash macOS
103+
brew install ffmpeg
104+
```
105+
```bash Ubuntu
106+
sudo apt install ffmpeg
107+
```
108+
</CodeGroup>
109+
```
110+
111+
## Mintlify Components — When to Use
112+
113+
| Component | Use When |
114+
|-----------|----------|
115+
| `<Steps>` | Sequential setup or tutorial instructions |
116+
| `<CodeGroup>` | Same action across platforms/languages |
117+
| `<Tabs>` | Alternative approaches with equal weight |
118+
| `<Card>` / `<Columns>` | Navigation to related pages, next steps |
119+
| `<Accordion>` | FAQ or optional detail that would bloat the page |
120+
| `<Note>` | Non-obvious behavior the reader should know |
121+
| `<Warning>` | Something that will break if ignored |
122+
| `<Tip>` | Helpful shortcut or best practice |
123+
| `<Info>` | Context that aids understanding |
124+
| `<Tree>` | File/directory structure |
125+
| `<Frame>` | Screenshots or diagrams with captions |
126+
127+
### Callout budget: max 2-3 per page
128+
129+
More than 3 callouts creates alert fatigue and readers skip them all. Reserve `<Warning>` for things that genuinely break. Use inline prose for tips.
130+
131+
## Cross-Linking
132+
133+
- **Link at the point of curiosity**: When you mention a concept that has its own page, link it immediately. Don't hoard links.
134+
- **"See also" at page bottom**: Only for genuinely related content that doesn't fit inline.
135+
- **Next steps cards**: End guide pages with `<Card>` links to logical next pages.
136+
137+
## File Conventions
138+
139+
- All doc pages are `.mdx` (not `.md`)
140+
- Use kebab-case for filenames: `frame-adapters.mdx`, not `frameAdapters.mdx`
141+
- Frontmatter requires `title` and `description`
142+
- Description should be under 160 characters (used for SEO/social)
143+
144+
## Maintenance
145+
146+
- Docs live in the repo at `/docs` and deploy automatically on merge to `main`
147+
- PRs that change user-facing behavior should update relevant doc pages
148+
- Run `mint validate` and `mint broken-links` before pushing doc changes

0 commit comments

Comments
 (0)