Rescript syntax highlighting support #8148

Open
opened 2025-11-02 07:55:19 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @joseluisq on GitHub (Nov 22, 2021).

Feature Description

It would be great if Gitea could support Rescript syntax highlighting.
For example Github already supports it via the ```res tag or the source code view. See example below.

module Button = {
  @react.component
  let make = (~count: int) => {
    let times = switch count {
    | 1 => "once"
    | 2 => "twice"
    | n => Belt.Int.toString(n) ++ " times"
    }
    let msg = "Clicked " ++ times

    <button> {msg->React.string} </button>
  }
}

Screenshots

The screenshot below shows how in Gitea 1.15.5 the Rescript code is displayed as a plain text.

Originally created by @joseluisq on GitHub (Nov 22, 2021). ### Feature Description It would be great if Gitea could support [Rescript](https://rescript-lang.org/) syntax highlighting. For example Github already supports it via the <code>```res</code> tag or the source code view. See example below. ```res module Button = { @react.component let make = (~count: int) => { let times = switch count { | 1 => "once" | 2 => "twice" | n => Belt.Int.toString(n) ++ " times" } let msg = "Clicked " ++ times <button> {msg->React.string} </button> } } ``` ### Screenshots The screenshot below shows how in Gitea `1.15.5` the Rescript code is displayed as a plain text. <img src="https://user-images.githubusercontent.com/1700322/142850843-fdcf552f-6c4c-49ac-ace4-67b3bbcc2e67.png" width="600">
GiteaMirror added the type/enhancementtype/upstream labels 2025-11-02 07:55:19 -06:00
Author
Owner

@Gusted commented on GitHub (Nov 22, 2021):

Hi @joseluisq

Gitea's syntax highlighting is done by the chroma library, I think it's better if a request is made to support rescript's syntax highlighting on their issue tracker.

@Gusted commented on GitHub (Nov 22, 2021): Hi @joseluisq Gitea's syntax highlighting is done by [the chroma library](https://github.com/alecthomas/chroma), I think it's better if a request is made to support rescript's syntax highlighting on their issue tracker.
Author
Owner

@joseluisq commented on GitHub (Nov 22, 2021):

It was my guess too. Yeah a proper request on Chroma project is also necessary.

@joseluisq commented on GitHub (Nov 22, 2021): It was my guess too. Yeah a proper request on Chroma project is also necessary.
Author
Owner

@joseluisq commented on GitHub (Nov 22, 2021):

Requested https://github.com/alecthomas/chroma/issues/576

@joseluisq commented on GitHub (Nov 22, 2021): Requested https://github.com/alecthomas/chroma/issues/576
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8148