|
1 | 1 | type SupportedLanguage = { |
2 | 2 | readonly id: string; |
3 | 3 | readonly label: string; |
| 4 | + readonly group: SupportedLanguageGroupId; |
4 | 5 | readonly shikiLanguage?: string; |
5 | 6 | }; |
6 | 7 |
|
| 8 | +type SupportedLanguageGroupId = "native" | "web" | "data" | "diff" | "script" | "general"; |
| 9 | + |
| 10 | +export const supportedLanguageGroupLabels = { |
| 11 | + native: "시스템/네이티브", |
| 12 | + web: "웹/프론트엔드", |
| 13 | + data: "데이터/설정", |
| 14 | + diff: "변경/패치", |
| 15 | + script: "스크립트", |
| 16 | + general: "일반 언어", |
| 17 | +} as const satisfies Record<SupportedLanguageGroupId, string>; |
| 18 | + |
7 | 19 | export const supportedLanguages = [ |
8 | | - { id: "c", label: "C" }, |
9 | | - { id: "cpp", label: "C++" }, |
10 | | - { id: "csharp", label: "C#" }, |
11 | | - { id: "asm", label: "Assembly" }, |
12 | | - { id: "javascript", label: "JavaScript" }, |
13 | | - { id: "typescript", label: "TypeScript" }, |
14 | | - { id: "jsx", label: "React JSX" }, |
15 | | - { id: "tsx", label: "React TSX" }, |
16 | | - { id: "svelte", label: "Svelte" }, |
17 | | - { id: "astro", label: "Astro" }, |
18 | | - { id: "html", label: "HTML" }, |
19 | | - { id: "css", label: "CSS" }, |
20 | | - { id: "tailwind", label: "Tailwind CSS", shikiLanguage: "html" }, |
21 | | - { id: "unocss", label: "UnoCSS", shikiLanguage: "html" }, |
22 | | - { id: "php", label: "PHP" }, |
23 | | - { id: "json", label: "JSON" }, |
24 | | - { id: "diff", label: "Diff" }, |
25 | | - { id: "patch", label: "Patch", shikiLanguage: "diff" }, |
26 | | - { id: "bash", label: "Bash" }, |
27 | | - { id: "python", label: "Python" }, |
28 | | - { id: "java", label: "Java" }, |
29 | | - { id: "go", label: "Go" }, |
30 | | - { id: "rust", label: "Rust" }, |
31 | | - { id: "haskell", label: "Haskell" }, |
32 | | - { id: "scala", label: "Scala" }, |
33 | | - { id: "zig", label: "Zig" }, |
34 | | - { id: "julia", label: "Julia" }, |
35 | | - { id: "mojo", label: "Mojo" }, |
| 20 | + { id: "c", label: "C", group: "native" }, |
| 21 | + { id: "cpp", label: "C++", group: "native" }, |
| 22 | + { id: "csharp", label: "C#", group: "native" }, |
| 23 | + { id: "asm", label: "Assembly", group: "native" }, |
| 24 | + { id: "rust", label: "Rust", group: "native" }, |
| 25 | + { id: "zig", label: "Zig", group: "native" }, |
| 26 | + { id: "javascript", label: "JavaScript", group: "web" }, |
| 27 | + { id: "typescript", label: "TypeScript", group: "web" }, |
| 28 | + { id: "jsx", label: "React JSX", group: "web" }, |
| 29 | + { id: "tsx", label: "React TSX", group: "web" }, |
| 30 | + { id: "svelte", label: "Svelte", group: "web" }, |
| 31 | + { id: "astro", label: "Astro", group: "web" }, |
| 32 | + { id: "html", label: "HTML", group: "web" }, |
| 33 | + { id: "css", label: "CSS", group: "web" }, |
| 34 | + { id: "tailwind", label: "Tailwind CSS", group: "web", shikiLanguage: "html" }, |
| 35 | + { id: "unocss", label: "UnoCSS", group: "web", shikiLanguage: "html" }, |
| 36 | + { id: "php", label: "PHP", group: "web" }, |
| 37 | + { id: "json", label: "JSON", group: "data" }, |
| 38 | + { id: "yaml", label: "YAML", group: "data" }, |
| 39 | + { id: "toml", label: "TOML", group: "data" }, |
| 40 | + { id: "sql", label: "SQL", group: "data" }, |
| 41 | + { id: "diff", label: "Diff", group: "diff" }, |
| 42 | + { id: "patch", label: "Patch", group: "diff", shikiLanguage: "diff" }, |
| 43 | + { id: "bash", label: "Bash", group: "script" }, |
| 44 | + { id: "python", label: "Python", group: "script" }, |
| 45 | + { id: "java", label: "Java", group: "general" }, |
| 46 | + { id: "go", label: "Go", group: "general" }, |
| 47 | + { id: "haskell", label: "Haskell", group: "general" }, |
| 48 | + { id: "scala", label: "Scala", group: "general" }, |
| 49 | + { id: "julia", label: "Julia", group: "general" }, |
| 50 | + { id: "mojo", label: "Mojo", group: "general" }, |
36 | 51 | ] as const satisfies readonly SupportedLanguage[]; |
37 | 52 |
|
| 53 | +export const supportedLanguageGroups = Object.entries(supportedLanguageGroupLabels) |
| 54 | + .map(([id, label]) => ({ |
| 55 | + id: id as SupportedLanguageGroupId, |
| 56 | + label, |
| 57 | + languages: supportedLanguages.filter((language) => language.group === id), |
| 58 | + })) |
| 59 | + .filter((group) => group.languages.length > 0); |
| 60 | + |
38 | 61 | export const supportedThemes = [ |
39 | 62 | { id: "github-dark", label: "GitHub Dark" }, |
40 | 63 | { id: "github-light", label: "GitHub Light" }, |
|
0 commit comments