-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Feature Description
Chroma is used to highlight code in gitea. Several issues opened are regarding support for new languages, link file extensions and even styles.
Since chroma uses a style+lexer combination for highlighting code, I suggest the following solution to fit all needs:
1 Priority:
The user can customise a particular file extension with the following lines on app.ini:
[highlight.mapping]
.mo = path_to_lexer.xml, path_to_style_normal, path_to_style_dark
Style types are optional, they can be files accessible by the server or the name of any style included in chroma.
2 Priority
If no custom definition is used for this file extension, the user can link an file extension to a chroma supported language:
[highlight.mapping]
.omnijs = JavaScript
Or optional:
.omnijs = JavaScript, path_to_style_normal, path_to_style_dark
With the same consideration of styles than 1.
3 Priority
If none is defined, then use the chroma/gitea defaults for lexer and styles
Screenshots
No response