From 5a1dab807323dd9c9bd7a2425d5ef4ae489d7c16 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Sun, 4 May 2014 09:59:11 -0500 Subject: [PATCH] Note on extensions --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 1ff2ed8f..055aea91 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,29 @@ To run the tests: The majority of contributions won't need to touch any Ruby code at all. The [master language list](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml) is just a YAML configuration file. +### A note on language extensions + +Linguist has a number of methods available to it for identifying the language of a particular file. The initial lookup is based upon the extension of the file, possible file extensions are defined in an array called `extensions`. Take a look at this example for example for `Perl`: + +``` +Perl: + type: programming + ace_mode: perl + color: "#0298c3" + extensions: + - .pl + - .PL + - .perl + - .ph + - .plx + - .pm + - .pod + - .psgi + interpreters: + - perl +``` +Any of the extensions defined are valid but the first in this array should be the most popular. + We try to only add languages once they have some usage on GitHub, so please note in-the-wild usage examples in your pull request. Almost all bug fixes or new language additions should come with some additional code samples. Just drop them under [`samples/`](https://github.com/github/linguist/tree/master/samples) in the correct subdirectory and our test suite will automatically test them. In most cases you shouldn't need to add any new assertions.