Spaces:
Running
Running
| title: html studio | |
| emoji: ⬛ | |
| colorFrom: red | |
| colorTo: gray | |
| sdk: static | |
| app_file: index.html | |
| short_description: Describe a site, any model writes it, ship it to harvis.dev | |
| hf_oauth: true | |
| hf_oauth_scopes: | |
| - inference-api | |
| hf_oauth_expiration_minutes: 480 | |
| pinned: false | |
| # html studio | |
| Describe a site. Any open-weights model on the Hugging Face Inference Providers | |
| router writes it as one self-contained HTML file. Preview it, edit it, then | |
| deploy it to [harvis.dev](https://harvis.dev) and get an immutable live URL in | |
| about two seconds. | |
| ## How it works | |
| There is no server. This is a Static Space — everything runs in your browser, | |
| against two CORS-open APIs. | |
| 1. **Pick a model.** The list is fetched live from | |
| `https://router.huggingface.co/v1/models`, so every open-weights chat model | |
| the router serves is selectable. | |
| 2. **Describe the site.** The model streams back a complete `<!doctype html>` | |
| document with all CSS and JS inlined. The preview renders as it arrives. | |
| 3. **Edit if you want.** The code pane is a live editor — edits re-render and | |
| are what gets deployed. | |
| 4. **Deploy.** The document is posted to `https://harvis.dev/api/upload`. | |
| Deploying again reuses the site's deploy token, so it updates the same URL in | |
| place rather than creating a new site. Press **New site** to start a fresh one. | |
| ## Inference credits | |
| Sign in with Hugging Face to generate against your own free monthly inference | |
| credits — the OAuth token is requested with the `inference-api` scope. You can | |
| paste a token from | |
| [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) | |
| instead. Nothing leaves the browser except the request to the HF router; the | |
| token is kept in `localStorage`. | |
| ## Deploy links | |
| Every deploy returns two links. | |
| - **Live URL** — public. Share it. | |
| - **Claim link** — private. Open it and sign in to attach the site to a | |
| harvis.dev account. It cannot be recovered if lost, and an unclaimed site | |
| expires 24 hours after its last deploy. | |
| ## Branding | |
| The interface uses the harvis.dev design system, vendored here so the Space is | |
| self-contained and works offline: | |
| | Path | What it is | | |
| |---|---| | |
| | `styles.css` | Design-system entry point — the `@import` list | | |
| | `tokens/` | Colour, type, spacing, radius/shadow, motion, base reset, light theme | | |
| | `assets/fonts/` | Nordwand Mono — the `[#]` logomark face | | |
| | `assets/icons/` | Remix Icon v4.9.1 webfont, `-line` style | | |
| | `app.css` | Application layer — every value resolves to a token | | |
| Square corners, 9px crop-mark corner brackets, hard offset shadows with zero | |
| blur, one accent (Flare `#FF4D17`), mono for every machine-generated value, and | |
| no emoji anywhere in the interface. The contrast control in the nav toggles | |
| `data-theme="paper"`, which inverts the whole app to the warm paper canvas with | |
| no light-specific CSS branch. | |
| ## Notes | |
| - The preview iframe is sandboxed without `allow-same-origin`, so origin-bound | |
| APIs (`localStorage`, cookies) throw inside the preview. They work on the | |
| deployed site. | |
| - harvis.dev limits: 50 MB and 500 files per site, static files only. | |
| ## Run it locally | |
| No build step. | |
| ```bash | |
| python3 -m http.server 8000 | |
| ``` | |
| OAuth only works when served as a Space; locally, paste a token instead. | |