Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

General solution for code highlighting using [highlight.mapping] #35251

Open
Labels
type/proposalThe new feature has not been accepted yet but needs to be discussed first.
@BasilioPV

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /