Feature #33859

Add a list of supported languages by the code highlighter to the help

Added by Mizuki ISHIKAWA almost 2 years ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Documentation
Target version:5.0.0
Resolution:Fixed

Description

It's useful to be able to see the languages that syntax highlighting supports in your static files so you don't have to switch to an external site(https://redmine.org/projects/redmine/wiki/RedmineCodeHighlightingLanguages) every time.
Also, having a list of supported languages as an html file is useful when different Redmine versions support different languages.

I would like to see a list of languages by clicking the links in the reference as below.

ScreenShot_2020-08-17_15.09.34.png (104 KB) Mizuki ISHIKAWA, 2020-08-17 08:13

ScreenShot_2020-08-17_15.09.47.png (105 KB) Mizuki ISHIKAWA, 2020-08-17 08:13

feature-33859-only-english-sample.patch Magnifier (27.5 KB) Mizuki ISHIKAWA, 2020-08-17 08:16

0001-Add-the-list-of-all-supported-languages-by-the-synta.patch Magnifier (301 KB) Go MAEDA, 2021-09-08 16:29


Related issues

Related to Redmine - Feature #36594: Relax rouge version dependency in Gemfile New

Associated revisions

Revision 21298
Added by Go MAEDA 7 months ago

Add a list of supported languages by the code highlighter to the help (#33859).

Contributed by Mizuki ISHIKAWA.

Revision 21401
Added by Go MAEDA 5 months ago

Escape HTML in the code highlighter help (#33859).

History

#1 Updated by Mizuki ISHIKAWA almost 2 years ago

The attached patch is a sample that adds a link to the English reference only.
The content of languages_supported_by_syntax_highlighting.html is English, and it is difficult to make the description of the supported language in it multilingual.

Since languages_supported_by_syntax_highlighting.html is useful for checking the distinguished name of a language even if it is in English, I think you can link to languages_supported_by_syntax_highlighting.html from other language references.

#2 Updated by Go MAEDA 10 months ago

Updated the patch:

#3 Updated by Go MAEDA 9 months ago

  • Target version changed from Candidate for next major release to 5.0.0

Setting the target version to 5.0.0.

#4 Updated by Go MAEDA 7 months ago

  • Subject changed from Check the files supported by syntax highlighting in static file to Add a list of supported languages by the code highlighter to the help
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the changes. Thank you for your contribution.

#5 Updated by Go MAEDA 5 months ago

Escaped HTML special characters inside <td> in r21401. The following is the one-liner that I used to generate the updated HTML.

bin/rails r 'Rouge::Lexer.all.sort_by(&:tag).each {|lexer| desc = String.new("#{lexer.desc}"); desc << " [aliases: #{lexer.aliases.join(%q|,|)}]" if lexer.aliases.any? ; puts "<tr>\n  <td>#{lexer.tag}</td>\n  <td>#{CGI.escapeHTML(desc)}</td>\n</tr>"}'

#6 Updated by Holger Just 5 months ago

  • Related to Feature #36594: Relax rouge version dependency in Gemfile added

Also available in: Atom PDF