Skip to content

Commit 79a0a0b

Browse files
kylemclarenclaude
andcommitted
Use dynamic category titles and update descriptions to match live site
- Remove hardcoded category title mapping, use simple title-casing from schema - Update category descriptions to match sprites.dev/api documentation Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent d252013 commit 79a0a0b

File tree

1 file changed

+18
-27
lines changed

1 file changed

+18
-27
lines changed

scripts/generate-api-docs.ts

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -837,22 +837,7 @@ ${streamingEventsDocs}
837837
}
838838

839839
function getCategoryTitle(category: string): string {
840-
const titles: Record<string, string> = {
841-
sprites: 'Sprites',
842-
exec: 'Exec',
843-
checkpoints: 'Checkpoints',
844-
services: 'Services',
845-
proxy: 'HTTP Proxy',
846-
policy: 'Policy',
847-
organization: 'Organization',
848-
tokens: 'Tokens',
849-
files: 'Files',
850-
filesystem: 'Filesystem',
851-
attach: 'Attach',
852-
};
853-
return (
854-
titles[category] || category.charAt(0).toUpperCase() + category.slice(1)
855-
);
840+
return category.charAt(0).toUpperCase() + category.slice(1);
856841
}
857842

858843
// Manual pages that are not generated from schema but should be included
@@ -885,17 +870,21 @@ const MANUAL_PAGES: ManualPage[] = [
885870

886871
function getCategoryDescription(category: string): string {
887872
const descriptions: Record<string, string> = {
888-
sprites: 'Create, list, update, and delete Sprites',
889-
exec: 'Execute commands in Sprites via WebSocket',
890-
checkpoints: 'Create, list, and restore environment snapshots',
891-
services: 'Manage background services running in Sprites',
892-
proxy: 'Forward HTTP requests to services inside Sprites',
893-
policy: 'Manage access control policies',
894-
organization: 'Organization settings and information',
895-
tokens: 'Create and manage API tokens',
896-
files: 'Upload and download files',
897-
filesystem: 'Browse and manage the filesystem',
898-
attach: 'Interactive terminal sessions via WebSocket',
873+
sprites:
874+
'Sprites are persistent environments that hibernate when idle and wake automatically on demand. You only pay for compute while actively using them—storage persists indefinitely.',
875+
exec: 'Run commands inside Sprites over WebSocket connections. The exec API is designed for both one-shot commands and long-running interactive sessions.',
876+
checkpoints:
877+
"Checkpoints capture your Sprite's complete filesystem state for instant rollback. They're live snapshots—creation takes milliseconds with no interruption to running processes.",
878+
services: 'Manage background services running in your Sprite environment.',
879+
proxy:
880+
'Tunnel TCP connections directly to services running inside your Sprite. After a brief WebSocket handshake, the connection becomes a transparent relay to any port.',
881+
policy:
882+
'Control outbound network access using DNS-based filtering. Policies define which domains sprites can reach, with support for exact matches, wildcard subdomains, and preset rule bundles.',
883+
organization: 'Organization settings and information.',
884+
tokens: 'Create and manage API tokens.',
885+
files: 'Upload and download files.',
886+
filesystem: 'Browse and manage the filesystem.',
887+
attach: 'Interactive terminal sessions via WebSocket.',
899888
};
900889
return (
901890
descriptions[category] || `${getCategoryTitle(category)} API endpoints`
@@ -937,6 +926,8 @@ import CodeSnippets from '@/components/CodeSnippets.astro';
937926
938927
<div className="api-full-width">
939928
929+
<p className="sl-text-lg" style={{ marginBottom: '2rem', color: 'var(--sl-color-gray-2)' }}>${description}</p>
930+
940931
`;
941932

942933
if (hasWebSocket) {

0 commit comments

Comments
 (0)