diff --git a/swh/web/common/highlightjs.py b/swh/web/common/highlightjs.py --- a/swh/web/common/highlightjs.py +++ b/swh/web/common/highlightjs.py @@ -47,14 +47,18 @@ 'ado': 'stata', 'adoc': 'asciidoc', 'ahk': 'autohotkey', + 'aj': 'aspectj', 'apacheconf': 'apache', 'arm': 'armasm', 'as': 'actionscript', - 'asc': 'angelscript', + 'asc': 'asciidoc', 'atom': 'xml', + 'bas': 'basic', 'bat': 'dos', 'bf': 'brainfuck', 'bind': 'dns', + 'bsl': '1c', + 'c-al': 'cal', 'c': 'cpp', 'c++': 'cpp', 'capnp': 'capnproto', @@ -76,12 +80,17 @@ 'docker': 'dockerfile', 'dpr': 'delphi', 'dst': 'dust', + 'dtsi': 'dts', + 'ep': 'mojolicious', 'erl': 'erlang', + 'ex': 'elixir', + 'exs': 'elixir', 'f90': 'fortran', 'f95': 'fortran', 'feature': 'gherkin', 'freepascal': 'delphi', 'fs': 'fsharp', + 'fsx': 'fsharp', 'gemspec': 'ruby', 'GML': 'gml', 'gms': 'gams', @@ -101,8 +110,10 @@ 'hx': 'haxe', 'hylang': 'hy', 'i7': 'inform7', + 'i7x': 'inform7', 'iced': 'coffeescript', 'icl': 'clean', + 'ino': 'arduino', 'instances': 'roboconf', 'ipynb': 'json', 'irb': 'ruby', @@ -115,29 +126,38 @@ 'kt': 'kotlin', 'lassoscript': 'lasso', 'lazarus': 'delphi', + 'lc': 'livecode', 'lfm': 'delphi', + 'll': 'llvm', 'lpr': 'delphi', 'ls': 'livescript', - 'm': 'mercury', + 'm': 'matlab', 'mak': 'makefile', 'md': 'markdown', 'mikrotik': 'routeros', 'mips': 'mipsasm', - 'mk': 'makefile', + 'mk': 'monkey', 'mkd': 'markdown', 'mkdown': 'markdown', 'ml': 'ocaml', + 'mli': 'ocaml', 'mm': 'objectivec', 'mma': 'mathematica', 'moo': 'mercury', 'moon': 'moonscript', + 'nav': 'cal', + 'nb': 'mathematica', 'nc': 'gcode', 'nginxconf': 'nginx', + 'ni': 'inform7', 'nim': 'nimrod', 'nixos': 'nix', + 'nsi': 'nsis', 'obj-c': 'objectivec', 'objc': 'objectivec', 'osascript': 'applescript', + 'osl': 'rsl', + 'p': 'parser3', 'p21': 'step21', 'pas': 'delphi', 'pascal': 'delphi', @@ -145,6 +165,7 @@ 'pb': 'purebasic', 'pbi': 'purebasic', 'pcmk': 'crmsh', + 'pde': 'processing', 'pf.conf': 'pf', 'php3': 'php', 'php4': 'php', @@ -158,18 +179,28 @@ 'postgres': 'pgsql', 'postgresql': 'pgsql', 'pp': 'puppet', + 'proto': 'protobuf', 'ps': 'powershell', + 'ps1': 'powershell', + 'psd1': 'powershell', + 'psm1': 'powershell', 'py': 'python', 'qt': 'qml', 'rb': 'ruby', 're': 'reasonml', + 'rei': 'reasonml', 'rs': 'rust', + 'rsc': 'routeros', 'rss': 'xml', 'rst': 'nohighlight', + 's': 'armasm', 'SAS': 'sas', 'scad': 'openscad', 'sci': 'scilab', + 'scm': 'scheme', 'sh': 'bash', + 'sig': 'sml', + 'sl': 'rsl', 'st': 'smalltalk', 'step': 'step21', 'stp': 'step21', @@ -182,16 +213,22 @@ 'toml': 'ini', 'ts': 'typescript', 'txt': 'nohighlight', - 'v': 'verilog', + 'v': 'coq', 'vb': 'vbnet', 'vbs': 'vbscript', + 'vhd': 'vhdl', 'wildfly-cli': 'jboss-cli', + 'wl': 'mathematica', + 'wls': 'mathematica', 'xhtml': 'xml', 'xjb': 'xml', 'xls': 'excel', 'xlsx': 'excel', 'xpath': 'xquery', + 'xpo': 'axapta', + 'xpp': 'axapta', 'xq': 'xquery', + 'xqy': 'xquery', 'xsd': 'xml', 'xsl': 'xml', 'YAML': 'yaml', @@ -216,7 +253,15 @@ # dictionary mapping filenames to hljs languages _filename_to_hljs_language = { - 'cmakelists.txt': 'cmake' + 'cmakelists.txt': 'cmake', + '.htaccess': 'apache', + 'httpd.conf': 'apache', + 'access.log': 'accesslog', + 'nginx.log': 'accesslog', + 'resolv.conf': 'dns', + 'dockerfile': 'docker', + 'nginx.conf': 'nginx', + 'pf.conf': 'pf' } @@ -254,6 +299,8 @@ filename_lower = filename.lower() if filename_lower in _filename_to_hljs_language: return _filename_to_hljs_language[filename_lower] + if filename_lower in _hljs_languages: + return filename_lower exts = filename_lower.split('.') # check if file extension matches an hljs language # also handle .ext.in cases