forked from npmx-dev/npmx.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme.ts
More file actions
44 lines (41 loc) · 1.07 KB
/
readme.ts
File metadata and controls
44 lines (41 loc) · 1.07 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Playground/demo link extracted from README
*/
export interface PlaygroundLink {
/** The full URL */
url: string
/** Provider identifier (e.g., 'stackblitz', 'codesandbox') */
provider: string
/** Human-readable provider name (e.g., 'StackBlitz', 'CodeSandbox') */
providerName: string
/** Link text from README (e.g., 'Demo', 'Try it online') */
label: string
}
/**
* Table of contents item extracted from README headings
*/
export interface TocItem {
/** Plain text heading (HTML stripped) */
text: string
/** Anchor ID (e.g., "user-content-installation") */
id: string
/** Original heading depth (1-6) */
depth: number
}
/**
* Response from README API endpoint
*/
export interface ReadmeResponse {
/** Whether the README exists */
mdExists?: boolean
/** Rendered HTML content */
html: string
/** Extracted playground/demo links */
playgroundLinks: PlaygroundLink[]
/** Table of contents extracted from headings */
toc: TocItem[]
}
export interface ReadmeMarkdownResponse {
/** Original markdown content */
markdown?: string
}