humalab 0.0.2__tar.gz → 0.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of humalab might be problematic. Click here for more details.
- humalab-0.0.7/.github/pull_request_template.md +8 -0
- {humalab-0.0.2 → humalab-0.0.7}/.gitignore +5 -0
- humalab-0.0.7/Makefile +19 -0
- {humalab-0.0.2/humalab.egg-info → humalab-0.0.7}/PKG-INFO +1 -1
- humalab-0.0.7/VERSION +1 -0
- humalab-0.0.7/build.sh +13 -0
- humalab-0.0.7/docs/.gitignore +43 -0
- humalab-0.0.7/docs/DEPLOYMENT.md +305 -0
- humalab-0.0.7/docs/README.md +124 -0
- humalab-0.0.7/docs/app/[[...slug]]/page.tsx +40 -0
- humalab-0.0.7/docs/app/global.css +3 -0
- humalab-0.0.7/docs/app/layout.tsx +24 -0
- humalab-0.0.7/docs/content/docs/api.mdx +865 -0
- humalab-0.0.7/docs/content/docs/index.mdx +76 -0
- humalab-0.0.7/docs/content/docs/meta.json +11 -0
- humalab-0.0.7/docs/content/docs/metrics.mdx +314 -0
- humalab-0.0.7/docs/content/docs/quickstart.mdx +250 -0
- humalab-0.0.7/docs/content/docs/runs.mdx +321 -0
- humalab-0.0.7/docs/content/docs/scenarios.mdx +284 -0
- humalab-0.0.7/docs/jsconfig.json +9 -0
- humalab-0.0.7/docs/lib/source.ts +8 -0
- humalab-0.0.7/docs/netlify.toml +18 -0
- humalab-0.0.7/docs/next.config.mjs +10 -0
- humalab-0.0.7/docs/package-lock.json +6336 -0
- humalab-0.0.7/docs/package.json +28 -0
- humalab-0.0.7/docs/postcss.config.mjs +6 -0
- humalab-0.0.7/docs/public/_redirects +5 -0
- humalab-0.0.7/docs/source.config.ts +7 -0
- humalab-0.0.7/docs/start-docs.sh +22 -0
- humalab-0.0.7/docs/tailwind.config.js +13 -0
- humalab-0.0.7/docs/tsconfig.json +28 -0
- humalab-0.0.7/docs/vercel.json +3 -0
- humalab-0.0.7/humalab/__init__.py +34 -0
- humalab-0.0.7/humalab/assets/__init__.py +10 -0
- humalab-0.0.7/humalab/assets/files/__init__.py +4 -0
- humalab-0.0.7/humalab/assets/files/resource_file.py +131 -0
- humalab-0.0.7/humalab/assets/files/urdf_file.py +103 -0
- humalab-0.0.7/humalab/assets/resource_operator.py +139 -0
- humalab-0.0.7/humalab/constants.py +50 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/dists/__init__.py +7 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/dists/bernoulli.py +40 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/dists/categorical.py +32 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/dists/discrete.py +47 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/dists/distribution.py +11 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/dists/gaussian.py +47 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/dists/log_uniform.py +49 -1
- {humalab-0.0.2 → humalab-0.0.7}/humalab/dists/truncated_gaussian.py +65 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/dists/uniform.py +46 -0
- humalab-0.0.7/humalab/episode.py +306 -0
- humalab-0.0.7/humalab/humalab.py +219 -0
- humalab-0.0.7/humalab/humalab_api_client.py +966 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/humalab_config.py +49 -13
- {humalab-0.0.2 → humalab-0.0.7}/humalab/humalab_test.py +46 -29
- humalab-0.0.7/humalab/metrics/__init__.py +17 -0
- humalab-0.0.7/humalab/metrics/code.py +59 -0
- humalab-0.0.7/humalab/metrics/metric.py +96 -0
- humalab-0.0.7/humalab/metrics/scenario_stats.py +163 -0
- humalab-0.0.7/humalab/metrics/summary.py +75 -0
- humalab-0.0.7/humalab/run.py +325 -0
- humalab-0.0.7/humalab/scenarios/__init__.py +11 -0
- humalab-0.0.7/humalab/scenarios/scenario.py +375 -0
- humalab-0.0.7/humalab/scenarios/scenario_operator.py +114 -0
- {humalab-0.0.2/humalab → humalab-0.0.7/humalab/scenarios}/scenario_test.py +150 -269
- humalab-0.0.7/humalab/utils.py +37 -0
- {humalab-0.0.2 → humalab-0.0.7/humalab.egg-info}/PKG-INFO +1 -1
- humalab-0.0.7/humalab.egg-info/SOURCES.txt +77 -0
- {humalab-0.0.2 → humalab-0.0.7}/pyproject.toml +7 -17
- humalab-0.0.7/requirements-dev.txt +5 -0
- humalab-0.0.7/requirements.txt +4 -0
- {humalab-0.0.2 → humalab-0.0.7}/setup.py +11 -17
- humalab-0.0.2/humalab/__init__.py +0 -9
- humalab-0.0.2/humalab/assets/__init__.py +0 -0
- humalab-0.0.2/humalab/assets/resource_file.py +0 -28
- humalab-0.0.2/humalab/assets/resource_handler.py +0 -175
- humalab-0.0.2/humalab/constants.py +0 -7
- humalab-0.0.2/humalab/humalab.py +0 -149
- humalab-0.0.2/humalab/humalab_api_client.py +0 -273
- humalab-0.0.2/humalab/metrics/__init__.py +0 -11
- humalab-0.0.2/humalab/metrics/dist_metric.py +0 -22
- humalab-0.0.2/humalab/metrics/metric.py +0 -129
- humalab-0.0.2/humalab/metrics/summary.py +0 -54
- humalab-0.0.2/humalab/run.py +0 -214
- humalab-0.0.2/humalab/scenario.py +0 -225
- humalab-0.0.2/humalab.egg-info/SOURCES.txt +0 -38
- {humalab-0.0.2 → humalab-0.0.7}/LICENSE +0 -0
- {humalab-0.0.2 → humalab-0.0.7}/README.md +0 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab/assets/archive.py +0 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab.egg-info/dependency_links.txt +0 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab.egg-info/entry_points.txt +0 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab.egg-info/not-zip-safe +0 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab.egg-info/requires.txt +0 -0
- {humalab-0.0.2 → humalab-0.0.7}/humalab.egg-info/top_level.txt +0 -0
- {humalab-0.0.2 → humalab-0.0.7}/setup.cfg +0 -0
humalab-0.0.7/Makefile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.PHONY: clean build upload upload-test install dev
|
|
2
|
+
|
|
3
|
+
clean:
|
|
4
|
+
rm -rf dist/ build/ *.egg-info
|
|
5
|
+
|
|
6
|
+
build: clean
|
|
7
|
+
python -m build
|
|
8
|
+
|
|
9
|
+
upload: build
|
|
10
|
+
twine upload dist/*
|
|
11
|
+
|
|
12
|
+
upload-test: build
|
|
13
|
+
twine upload --repository testpypi dist/*
|
|
14
|
+
|
|
15
|
+
install:
|
|
16
|
+
pip install -e .
|
|
17
|
+
|
|
18
|
+
dev:
|
|
19
|
+
pip install -e ".[dev]"
|
humalab-0.0.7/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.7
|
humalab-0.0.7/build.sh
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
/.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
|
|
6
|
+
# Testing
|
|
7
|
+
/coverage
|
|
8
|
+
|
|
9
|
+
# Next.js
|
|
10
|
+
/.next/
|
|
11
|
+
/out/
|
|
12
|
+
.next
|
|
13
|
+
|
|
14
|
+
# Production
|
|
15
|
+
/build
|
|
16
|
+
/dist
|
|
17
|
+
|
|
18
|
+
# Misc
|
|
19
|
+
.DS_Store
|
|
20
|
+
*.pem
|
|
21
|
+
|
|
22
|
+
# Debug
|
|
23
|
+
npm-debug.log*
|
|
24
|
+
yarn-debug.log*
|
|
25
|
+
yarn-error.log*
|
|
26
|
+
|
|
27
|
+
# Local env files
|
|
28
|
+
.env*.local
|
|
29
|
+
.env
|
|
30
|
+
|
|
31
|
+
# Vercel
|
|
32
|
+
.vercel
|
|
33
|
+
|
|
34
|
+
# TypeScript
|
|
35
|
+
*.tsbuildinfo
|
|
36
|
+
next-env.d.ts
|
|
37
|
+
|
|
38
|
+
# IDE
|
|
39
|
+
.vscode
|
|
40
|
+
.idea
|
|
41
|
+
|
|
42
|
+
# Generated
|
|
43
|
+
.source
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# Deployment Guide
|
|
2
|
+
|
|
3
|
+
This guide covers how to deploy the HumaLab SDK documentation to various hosting platforms.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js 18+ installed
|
|
8
|
+
- npm or pnpm package manager
|
|
9
|
+
- Git repository (for automated deployments)
|
|
10
|
+
|
|
11
|
+
## Build Locally
|
|
12
|
+
|
|
13
|
+
Test the build locally before deploying:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cd docs
|
|
17
|
+
npm install
|
|
18
|
+
npm run build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The static site will be generated in the `out` directory.
|
|
22
|
+
|
|
23
|
+
To preview the production build locally:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run start
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Deploy to Vercel
|
|
30
|
+
|
|
31
|
+
Vercel is the recommended platform for deploying Fumadocs sites.
|
|
32
|
+
|
|
33
|
+
### Option 1: Vercel Dashboard (Recommended)
|
|
34
|
+
|
|
35
|
+
1. Push your code to GitHub, GitLab, or Bitbucket
|
|
36
|
+
2. Go to [vercel.com](https://vercel.com)
|
|
37
|
+
3. Click "New Project"
|
|
38
|
+
4. Import your repository
|
|
39
|
+
5. Configure the project:
|
|
40
|
+
- **Framework Preset**: Next.js
|
|
41
|
+
- **Root Directory**: `docs`
|
|
42
|
+
- **Build Command**: `npm run build` (auto-detected)
|
|
43
|
+
- **Output Directory**: `out` (auto-detected)
|
|
44
|
+
6. Click "Deploy"
|
|
45
|
+
|
|
46
|
+
### Option 2: Vercel CLI
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Install Vercel CLI
|
|
50
|
+
npm install -g vercel
|
|
51
|
+
|
|
52
|
+
# Deploy from the docs directory
|
|
53
|
+
cd docs
|
|
54
|
+
vercel
|
|
55
|
+
|
|
56
|
+
# For production deployment
|
|
57
|
+
vercel --prod
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Option 3: One-Click Deploy
|
|
61
|
+
|
|
62
|
+
[](https://vercel.com/new/clone?repository-url=https://github.com/humalab/humalab_sdk&project-name=humalab-docs&root-directory=docs)
|
|
63
|
+
|
|
64
|
+
## Deploy to Netlify
|
|
65
|
+
|
|
66
|
+
### Option 1: Netlify Dashboard
|
|
67
|
+
|
|
68
|
+
1. Push your code to GitHub, GitLab, or Bitbucket
|
|
69
|
+
2. Go to [netlify.com](https://netlify.com)
|
|
70
|
+
3. Click "Add new site" → "Import an existing project"
|
|
71
|
+
4. Connect to your Git provider and select your repository
|
|
72
|
+
5. Configure the build settings:
|
|
73
|
+
- **Base directory**: `docs`
|
|
74
|
+
- **Build command**: `npm run build`
|
|
75
|
+
- **Publish directory**: `docs/out`
|
|
76
|
+
6. Click "Deploy site"
|
|
77
|
+
|
|
78
|
+
### Option 2: Netlify CLI
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Install Netlify CLI
|
|
82
|
+
npm install -g netlify-cli
|
|
83
|
+
|
|
84
|
+
# Deploy from the docs directory
|
|
85
|
+
cd docs
|
|
86
|
+
netlify deploy
|
|
87
|
+
|
|
88
|
+
# For production deployment
|
|
89
|
+
netlify deploy --prod
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Option 3: Deploy Button
|
|
93
|
+
|
|
94
|
+
[](https://app.netlify.com/start/deploy?repository=https://github.com/humalab/humalab_sdk)
|
|
95
|
+
|
|
96
|
+
## Deploy to GitHub Pages
|
|
97
|
+
|
|
98
|
+
### Setup
|
|
99
|
+
|
|
100
|
+
1. Create a `.github/workflows/deploy.yml` file in your repository root:
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
name: Deploy Documentation
|
|
104
|
+
|
|
105
|
+
on:
|
|
106
|
+
push:
|
|
107
|
+
branches:
|
|
108
|
+
- main
|
|
109
|
+
paths:
|
|
110
|
+
- 'docs/**'
|
|
111
|
+
|
|
112
|
+
permissions:
|
|
113
|
+
contents: read
|
|
114
|
+
pages: write
|
|
115
|
+
id-token: write
|
|
116
|
+
|
|
117
|
+
jobs:
|
|
118
|
+
build:
|
|
119
|
+
runs-on: ubuntu-latest
|
|
120
|
+
defaults:
|
|
121
|
+
run:
|
|
122
|
+
working-directory: docs
|
|
123
|
+
|
|
124
|
+
steps:
|
|
125
|
+
- uses: actions/checkout@v4
|
|
126
|
+
|
|
127
|
+
- uses: actions/setup-node@v4
|
|
128
|
+
with:
|
|
129
|
+
node-version: '20'
|
|
130
|
+
cache: 'npm'
|
|
131
|
+
cache-dependency-path: docs/package-lock.json
|
|
132
|
+
|
|
133
|
+
- name: Install dependencies
|
|
134
|
+
run: npm ci
|
|
135
|
+
|
|
136
|
+
- name: Build
|
|
137
|
+
run: npm run build
|
|
138
|
+
|
|
139
|
+
- name: Upload artifact
|
|
140
|
+
uses: actions/upload-pages-artifact@v3
|
|
141
|
+
with:
|
|
142
|
+
path: docs/out
|
|
143
|
+
|
|
144
|
+
deploy:
|
|
145
|
+
environment:
|
|
146
|
+
name: github-pages
|
|
147
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
148
|
+
runs-on: ubuntu-latest
|
|
149
|
+
needs: build
|
|
150
|
+
steps:
|
|
151
|
+
- name: Deploy to GitHub Pages
|
|
152
|
+
id: deployment
|
|
153
|
+
uses: actions/deploy-pages@v4
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
2. Enable GitHub Pages in your repository settings:
|
|
157
|
+
- Go to Settings → Pages
|
|
158
|
+
- Source: GitHub Actions
|
|
159
|
+
|
|
160
|
+
3. Push to the main branch to trigger deployment
|
|
161
|
+
|
|
162
|
+
Your site will be available at `https://<username>.github.io/<repository>/`
|
|
163
|
+
|
|
164
|
+
## Deploy to AWS S3 + CloudFront
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Build the site
|
|
168
|
+
cd docs
|
|
169
|
+
npm run build
|
|
170
|
+
|
|
171
|
+
# Install AWS CLI
|
|
172
|
+
# Then sync to S3
|
|
173
|
+
aws s3 sync out/ s3://your-bucket-name --delete
|
|
174
|
+
|
|
175
|
+
# Invalidate CloudFront cache
|
|
176
|
+
aws cloudfront create-invalidation --distribution-id YOUR_DIST_ID --paths "/*"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Deploy to Cloudflare Pages
|
|
180
|
+
|
|
181
|
+
### Option 1: Cloudflare Dashboard
|
|
182
|
+
|
|
183
|
+
1. Go to [Cloudflare Pages](https://pages.cloudflare.com/)
|
|
184
|
+
2. Click "Create a project"
|
|
185
|
+
3. Connect your Git repository
|
|
186
|
+
4. Configure build settings:
|
|
187
|
+
- **Build command**: `cd docs && npm run build`
|
|
188
|
+
- **Build output directory**: `docs/out`
|
|
189
|
+
- **Root directory**: `/`
|
|
190
|
+
5. Click "Save and Deploy"
|
|
191
|
+
|
|
192
|
+
### Option 2: Wrangler CLI
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Install Wrangler
|
|
196
|
+
npm install -g wrangler
|
|
197
|
+
|
|
198
|
+
# Build
|
|
199
|
+
cd docs
|
|
200
|
+
npm run build
|
|
201
|
+
|
|
202
|
+
# Deploy
|
|
203
|
+
wrangler pages deploy out --project-name humalab-docs
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Custom Domain
|
|
207
|
+
|
|
208
|
+
### Vercel
|
|
209
|
+
|
|
210
|
+
1. Go to your project settings
|
|
211
|
+
2. Navigate to "Domains"
|
|
212
|
+
3. Add your custom domain
|
|
213
|
+
4. Update your DNS records as instructed
|
|
214
|
+
|
|
215
|
+
### Netlify
|
|
216
|
+
|
|
217
|
+
1. Go to your site settings
|
|
218
|
+
2. Navigate to "Domain management"
|
|
219
|
+
3. Click "Add custom domain"
|
|
220
|
+
4. Follow DNS configuration instructions
|
|
221
|
+
|
|
222
|
+
### GitHub Pages
|
|
223
|
+
|
|
224
|
+
1. Add a `CNAME` file to `docs/public/` with your domain
|
|
225
|
+
2. Configure DNS:
|
|
226
|
+
- For apex domain: A records to GitHub IPs
|
|
227
|
+
- For subdomain: CNAME to `<username>.github.io`
|
|
228
|
+
|
|
229
|
+
## Environment Variables
|
|
230
|
+
|
|
231
|
+
If your documentation needs environment variables:
|
|
232
|
+
|
|
233
|
+
### Vercel/Netlify
|
|
234
|
+
|
|
235
|
+
Add them in the dashboard under:
|
|
236
|
+
- Vercel: Project Settings → Environment Variables
|
|
237
|
+
- Netlify: Site Settings → Build & Deploy → Environment
|
|
238
|
+
|
|
239
|
+
### GitHub Actions
|
|
240
|
+
|
|
241
|
+
Add secrets in:
|
|
242
|
+
Repository Settings → Secrets and variables → Actions
|
|
243
|
+
|
|
244
|
+
## Continuous Deployment
|
|
245
|
+
|
|
246
|
+
All platforms above support automatic deployments on git push:
|
|
247
|
+
|
|
248
|
+
- **Vercel**: Automatically deploys on every push to connected branches
|
|
249
|
+
- **Netlify**: Automatically deploys on every push to connected branches
|
|
250
|
+
- **GitHub Pages**: Uses GitHub Actions workflow
|
|
251
|
+
- **Cloudflare Pages**: Automatically deploys on every push
|
|
252
|
+
|
|
253
|
+
## Troubleshooting
|
|
254
|
+
|
|
255
|
+
### Build Fails
|
|
256
|
+
|
|
257
|
+
Check:
|
|
258
|
+
- Node.js version (should be 18+)
|
|
259
|
+
- All dependencies are installed
|
|
260
|
+
- Build works locally: `npm run build`
|
|
261
|
+
|
|
262
|
+
### 404 Errors
|
|
263
|
+
|
|
264
|
+
For static exports, ensure:
|
|
265
|
+
- `output: 'export'` is set in `next.config.mjs`
|
|
266
|
+
- All routes are statically generated
|
|
267
|
+
|
|
268
|
+
### Slow Build Times
|
|
269
|
+
|
|
270
|
+
- Enable caching in CI/CD
|
|
271
|
+
- Use package manager cache (npm cache, pnpm store)
|
|
272
|
+
- Consider incremental static regeneration (ISR) if applicable
|
|
273
|
+
|
|
274
|
+
## Monitoring
|
|
275
|
+
|
|
276
|
+
After deployment, monitor:
|
|
277
|
+
- Build logs for errors
|
|
278
|
+
- Analytics for traffic patterns
|
|
279
|
+
- Core Web Vitals for performance
|
|
280
|
+
|
|
281
|
+
## Cost Estimates
|
|
282
|
+
|
|
283
|
+
- **Vercel**: Free for hobby projects, Pro starts at $20/month
|
|
284
|
+
- **Netlify**: Free for personal projects, Pro starts at $19/month
|
|
285
|
+
- **GitHub Pages**: Free for public repositories
|
|
286
|
+
- **Cloudflare Pages**: Free tier available, very generous limits
|
|
287
|
+
- **AWS S3**: Pay per use, typically $1-5/month for docs sites
|
|
288
|
+
|
|
289
|
+
## Best Practices
|
|
290
|
+
|
|
291
|
+
1. **Use a CDN**: All platforms above include CDN by default
|
|
292
|
+
2. **Enable HTTPS**: Automatically provided by all platforms
|
|
293
|
+
3. **Set up monitoring**: Use platform analytics or integrate Google Analytics
|
|
294
|
+
4. **Automate deployments**: Connect to Git for automatic deployments
|
|
295
|
+
5. **Preview deployments**: Use branch/PR previews for testing changes
|
|
296
|
+
6. **Cache headers**: Configure appropriate cache headers for static assets
|
|
297
|
+
7. **Compression**: Enable gzip/brotli compression (usually automatic)
|
|
298
|
+
|
|
299
|
+
## Support
|
|
300
|
+
|
|
301
|
+
For platform-specific issues:
|
|
302
|
+
- [Vercel Documentation](https://vercel.com/docs)
|
|
303
|
+
- [Netlify Documentation](https://docs.netlify.com/)
|
|
304
|
+
- [GitHub Pages Documentation](https://docs.github.com/pages)
|
|
305
|
+
- [Cloudflare Pages Documentation](https://developers.cloudflare.com/pages/)
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# HumaLab SDK Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains the Fumadocs-based documentation website for HumaLab SDK.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
Install dependencies:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Run the development server:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run dev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Open [http://localhost:3000](http://localhost:3000) to view the documentation.
|
|
20
|
+
|
|
21
|
+
## Building
|
|
22
|
+
|
|
23
|
+
Build the static site:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run build
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The static site will be generated in the `out` directory.
|
|
30
|
+
|
|
31
|
+
## Deployment
|
|
32
|
+
|
|
33
|
+
### Deploy to Vercel
|
|
34
|
+
|
|
35
|
+
1. Push this repository to GitHub
|
|
36
|
+
2. Import the project in Vercel
|
|
37
|
+
3. Set the root directory to `docs`
|
|
38
|
+
4. Deploy!
|
|
39
|
+
|
|
40
|
+
[](https://vercel.com/new/clone?repository-url=https://github.com/humalab/humalab_sdk&project-name=humalab-docs&root-directory=docs)
|
|
41
|
+
|
|
42
|
+
### Deploy to Netlify
|
|
43
|
+
|
|
44
|
+
1. Push this repository to GitHub
|
|
45
|
+
2. Import the project in Netlify
|
|
46
|
+
3. Set the base directory to `docs`
|
|
47
|
+
4. Set build command to `npm run build`
|
|
48
|
+
5. Set publish directory to `docs/out`
|
|
49
|
+
6. Deploy!
|
|
50
|
+
|
|
51
|
+
### Deploy to GitHub Pages
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm run build
|
|
55
|
+
# Copy the 'out' directory to your GitHub Pages repository
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Project Structure
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
docs/
|
|
62
|
+
├── app/ # Next.js app directory
|
|
63
|
+
│ ├── docs/ # Documentation pages
|
|
64
|
+
│ ├── layout.tsx # Root layout
|
|
65
|
+
│ └── page.tsx # Home page
|
|
66
|
+
├── content/ # MDX content
|
|
67
|
+
│ └── docs/ # Documentation content
|
|
68
|
+
│ ├── index.mdx
|
|
69
|
+
│ ├── quickstart.mdx
|
|
70
|
+
│ ├── scenarios.mdx
|
|
71
|
+
│ ├── runs.mdx
|
|
72
|
+
│ ├── metrics.mdx
|
|
73
|
+
│ ├── api.mdx
|
|
74
|
+
│ └── meta.json # Navigation structure
|
|
75
|
+
├── lib/ # Utilities
|
|
76
|
+
│ └── source.ts # Fumadocs source configuration
|
|
77
|
+
├── next.config.mjs # Next.js configuration
|
|
78
|
+
├── source.config.ts # Fumadocs MDX configuration
|
|
79
|
+
├── tailwind.config.js # Tailwind CSS configuration
|
|
80
|
+
└── package.json # Dependencies
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Writing Documentation
|
|
84
|
+
|
|
85
|
+
Documentation is written in MDX format in the `content/docs` directory.
|
|
86
|
+
|
|
87
|
+
### Creating a New Page
|
|
88
|
+
|
|
89
|
+
1. Create a new `.mdx` file in `content/docs/`
|
|
90
|
+
2. Add frontmatter with title and description:
|
|
91
|
+
|
|
92
|
+
```mdx
|
|
93
|
+
---
|
|
94
|
+
title: Page Title
|
|
95
|
+
description: Page description
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
# Page Title
|
|
99
|
+
|
|
100
|
+
Your content here...
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
3. Add the page to `content/docs/meta.json` for navigation
|
|
104
|
+
|
|
105
|
+
### Code Blocks
|
|
106
|
+
|
|
107
|
+
Use fenced code blocks with language syntax highlighting:
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
import humalab as hl
|
|
111
|
+
|
|
112
|
+
hl.init(api_key="your_api_key")
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Technology Stack
|
|
116
|
+
|
|
117
|
+
- [Fumadocs](https://fumadocs.vercel.app/) - Documentation framework
|
|
118
|
+
- [Next.js](https://nextjs.org/) - React framework
|
|
119
|
+
- [Tailwind CSS](https://tailwindcss.com/) - Styling
|
|
120
|
+
- [MDX](https://mdxjs.com/) - Markdown + JSX
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
MIT
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { source } from '@/lib/source';
|
|
2
|
+
import type { Metadata } from 'next';
|
|
3
|
+
import { DocsPage, DocsBody } from 'fumadocs-ui/page';
|
|
4
|
+
import { notFound } from 'next/navigation';
|
|
5
|
+
|
|
6
|
+
export default async function Page(props: {
|
|
7
|
+
params: Promise<{ slug?: string[] }>;
|
|
8
|
+
}) {
|
|
9
|
+
const params = await props.params;
|
|
10
|
+
const page = source.getPage(params.slug);
|
|
11
|
+
if (!page) notFound();
|
|
12
|
+
|
|
13
|
+
const MDX = page.data.body;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<DocsPage toc={page.data.toc} full={page.data.full}>
|
|
17
|
+
<DocsBody>
|
|
18
|
+
<h1>{page.data.title}</h1>
|
|
19
|
+
<MDX />
|
|
20
|
+
</DocsBody>
|
|
21
|
+
</DocsPage>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function generateStaticParams() {
|
|
26
|
+
return source.generateParams();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function generateMetadata(props: {
|
|
30
|
+
params: Promise<{ slug?: string[] }>;
|
|
31
|
+
}): Promise<Metadata> {
|
|
32
|
+
const params = await props.params;
|
|
33
|
+
const page = source.getPage(params.slug);
|
|
34
|
+
if (!page) notFound();
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
title: page.data.title,
|
|
38
|
+
description: page.data.description,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import './global.css';
|
|
2
|
+
import { RootProvider } from 'fumadocs-ui/provider';
|
|
3
|
+
import { DocsLayout } from 'fumadocs-ui/layout';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
import { source } from '@/lib/source';
|
|
6
|
+
|
|
7
|
+
export default function Layout({ children }: { children: ReactNode }) {
|
|
8
|
+
return (
|
|
9
|
+
<html lang="en" suppressHydrationWarning>
|
|
10
|
+
<body>
|
|
11
|
+
<RootProvider>
|
|
12
|
+
<DocsLayout
|
|
13
|
+
tree={source.pageTree}
|
|
14
|
+
nav={{
|
|
15
|
+
title: 'HumaLab SDK',
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</DocsLayout>
|
|
20
|
+
</RootProvider>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
23
|
+
);
|
|
24
|
+
}
|