rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.3k stars 732 forks source link

Languages that are supported do not appear in list #1780

Open pippim opened 2 years ago

pippim commented 2 years ago

Looking at this list: https://github.com/rouge-ruby/rouge/blob/master/docs/Languages.md

You can see sh, bash and text are all missing yet seem to be supported.

Also basic is missing but I suspect it is supported.

Is there a complete list?

When downloaded with wget and converted to Python tuple (to advise user of supported languages):

('abap', 'actionscript', 'ada', 'apache', 'apex', 'apiblueprint', 'applescript', 'armasm', 'augeas', 'awk', 'batchfile', 'bbcbasic', 'bibtex', 'biml', 'bpf', 'brainfuck', 'brightscript', 'bsl', 'c', 'ceylon', 'cfscript', 'clean', 'clojure', 'cmake', 'cmhg', 'coffeescript', 'common_lisp', 'conf', 'console', 'coq', 'cpp', 'crystal', 'csharp', 'css', 'csvs', 'cuda', 'cypher', 'cython', 'd', 'dafny', 'dart', 'datastudio', 'diff', 'digdag', 'docker', 'dot', 'ecl', 'eex', 'eiffel', 'elixir', 'elm', 'email', 'epp', 'erb', 'erlang', 'escape', 'factor', 'fortran', 'freefem', 'fsharp', 'gdscript', 'ghc-cmm', 'ghc-core', 'gherkin', 'glsl', 'go', 'gradle', 'graphql', 'groovy', 'hack', 'haml', 'handlebars', 'haskell', 'haxe', 'hcl', 'hlsl', 'hocon', 'hql', 'html', 'http', 'hylang', 'idlang', 'igorpro', 'ini', 'io', 'irb', 'irb_output', 'isbl', 'j', 'janet', 'java', 'javascript', 'jinja', 'jsl', 'json', 'json-doc', 'jsonnet', 'jsp', 'jsx', 'julia', 'kotlin', 'lasso', 'liquid', 'literate_coffeescript', 'literate_haskell', 'livescript', 'llvm', 'lua', 'lustre', 'lutin', 'm68k', 'magik', 'make', 'markdown', 'mason', 'mathematica', 'matlab', 'minizinc', 'moonscript', 'mosel', 'msgtrans', 'mxml', 'nasm', 'nesasm', 'nginx', 'nim', 'nix', 'objective_c', 'objective_cpp', 'ocaml', 'ocl', 'openedge', 'opentype_feature_file', 'pascal', 'perl', 'php', 'plaintext', 'plist', 'pony', 'postscript', 'powershell', 'praat', 'prolog', 'prometheus', 'properties', 'protobuf', 'puppet', 'python', 'q', 'qml', 'r', 'racket', 'reasonml', 'rego', 'rescript', 'robot_framework', 'ruby', 'rust', 'sas', 'sass', 'scala', 'scheme', 'scss', 'sed', 'shell', 'sieve', 'slice', 'slim', 'smalltalk', 'smarty', 'sml', 'solidity', 'sparql', 'sqf', 'sql', 'ssh', 'stan', 'supercollider', 'swift', 'systemd', 'tap', 'tcl', 'terraform', 'tex', 'toml', 'tsx', 'ttcn3', 'tulip', 'turtle', 'twig', 'typescript', 'vala', 'vb', 'vcl', 'velocity', 'verilog', 'vhdl', 'viml', 'vue', 'wollok', 'xml', 'xojo', 'xpath', 'xquery', 'yaml', 'yang', 'zig', 'bash', 'sh', 'text') ('abap', 'actionscript', 'ada', 'apache', 'apex', 'apiblueprint', 'applescript', 'armasm', 'augeas', 'awk', 'batchfile', 'bbcbasic', 'bibtex', 'biml', 'bpf', 'brainfuck', 'brightscript', 'bsl', 'c', 'ceylon', 'cfscript', 'clean', 'clojure', 'cmake', 'cmhg', 'coffeescript', 'common_lisp', 'conf', 'console', 'coq', 'cpp', 'crystal', 'csharp', 'css', 'csvs', 'cuda', 'cypher', 'cython', 'd', 'dafny', 'dart', 'datastudio', 'diff', 'digdag', 'docker', 'dot', 'ecl', 'eex', 'eiffel', 'elixir', 'elm', 'email', 'epp', 'erb', 'erlang', 'escape', 'factor', 'fortran', 'freefem', 'fsharp', 'gdscript', 'ghc-cmm', 'ghc-core', 'gherkin', 'glsl', 'go', 'gradle', 'graphql', 'groovy', 'hack', 'haml', 'handlebars', 'haskell', 'haxe', 'hcl', 'hlsl', 'hocon', 'hql', 'html', 'http', 'hylang', 'idlang', 'igorpro', 'ini', 'io', 'irb', 'irb_output', 'isbl', 'j', 'janet', 'java', 'javascript', 'jinja', 'jsl', 'json', 'json-doc', 'jsonnet', 'jsp', 'jsx', 'julia', 'kotlin', 'lasso', 'liquid', 'literate_coffeescript', 'literate_haskell', 'livescript', 'llvm', 'lua', 'lustre', 'lutin', 'm68k', 'magik', 'make', 'markdown', 'mason', 'mathematica', 'matlab', 'minizinc', 'moonscript', 'mosel', 'msgtrans', 'mxml', 'nasm', 'nesasm', 'nginx', 'nim', 'nix', 'objective_c', 'objective_cpp', 'ocaml', 'ocl', 'openedge', 'opentype_feature_file', 'pascal', 'perl', 'php', 'plaintext', 'plist', 'pony', 'postscript', 'powershell', 'praat', 'prolog', 'prometheus', 'properties', 'protobuf', 'puppet', 'python', 'q', 'qml', 'r', 'racket', 'reasonml', 'rego', 'rescript', 'robot_framework', 'ruby', 'rust', 'sas', 'sass', 'scala', 'scheme', 'scss', 'sed', 'shell', 'sieve', 'slice', 'slim', 'smalltalk', 'smarty', 'sml', 'solidity', 'sparql', 'sqf', 'sql', 'ssh', 'stan', 'supercollider', 'swift', 'systemd', 'tap', 'tcl', 'terraform', 'tex', 'toml', 'tsx', 'ttcn3', 'tulip', 'turtle', 'twig', 'typescript', 'vala', 'vb', 'vcl', 'velocity', 'verilog', 'vhdl', 'viml', 'vue', 'wollok', 'xml', 'xojo', 'xpath', 'xquery', 'yaml', 'yang', 'zig', 'bash', 'sh', 'text')

