|
1 | 1 | /** |
2 | | - * Toolkit documentation constants |
3 | | - * |
4 | | - * Centralized configuration for URLs, badges, labels, and other constants |
5 | | - * used throughout the toolkit documentation components. |
| 2 | + * Toolkit documentation constants shared across toolkit UI components. |
6 | 3 | */ |
7 | 4 |
|
8 | | -// ============================================================================= |
9 | | -// External URLs |
10 | | -// ============================================================================= |
11 | | - |
12 | | -/** |
13 | | - * GitHub organization URL |
14 | | - */ |
15 | | -export const GITHUB_ORG_URL = "https://github.com/arcadeai"; |
16 | | - |
17 | | -/** |
18 | | - * GitHub repository URL pattern for toolkit code |
19 | | - * Use: `${GITHUB_ORG_URL}/arcade_${toolkitId.toLowerCase()}` |
20 | | - */ |
21 | | -export const GITHUB_REPO_PREFIX = "arcade_"; |
22 | | - |
23 | | -/** |
24 | | - * License file URL |
25 | | - */ |
26 | | -export const LICENSE_URL = `${GITHUB_ORG_URL}/arcade-ai/blob/main/LICENSE`; |
27 | | - |
28 | | -/** |
29 | | - * PyPI base URL |
30 | | - */ |
31 | | -export const PYPI_BASE_URL = "https://pypi.org/project"; |
32 | | - |
33 | | -/** |
34 | | - * Shields.io base URL for badges |
35 | | - */ |
36 | | -export const SHIELDS_IO_BASE_URL = "https://img.shields.io"; |
37 | | - |
38 | 5 | // ============================================================================= |
39 | 6 | // Internal Routes |
40 | 7 | // ============================================================================= |
@@ -71,65 +38,13 @@ export function getPackageName(toolkitId: string): string { |
71 | 38 | return `${PACKAGE_PREFIX}${id}`; |
72 | 39 | } |
73 | 40 |
|
74 | | -/** |
75 | | - * Generate PyPI project URL from package name |
76 | | - */ |
77 | | -export function getPyPIUrl(packageName: string): string { |
78 | | - return `${PYPI_BASE_URL}/${packageName}/`; |
79 | | -} |
80 | | - |
81 | 41 | /** |
82 | 42 | * Generate auth provider docs URL from provider ID |
83 | 43 | */ |
84 | 44 | export function getAuthProviderDocsUrl(providerId: string): string { |
85 | 45 | return `${AUTH_PROVIDER_DOCS_PATH}/${providerId.toLowerCase()}`; |
86 | 46 | } |
87 | 47 |
|
88 | | -// ============================================================================= |
89 | | -// Badges Configuration |
90 | | -// ============================================================================= |
91 | | - |
92 | | -export type BadgeConfig = { |
93 | | - alt: string; |
94 | | - src: string | ((packageName: string) => string); |
95 | | - href: string | ((packageName: string) => string); |
96 | | -}; |
97 | | - |
98 | | -/** |
99 | | - * PyPI badge configurations |
100 | | - */ |
101 | | -export const PYPI_BADGES: BadgeConfig[] = [ |
102 | | - { |
103 | | - alt: "PyPI Version", |
104 | | - src: (pkg) => `${SHIELDS_IO_BASE_URL}/pypi/v/${pkg}`, |
105 | | - href: (pkg) => getPyPIUrl(pkg), |
106 | | - }, |
107 | | - { |
108 | | - alt: "Python Versions", |
109 | | - src: (pkg) => `${SHIELDS_IO_BASE_URL}/pypi/pyversions/${pkg}`, |
110 | | - href: (pkg) => getPyPIUrl(pkg), |
111 | | - }, |
112 | | - { |
113 | | - alt: "Wheel Status", |
114 | | - src: (pkg) => `${SHIELDS_IO_BASE_URL}/pypi/wheel/${pkg}`, |
115 | | - href: (pkg) => getPyPIUrl(pkg), |
116 | | - }, |
117 | | - { |
118 | | - alt: "Downloads", |
119 | | - src: (pkg) => `${SHIELDS_IO_BASE_URL}/pypi/dm/${pkg}`, |
120 | | - href: (pkg) => getPyPIUrl(pkg), |
121 | | - }, |
122 | | -]; |
123 | | - |
124 | | -/** |
125 | | - * License badge configuration |
126 | | - */ |
127 | | -export const LICENSE_BADGE: BadgeConfig = { |
128 | | - alt: "License", |
129 | | - src: `${SHIELDS_IO_BASE_URL}/badge/License-MIT-yellow.svg`, |
130 | | - href: LICENSE_URL, |
131 | | -}; |
132 | | - |
133 | 48 | // ============================================================================= |
134 | 49 | // Default Values |
135 | 50 | // ============================================================================= |
|
0 commit comments