@@ -1,10 +1,12 @@
1−## Syntax Highlighting in bat
1+## Add New Syntax Highlighting into the bat binary
22
3−`bat` uses the [syntect](https://github.com/trishume/syntect) library to highlight source
3+Should you find a particular syntax is not available within `bat` and think it should be included in `bat` by default, you can follow the instructions and policies outlined below.
4+
5+`bat` uses the excellent [syntect](https://github.com/trishume/syntect) library to highlight source
46code. As a basis, syntect uses [Sublime Text](https://www.sublimetext.com/) syntax definitions
57in the `.sublime-syntax` format.
68
7−In order to add new syntaxes to `bat`, follow these steps:
9+**Important:** Before proceeding, verify that the syntax you wish to add meets the [criteria for inclusion](#Criteria-for-inclusion-of-new-syntaxes).
810
9111. Find a Sublime Text syntax for the given language, preferably in a separate Git repository
1012 which can be included as a submodule (under `assets/syntaxes`).
@@ -13,13 +15,15 @@ In order to add new syntaxes to `bat`, follow these steps:
1315 Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
1416 *New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
1517
16−3. Run the `create.sh` script. It calls `bat cache --build` to parse all available
18+3. Run the `assets/create.sh` script. It calls `bat cache --build` to parse all available
1719 `.sublime-syntax` files and serialize them to a `syntaxes.bin` file (in this folder).
1820
19214. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the
2022 `bat` binary.
2123
22−5. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
24+5. Use `bat --list-languages` to check if the new languages are available.
25+
26+6. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
2327 file. A new binary cache file will be created once before every new release of `bat`.
2428
2529### Troubleshooting
@@ -50,3 +54,7 @@ The following files have been manually modified after converting from a `.tmLang
5054 https://github.com/seanjames777/SML-Language-Definition/blob/master/sml.tmLanguage
5155* `Cabal.sublime_syntax` has been added manually from
5256 https://github.com/SublimeHaskell/SublimeHaskell/ - we don't want to include the whole submodule because it includes other syntaxes ("Haskell improved") as well.
57+
58+## Criteria for inclusion of new syntaxes
59+
60+* More than 10,000 downloads on packagecontrol.io/