icyphox / legit

web frontend for git
https://git.icyphox.sh
MIT License
376 stars 25 forks source link

Proposal for adding chroma code highlight #39

Open gabrielgio opened 1 month ago

gabrielgio commented 1 month ago

Hello,

I'd like to know if you are interested in adding highlight support through chroma^1.

I'd add chroma rendering to FileContent handler.

I'd also add option to select which theme do use^2:

Meta struct {
    Title       string `yaml:"title"`
    Description string `yaml:"description"`
    CodeStyle   string `yaml:"style"
} `yaml:"meta"`

Let me know if you'd take it and I can submit the patch myself :smile:

icyphox commented 1 month ago

Hi again! I don't personally see the value in syntax highlighting but if it can be toggled on/off via config, that would be great. So something like

meta:
  syntaxHighlighting:
     style: bw

and the existence of the syntaxHighlighting block would enable it; disabled if not defined. How does that sound? :)

icyphox commented 1 month ago

Or better yet,

meta:
  syntaxHighlight: bw    # or some other chroma theme