It's with a heavy heart that I'm announcing that it has been decided to sunset Lightshow.
Lightshow will be shutdown on 1 May 2022.
Why?
GitHub is reviewing all services for ownership, maintenance, usage, security risks and costs and sunsetting those that are no longer used or where the "cost" of maintaining and securing the service outweighs the usage and usefulness. Sadly, Lightshow falls into this category due to it being quite a niche service which in turn has incredibly low usage—we're seeing fewer than 30 legitimate page views a day with many days (not just weekends) having zero hits.
GitHub is also slowly moving away from the old Prettylights syntax highlighter which uses the TextMate compatible grammars in favour of a new syntax highlighter called Treelights which uses Tree-sitter grammars.
What do I use instead?
Unfortunately, there isn't another service available for grammar validation and demonstration like Lightshow, and due to licensing reasons surrounding the old Prettylights syntax highlighter, we can't open source Lightshow either.
The closest you can get to seeing how your grammar will appear on GitHub is to use the GitHub Atom theme (most likely to match GitHub's current colouring, thanks @Alhadis) or the GitHub VSCode Theme. The built-in VSCode scope inspector can help you debug grammars. These won't report errors in your grammar, nor will they pick up uses of Oniguruma-specific regexes which aren't compatible with PCRE which Prettylights uses, but it will show you how things will be hightlighted.
When a new grammar is added to Linguist the grammar compiler will validate your grammar and report warnings and any failures. This should catch any problems when new grammars are added or old grammars replaced. Please pay attention to the output from script/add-grammar when adding or replacing a grammar.
This validation is also performed every time we update the grammars used by Linguist when we make a new release. Any regressions will be reported to the upstream grammar repo and the grammar will not be updated in Linguist.
Can I run the compiler against my grammar to validate it before inclusion or updating?
The grammar compiler doesn't currently have support for checking individual grammars without adding them to Linguist first (PRs are welcome). The script/add-grammar will initiate a validation when you add or replace a grammar.
In order to test if an updated grammar will have any problems, you will need to ensure you meet the dependency requirements and follow the "Getting Started" steps from CONTRIBUTING.md, then...
- update just the grammar submodule:
git submodule update --remote vendor/grammars/<grammar-dirname>
- update the
grammars.yml file and check all the grammars script/grammar-compiler update. This will report all errors so you'll need to pay attention to those specific to the grammar you are checking. Add the -v flag for more verbose output which will also report non-fatal errors and warnings.
You can repeat these two steps until you are happy with the results.
There is no need to open a PR for updated grammars. These will be pulled in as part of the next Linguist release.
Can I submit a tree-sitter grammar for use on GitHub?
No, not at the moment. Linguist does not accept tree-sitter grammars and there is no public repository or location for requests for addition, but GitHub is considering how best to open this up to the public.
GitHub is slowly switching to the tree-sitter grammars from places like those owned by the Tree-sitter organisation, as they become feature complete, or from direct submissions from the specific language communities. If you would like your tree-sitter grammar considered, please use the "Contact GitHub" link on any page on GitHub.
The list of grammars at https://github.com/github/linguist/blob/master/vendor/README.md will be updated as each grammar is switched.
Will Lightshow be open sourced?
No. As mentioned above, the licensing for some of the code used by the Prettylights syntax highlighter prevents us from open sourcing Lightshow.
It's with a heavy heart that I'm announcing that it has been decided to sunset Lightshow.
Lightshow will be shutdown on 1 May 2022.
Why?
GitHub is reviewing all services for ownership, maintenance, usage, security risks and costs and sunsetting those that are no longer used or where the "cost" of maintaining and securing the service outweighs the usage and usefulness. Sadly, Lightshow falls into this category due to it being quite a niche service which in turn has incredibly low usage—we're seeing fewer than 30 legitimate page views a day with many days (not just weekends) having zero hits.
GitHub is also slowly moving away from the old Prettylights syntax highlighter which uses the TextMate compatible grammars in favour of a new syntax highlighter called Treelights which uses Tree-sitter grammars.
What do I use instead?
Unfortunately, there isn't another service available for grammar validation and demonstration like Lightshow, and due to licensing reasons surrounding the old Prettylights syntax highlighter, we can't open source Lightshow either.
The closest you can get to seeing how your grammar will appear on GitHub is to use the GitHub Atom theme (most likely to match GitHub's current colouring, thanks @Alhadis) or the GitHub VSCode Theme. The built-in VSCode scope inspector can help you debug grammars. These won't report errors in your grammar, nor will they pick up uses of Oniguruma-specific regexes which aren't compatible with PCRE which Prettylights uses, but it will show you how things will be hightlighted.
When a new grammar is added to Linguist the grammar compiler will validate your grammar and report warnings and any failures. This should catch any problems when new grammars are added or old grammars replaced. Please pay attention to the output from
script/add-grammarwhen adding or replacing a grammar.This validation is also performed every time we update the grammars used by Linguist when we make a new release. Any regressions will be reported to the upstream grammar repo and the grammar will not be updated in Linguist.
Can I run the compiler against my grammar to validate it before inclusion or updating?
The grammar compiler doesn't currently have support for checking individual grammars without adding them to Linguist first (PRs are welcome). The
script/add-grammarwill initiate a validation when you add or replace a grammar.In order to test if an updated grammar will have any problems, you will need to ensure you meet the dependency requirements and follow the "Getting Started" steps from CONTRIBUTING.md, then...
git submodule update --remote vendor/grammars/<grammar-dirname>grammars.ymlfile and check all the grammarsscript/grammar-compiler update. This will report all errors so you'll need to pay attention to those specific to the grammar you are checking. Add the-vflag for more verbose output which will also report non-fatal errors and warnings.You can repeat these two steps until you are happy with the results.
There is no need to open a PR for updated grammars. These will be pulled in as part of the next Linguist release.
Can I submit a tree-sitter grammar for use on GitHub?
No, not at the moment. Linguist does not accept tree-sitter grammars and there is no public repository or location for requests for addition, but GitHub is considering how best to open this up to the public.
GitHub is slowly switching to the tree-sitter grammars from places like those owned by the Tree-sitter organisation, as they become feature complete, or from direct submissions from the specific language communities. If you would like your tree-sitter grammar considered, please use the "Contact GitHub" link on any page on GitHub.
The list of grammars at https://github.com/github/linguist/blob/master/vendor/README.md will be updated as each grammar is switched.
Will Lightshow be open sourced?
No. As mentioned above, the licensing for some of the code used by the Prettylights syntax highlighter prevents us from open sourcing Lightshow.