mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Add github-linguist-grammars gem
The purpose of this gem is to package up the language grammars that are used for syntax highlighting on github.com. The grammars are TextMate, Sublime Text, or Atom language grammars, converted to JSON and given the filename SCOPE.json, where SCOPE is the language scope that the grammar defines. The github-linguist-grammars gem packages up all the grammars, and also exports a Linguist::Grammars.path method to locate the directory containing the grammars. To build the gem, simply run `rake build_grammars_gem`. The grammars.yml file lists all the repositories we download grammars from, as well as which scopes are defined by each repository. The script/download-grammars script takes that list and downloads and processes the grammars into the format expected by the gem.
This commit is contained in:
6
Rakefile
6
Rakefile
@@ -31,6 +31,12 @@ task :build_gem => :samples do
|
||||
File.delete("lib/linguist/languages.json")
|
||||
end
|
||||
|
||||
task :build_grammars_gem do
|
||||
rm_rf "grammars"
|
||||
sh "script/download-grammars"
|
||||
sh "gem", "build", "github-linguist-grammars.gemspec"
|
||||
end
|
||||
|
||||
namespace :benchmark do
|
||||
benchmark_path = "benchmark/results"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user