-
Notifications
You must be signed in to change notification settings - Fork 518
Expand file tree
/
Copy pathcode-examples.ts
More file actions
33 lines (29 loc) · 985 Bytes
/
code-examples.ts
File metadata and controls
33 lines (29 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* Centralized code examples for Stack Auth documentation
*
* Examples are stored as TypeScript files in: docs/code-examples/
*
* Structure:
* - language: Programming language (e.g., "JavaScript", "Python")
* - framework: Framework (e.g., "Next.js", "React", "Django")
* - variant: Optional "server" or "client"
* - code: The actual code (use template literals for multi-line)
* - highlightLanguage: Syntax highlighting language
* - filename: Display filename
*/
export type CodeExample = {
language: string;
framework: string;
/** Variant for tabbed code within the same platform/framework (e.g., 'server'/'client' or 'html'/'script') */
variant?: string;
code: string;
highlightLanguage: string;
filename?: string;
};
export type CodeExamplesMap = {
[documentPath: string]: {
[exampleName: string]: CodeExample[];
};
};
// Re-export functions from the code-examples index
export { getDocumentExamples, getExample } from '../code-examples';