bash, sh and text were manually added after wget operation....

jneen commented 2 years ago

Yep, that'll need an update. The canonical list is the output of rougify list, which is always up to date

pippim commented 2 years ago

@jneen thanks for confirming. The list was just updated a day or two ago. Can you advise how to run rougify list within GitHub Pages and save the results to a repo file?

tancnle commented 2 years ago

@pippim Thank you for raising the issue. FWIU, it is not a strict 1-1 mapping between language and lexer.

From what I can see the list generated by rougify list is the same as the one in Languages.md. It basically lists all the lexer entries under /lib/rouge/lexers/ directory.

pippim commented 2 years ago

@tancnle Sorry for slow response. Thank you for the explanation. What I did is scrape the file with wget and add the missing languages (that I use in Stack Exchange):

# Generate list of Rouge supported languages
echo
echo "=== RETRIEVING: Rouge Syntax Highlighting Languages list"
wget -qO languages https://raw.githubusercontent.com/rouge-ruby/rouge/master/docs/Languages.md

> rouge_languages.txt  # Empty old file

while read -r line; do
  sub=$(echo "$line" | awk -F'`' '{print $2}')
  # Get everything between '
  if [[ $sub ]] ; then
    # Was something found between '
    echo "$sub" >> rouge_languages.txt
  fi
done <languages

echo "bash" >> rouge_languages.txt  # Should be there? Maybe alias of "shell"?
echo "sh" >> rouge_languages.txt    # Should be there? Maybe alias of "shell"?
echo "text" >> rouge_languages.txt  # Should be there?
echo "python3" >> rouge_languages.txt  # Tested and it works in rouge
  1. First run git pull
  2. Then run above code
  3. Then run my program
  4. Then run git push

So everything is working OK me now. Still it would be nice to have a definitive list of supported languages, as opposed to a list of lexers.