diff --git a/backend/main.py b/backend/main.py index 89e9a32..379c088 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1506,7 +1506,14 @@ EXT_TO_LANG = { ".cs": "csharp", ".go": "go", ".rs": "rust", ".rb": "ruby", ".php": "php", ".sql": "sql", ".r": "r", ".swift": "swift", ".kt": "kotlin", ".txt": "plaintext", ".log": "plaintext", - ".dockerfile": "dockerfile", ".makefile": "makefile", ".cmake": "cmake", + ".lua": "lua", ".pl": "perl", ".pm": "perl", ".ex": "elixir", ".exs": "elixir", + ".dart": "dart", ".tf": "haskell", ".gradle": "groovy", ".groovy": "groovy", + ".graphql": "graphql", ".gql": "graphql", ".prisma": "sql", ".proto": "c", + ".vb": "basic", ".asm": "x86asm", ".s": "armasm", + ".vue": "xml", ".svelte": "xml", ".astro": "xml", + ".properties": "ini", ".service": "ini", ".hosts": "ini", + ".ksh": "bash", ".dockerfile": "dockerfile", + ".makefile": "makefile", ".cmake": "cmake", } @@ -2500,7 +2507,17 @@ async def api_file(vault_name: str, path: str = Query(..., description="Relative } else: # Non-markdown: wrap in syntax-highlighted code block - lang = EXT_TO_LANG.get(ext, "plaintext") + lang = EXT_TO_LANG.get(ext, "") + if not lang: + # Fichiers sans extension usuels (Dockerfile, Makefile, etc.) + NAME_TO_LANG = { + "dockerfile": "dockerfile", "makefile": "makefile", + "cmakelists.txt": "cmake", "jenkinsfile": "groovy", + "vagrantfile": "ruby", "rakefile": "ruby", "gemfile": "ruby", + "procfile": "plaintext", "bashrc": "bash", "bash_profile": "bash", + "zshrc": "bash", "profile": "bash", "gitignore": "plaintext", + } + lang = NAME_TO_LANG.get(file_path.name.lower(), "plaintext") escaped = html_mod.escape(raw) html_content = f'
{escaped}
' diff --git a/frontend/index.html b/frontend/index.html index 7c5a8d7..ee0681b 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -88,6 +88,17 @@ /> + + + + + + + + + + + + + + + +