// AUTO-GENERATED. Programming-language icon set for code samples — simple-icons // brand marks baked as SVG strings so they ship inside xyd (no runtime icon dep). // Rendered through xyd's own component (see CodeTabs). To add a language, // extend the generator, not this file by hand. export interface CodeLangIcon { /** Inline SVG markup (single-path 24x24 simple-icons mark). */ svg: string; /** The brand colour; passed to . Omit for currentColor. */ color?: string; } export const CODE_LANG_ICONS: Record = { "javascript": { "svg": "", "color": "#F7DF1E" }, "typescript": { "svg": "", "color": "#3178C6" }, "python": { "svg": "", "color": "#3776AB" }, "go": { "svg": "", "color": "#00ADD8" }, "ruby": { "svg": "", "color": "#CC342D" }, "php": { "svg": "", "color": "#777BB4" }, "node": { "svg": "", "color": "#5FA04E" }, "shell": { "svg": "", "color": "#4EAA25" }, "curl": { "svg": "", "color": "#073551" }, // Java + C# are absent from simple-icons (brand-trademark policy), so these // are hand-kept brand marks (multi-path). Java's own path fills survive the // currentColor override; C# is single-path, so it carries a `color`. "java": { "svg": "" }, "csharp": { "svg": "", "color": "#9179E4" } }; // Map the many language ids a code sample can carry (shiki ids, aliases) onto a // canonical icon name. const ALIASES: Record = { js: "javascript", jsx: "javascript", javascript: "javascript", ts: "typescript", tsx: "typescript", typescript: "typescript", py: "python", python: "python", go: "go", golang: "go", rb: "ruby", ruby: "ruby", php: "php", node: "node", nodejs: "node", "node.js": "node", shell: "shell", shellscript: "shell", sh: "shell", bash: "shell", zsh: "shell", console: "shell", powershell: "shell", cmd: "shell", curl: "curl", java: "java", csharp: "csharp", cs: "csharp", "c#": "csharp", dotnet: "csharp", }; /** Resolve a raw language/meta id to a canonical icon name, or null if none. */ export function resolveCodeLangName(lang?: string | null): string | null { if (!lang) return null; const key = lang.toLowerCase().trim().replace(/^language-/, ""); const canon = ALIASES[key] ?? (CODE_LANG_ICONS[key] ? key : null); return canon && CODE_LANG_ICONS[canon] ? canon : null; } // Pretty display name shown next to the icon (e.g. "Go", not "golang"). // Hand-maintained (not part of the generated icon data above). export const CODE_LANG_LABELS: Record = { javascript: "JavaScript", typescript: "TypeScript", python: "Python", go: "Go", ruby: "Ruby", php: "PHP", node: "Node.js", shell: "Shell", curl: "cURL", java: "Java", csharp: "C#", };