Closed alexanderadam closed 4 years ago
Maybe @mcuadros would like also to move this project to go-git organization?
That would be a simple change to the https://github.com/src-d/enry/blob/697929e1498cbdb7726a4d3bf4c48e706ee8c967/utils.go#L78 if group information would have been stored somewhere in the data
generated from .yml
A naive approach to implement that is to add a new internal/code-generator
asset that would output a map Language -> Group so the new GetColor
impl would do a lookup in there.
Originally, enry did not have a use case for colors, so implementation of the GetColor
was done by @lafriks under #233.
when enry is hard forked to go-enry organization I could probably implement this
JFYI I'm not related to the plans of forking enry to a go-enry org.
Meanwhile I have just pushed a https://pkg.go.dev/github.com/bzz/enry/v2 and will be happy to assist adding this feature, if needed.
This has been implemented by @lafriks and is included in latest https://github.com/go-enry/go-enry/releases/tag/v2.3.0
Awesome, thank you folks!
I opened this issue because of a corresponding issue in gitea.
Gitea uses enry for the language bar and some colors can't be fetched.
IMHO Linguist uses groups for this and properties are inherited from the parent group. For example Haml inherits from HTML.
So I guess it would help if the color mapping would work similar.
PS: Just some examples to point out what it looks like in gitea: