3

Is there a way to identify a specific file extension in GitHub repository as a custom language and this language appears on language stats graph, also I want to choose what color it will appear, I want to to do this on a single repository only.

dxramax
  • 134
  • 4
  • 13

1 Answers1

5

If the language is one supported by the linguist library, you can make sure your repo recognises it as the main language used in said repository.
See "How to change the language of a repository on GitHub?", to modify your .gitattributes accordingly.

If your custom language is not one of the supported languages, then you can contribute to the linguist library.

I am not aware of any color customization though.
Although, pchaigno (one of the maintainers of linguist) do mentions in the comments:

When adding support for a new language in Linguist, you can also choose its color.
There are, however, some restrictions to make sure all languages' colors can be distinguished by the human eye (as much as possible).
Also, the custom language feature has been asked twice on the Linguist repository (#2627 and #2598).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • for a custom language, can I make only my repository to recognize it, or they only way is to contribute to the linguist library. – dxramax Mar 04 '17 at 09:04
  • For a new language, you need to contribute to Linguist first, and then declare it in your git attributes. – VonC Mar 04 '17 at 09:36
  • When adding support for a new language in Linguist, you can also choose its color. There are, however, some restrictions to make sure all languages' colors can be distinguished by the human eye (as much as possible). Also, the custom language feature has been asked twice on the Linguist repository ([#2627](https://github.com/github/linguist/issues/2627) and [#2598](https://github.com/github/linguist/issues/2598)). – pchaigno Aug 14 '17 at 20:26
  • @pchaigno Thank you. I have included your comment in the answer for more visibility. – VonC Aug 14 '17 at 22:23